It is currently Mon Dec 18, 2017 5:04 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: 3dsmed pcars 2
PostPosted: Sun Sep 24, 2017 5:28 am 
Offline
Jackman
Jackman

Joined: Sun Sep 24, 2017 3:51 am
Posts: 2
Hello. Is it provided the possibility of importing .meb from pcars 2 because it gives an error size unknown;
thank you

Image


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Wed Sep 27, 2017 7:13 am 
Offline
Jackman
Jackman

Joined: Thu Mar 14, 2013 9:51 am
Posts: 6
bird wrote:
Hello. Is it provided the possibility of importing .meb from pcars 2 because it gives an error size unknown;
thank you

Image


Yep same as me, Dave will you update .med import??


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Sat Sep 30, 2017 1:24 pm 
Offline
Jackman
Jackman

Joined: Thu Mar 14, 2013 9:51 am
Posts: 6
Dave this info could be useful for ... maybe....

Wrote by aluigi


Quote:
I just checked the file LAM_HURA_16_BODY_LODA.meb and the difference
is that 4 bytes every 12 bytes are obfuscated in some way.
What I mean is easily visible by using xoring the original file with
the new one and watching the obtained file with a hex editor.

This sort of obfuscation covers only a part of the meb file so it's
applied to specific data of this format and note to the whole file
as-is.

I don't know what obfuscation is used, but there are a lot of 0xaa
bytes when you xor the 2 files.
Considering that it's a list of 32bit float numbers (X axis of
XYZ coordinates of something?) it may be just a float-related math
operation used as obfuscation, for example:
1.583825246319139e-314 -> 3.458537934047377e-315


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Sat Sep 30, 2017 1:46 pm 
Offline
Jackman
Jackman

Joined: Sat Sep 30, 2017 12:05 pm
Posts: 1
Please update for Pcars 2 Dave...Thanks in advance :wink:


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Tue Oct 03, 2017 4:07 am 
Offline
Tirechanger
Tirechanger

Joined: Tue Jun 24, 2014 11:06 am
Posts: 37
Yes it would be nice to have but i believe they have changed the encryption (well thats what they said they would do) on the models to stop exporting. They did say it would support the old stile files to for modding. But who really knows.

Cheers,
DrDoomsLab.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Fri Oct 06, 2017 11:41 am 
Offline
US Pits Crew
US Pits Crew

Joined: Thu Sep 01, 2005 9:58 am
Posts: 1302
Location: Barnet, London
I have PC2 but there is definitely a problem with the x coordinates, I presume they are scrambled in some way.

I also notice that Aluigi has the filename "LAM_HURA_16_BODY_LODA" whereas I only ever get numbers in the filenames which is a really big pain.

Cheers!

Dave N.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Sat Oct 07, 2017 6:50 am 
Offline
Tirechanger
Tirechanger
User avatar

Joined: Thu Jul 09, 2015 8:17 pm
Posts: 16
Location: Russia, Taganrog City
Dave Noonan wrote:
I have PC2 but there is definitely a problem with the x coordinates, I presume they are scrambled in some way.

Did you see my post at ZenHax?
Shaders doesn't contain any clues?

Quote:
I also notice that Aluigi has the filename "LAM_HURA_16_BODY_LODA" whereas I only ever get numbers in the filenames which is a really big pain.

Renaming is not a big prombem:
MEB contain filename (i guess) inside of file, starting from 08h.

BMT have endings like:
GENERIC_CARBON_FLAT (null bytes) Render\Shaders\bodywork_carbon_cpit.fx (null bytes) Bodywork (null bytes) EBFCT_ANTICLOCKWISE
ACURA_NSX_17_LIGHTS (null bytes) Render\Shaders\vehicles_basic.fx (null bytes) VehicleBasic (null bytes) EBFCT_ANTICLOCKWISE
ACURA_NSX_17_INTERIOR (null bytes) Render\Shaders\vehicles_basic.fx (null bytes) VehicleBasic (null bytes) EBFCT_ANTICLOCKWISE
GENERIC_CARBON_FLAT, ACURA_NSX_17_LIGHTS, ACURA_NSX_17_INTERIOR - looks like a good choice for automatic rename.

XML and RCF have node names.

DDS can be a problem, because they have standard headers but contains data with modern compression and have identical file size for diffuse and normal maps (header is identical too).
But if we lucky, they can be arranged as before packing (alphabetically) and can be renamed accordingly, maybe semi-automated, maybe i do a batch file for renaming - not so big problem.

But all this is useless before someone's got a key to obfuskation.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Sun Oct 08, 2017 12:20 pm 
Offline
US Pits Crew
US Pits Crew

Joined: Thu Sep 01, 2005 9:58 am
Posts: 1302
Location: Barnet, London
I agree with what you are saying but the effort to get the right materials will be a waste of time unless we get around the texture map naming problem, we cannot even make a clever guess as to which texture to use with each material.
This means I have to leave the objects with solid shading.

Cheers!

Dave N.

Andrakann wrote:
Dave Noonan wrote:
I have PC2 but there is definitely a problem with the x coordinates, I presume they are scrambled in some way.

Did you see my post at ZenHax?
Shaders doesn't contain any clues?

Quote:
I also notice that Aluigi has the filename "LAM_HURA_16_BODY_LODA" whereas I only ever get numbers in the filenames which is a really big pain.

Renaming is not a big prombem:
MEB contain filename (i guess) inside of file, starting from 08h.

BMT have endings like:
GENERIC_CARBON_FLAT (null bytes) Render\Shaders\bodywork_carbon_cpit.fx (null bytes) Bodywork (null bytes) EBFCT_ANTICLOCKWISE
ACURA_NSX_17_LIGHTS (null bytes) Render\Shaders\vehicles_basic.fx (null bytes) VehicleBasic (null bytes) EBFCT_ANTICLOCKWISE
ACURA_NSX_17_INTERIOR (null bytes) Render\Shaders\vehicles_basic.fx (null bytes) VehicleBasic (null bytes) EBFCT_ANTICLOCKWISE
GENERIC_CARBON_FLAT, ACURA_NSX_17_LIGHTS, ACURA_NSX_17_INTERIOR - looks like a good choice for automatic rename.

XML and RCF have node names.

DDS can be a problem, because they have standard headers but contains data with modern compression and have identical file size for diffuse and normal maps (header is identical too).
But if we lucky, they can be arranged as before packing (alphabetically) and can be renamed accordingly, maybe semi-automated, maybe i do a batch file for renaming - not so big problem.

But all this is useless before someone's got a key to obfuskation.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Thu Oct 12, 2017 6:31 pm 
Offline
Tirechanger
Tirechanger

Joined: Tue Jun 24, 2014 11:06 am
Posts: 37
Yes the textures/mats are a pain but thats how it was with pcars1. I did manage to make up a load of texture names for general textures from pcars1 but it took a lot of time as i was manually trying them out and then deciding if it was right. Worked well in the end. Anyways let us know how you get on.

Cheers.
DrDoomsLab.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Thu Oct 19, 2017 5:47 am 
Offline
Tirechanger
Tirechanger
User avatar

Joined: Thu Jul 09, 2015 8:17 pm
Posts: 16
Location: Russia, Taganrog City
Dave Noonan wrote:
I agree with what you are saying but the effort to get the right materials will be a waste of time unless we get around the texture map naming problem, we cannot even make a clever guess as to which texture to use with each material.
This means I have to leave the objects with solid shading.


MEBs can be renamed by extracting their names from VHF file, sorting alphabetically and use this list to rename alphabetically sorted MEBs filelist:
Image

For DDS this trick doesn't work, because after visually checking their list looks like this:
Code:
00006e10.dds   acura_nsx_17_wipers_mask.dds
00073660.dds   acura_nsx_17_wipers_trails.dds
003bbd60.dds   acura_nsx_17_badges_nmp8888.dds
003ceb30.dds   acura_nsx_17_badges_spec.dds
003d3ee0.dds   acura_nsx_17_badges_diff.dds
003e18f0.dds   acura_nsx_17_misc_nmp8888.dds
003fa8b0.dds   acura_nsx_17_misc_spec.dds
00404fa0.dds   acura_nsx_17_misc_diff.dds
005ce010.dds   generic_licplate_us_glow.dds
005d1020.dds   generic_licplate_us_nmp8888.dds
005d5150.dds   generic_licplate_us_diff.dds
005d7500.dds   acura_nsx_17_lights_glow.dds
005e5cb0.dds   acura_nsx_17_lights_nmp8888.dds
005f7c10.dds   acura_nsx_17_lights_spec.dds
005fe800.dds   acura_nsx_17_lights_diff.dds
0095c0f0.dds   acura_nsx_17_disc_blur_spec.dds
0095f830.dds   acura_nsx_17_disc_blur_diff.dds
009609e0.dds   acura_nsx_17_disc_spec.dds
00963fa0.dds   acura_nsx_17_disc_diff.dds
009722e0.dds   acura_nsx_17_interior_glow.dds
009736d0.dds   acura_nsx_17_interior_spec.dds
0097d4d0.dds   acura_nsx_17_interior_diff.dds
00ae68a0.dds   tread_pirelli_huayra_blur_nmp8888.dds
00ae6ae0.dds   tread_pirelli_huayra_blur_spec.dds
00ae8070.dds   tread_pirelli_huayra_blur_diff.dds
00ae9040.dds   tread_pirelli_huayra_nmp8888.dds
00af8550.dds   tread_pirelli_huayra_spec.dds
00afaeb0.dds   tread_pirelli_huayra_diff.dds
00b4eb70.dds   acura_nsx_17_wheel_blur_spec.dds
00b56360.dds   acura_nsx_17_wheel_blur_diff.dds
00b60d00.dds   acura_nsx_17_wheel_nmp8888.dds
00b73c20.dds   acura_nsx_17_wheel_spec.dds
00b7af10.dds   acura_nsx_17_wheel_diff.dds
00df9820.dds   
00df9910.dds   

(last pair is shadow and some FX single channel textures, those names missing in BMTs)

So, i dig deeper and found this order:
Image

Looks like devs reading BMTs (not alphabetically but in order they are packed), search for used textures in backward order (ignoring common_* ones) and add them to BFF archive (ignoring double hits).

Only tested with extracted Acura_NSX_2017.bff so far.


Attachments:
File comment: Batch files for renaming.
Acura_NSX_2017_rename.zip [1.65 KiB]
Downloaded 16 times
Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Thu Oct 19, 2017 2:15 pm 
Offline
US Pits Crew
US Pits Crew

Joined: Thu Sep 01, 2005 9:58 am
Posts: 1302
Location: Barnet, London
Yes, I've noticed the same and I agree that I can find all the .meb names by looking at the headers but I would still be stuck with the texture names when I read the unpacked files I don't know the order they were in within the .bff.

Somewhere there must be a table that maps the numbers to the full names.

Cheers!

Dave N.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Fri Oct 20, 2017 2:29 am 
Offline
Tirechanger
Tirechanger
User avatar

Joined: Thu Jul 09, 2015 8:17 pm
Posts: 16
Location: Russia, Taganrog City
Dave Noonan wrote:
Yes, I've noticed the same and I agree that I can find all the .meb names by looking at the headers but I would still be stuck with the texture names when I read the unpacked files I don't know the order they were in within the .bff.

Somewhere there must be a table that maps the numbers to the full names.

Those numbers is just hex-offsets from BFF, i think they have no use, except order of packing.

ACURA_NSX_17_BODY_LODA.meb and ACURA_NSX_17_BODY_LODA_dmg.meb have the same header "ACURA_NSX_17_BODY_LODA", so it's better to use alphabetical rename here.

Order of DDS inside BFF reflects the order of their offset-filenames after unpacking (btw, windows explorer can't sort them correctly, Double Commander can).

Reverse renaming can be automated, but requires writing additional tool (i think QuickBMS scripts can't do the job).

Steps for renaming MEB, DDS and BMT are:
MEB:
- Build correct alphabetical list of MEBs in folder (list1).
- Read VHF-file for correct MEB names (strings like <RESOURCE Filename="vehicles\Acura_NSX_2017\ACURA_NSX_17_BONNET_LODC_dmg.meb" />) and sort resulting list alphabetically (list2).
- Rename files from list1 to list2 names.
DDS:
- Build correct alphabetical list of all DDS in folder (list1).
- Build correct alphabetical list of all BMT in folder (temp_list).
- Read BMT files from temp_list for correct DDS names (strings like vehicles\textures\acura_nsx_17_badges_nmp8888.dds) by backward order for each BMT, ignoring common_*.dds and duplicating names (build list2).
- Rename files from list1 to list2 names (skipping 2 names from the end of list1).
BMT:
- Filename can be found close to the end of file, string like v1.0.0.1[null byte(s)]NAME[null byte(s)]Render\Shaders
(rename only after DDS is already renamed)

This must work for Acura_NSX_2017, need additional checkings for other cars/parts folders.

Upd: Looks valid for Acura_NSX_2017_Cockpit too.
There are nuance in correct sorting order for this parts:
ACURA_NSX_17_INTERIOR_CPIT.meb
ACURA_NSX_17_INTERIOR2_CPIT.meb
Most browsers and Excel sort them as above and it's wrong for correct renaming.
They must be sorted in this order (to reflect order for offset-names):
ACURA_NSX_17_INTERIOR2_CPIT.meb
ACURA_NSX_17_INTERIOR_CPIT.meb
and only Total Commander can do this right, using "Strictly by numeric character code" sort method.

And for DDS there are 4 textures at the end of list without names to replace, looks like UI elements.


Attachments:
File comment: Batch files for renaming (MEB+DDS only).
Acura_NSX_2017_Cockpit_rename.zip [728 Bytes]
Downloaded 17 times
Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Fri Oct 20, 2017 12:18 pm 
Offline
US Pits Crew
US Pits Crew

Joined: Thu Sep 01, 2005 9:58 am
Posts: 1302
Location: Barnet, London
I have had another look at the naming and decided to have a read of the script Luigi wrote to pull files from the .PAK archives.

What I have seen is that there is no attempt to read the names, instead the offset within the .PAK of the data is used for the name and hence it's possible to have duplicate filenames. BTW for some reason the filename extension can be easily found but it is the title of the file which is in someway encrypted and there is this comment:-

Code:
if VERSION == 4 # Project Cars
    # names are not supported because they use a boring
    # and chaotic obfuscation method (no rc4), if one
    # day I will have time and desire maybe I will look
    # at them
    set X120OFFSET long 0
....


further down the code the packed offset is used for the filename.

Code:
string NAME p= "%08x.%s" OFFSET EXT


So we can give up looking for a mapping of the names, unless somebody can take over Luigi's work. I should have looked at the script earlier..

I'll use the internal names for the .meb and .bmt and try to improve the Project Cars import.

For Project Cars 2 we are still stuck with the encryption of the x coordinates within .mebs and I think the key is different for every .meb and cannot find where it is stored (but I presume it's in the BFF).

Cheers!

Dave N.


Top
 Profile  
 
 Post subject: Re: 3dsmed pcars 2
PostPosted: Fri Oct 20, 2017 6:13 pm 
Offline
Jackman
Jackman

Joined: Sun Sep 24, 2017 3:51 am
Posts: 2
thanks for the work;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group