Mass Effect Andromeda

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

just as reminder from bf3 pdb leak: https://pastebin.com/79ydJnd5
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: Mass Effect Andromeda

Post by michalss »

weiyun wrote:
warrantyvoider wrote:simple answer, dawnless used my code and research, and made her own tool without mentioning me (afaik), so that tool came after DAItoolsWV (btw, the same goes for ehams tool, forgot how he called his)

greetz


I ported your DAI code for stringtable and it works. Game uses TTF as font file this time.

Image


I think WV code for stringtable was not correct, coz of encoding i think, it must be unicode not ascii. We did complete localization tools for DAI in the past with my friend, so string table repack is not a problem to be honest. What im looking for is to create own patch :D to localize this game.. BTW in DAI was use Flash font GFX. Dont see why this game would be a different yet or ? :)
Last edited by michalss on Sun Apr 09, 2017 6:51 am, edited 2 times in total.
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

michalss wrote:I think VW code for stringtable was not correct, coz of encoding i think, it must be unicode not ascii. We did complete localization tools for DAI in the past with my friend, so string table repack is not a problem to be honest. What im looking for is to create own patch :D to localize this game.. BTW in DAI was use Flash font GFX. Dont see why this game would be a different yet or ? :)


I know its not ascii, there are like 100 codepages, so im gonna rewrite it codepage-aware anyway, the code is just usefull for understanding general talktable structure in hex. btw its WV

in other news, ported the new "DBObject" class (as I now called it, because bf3 pdb leak calls it the same, just DBObjectElement which was too long for my taste) into my tool and rewrote everything around reading these structure, so now works again including loading into VFS, decryption and so on

Image

btw im already working with a friend on translating to chinese, so for this to work, we need to be able to use fonts of different codepages anyway, does anyone know what fonts are even used, if I can change them (change some config, hook import apis maybe?! dunno) and how frostbite handles them in general? are the fonts saved as binary somewhere? gonna work on the talktables next, so I have something easy to check when trying reimports

greetz WV

EDIT:I just noticed loading entire bundles doesnt work anymore, as theres no top node anymore, gonna make it so, that you can select them from FS tree instead, but going to sleep now, sry, is for next time^^
OClear
Posts: 45
Joined: Tue Feb 16, 2016 6:36 pm

Re: Mass Effect Andromeda

Post by OClear »

Is anyone writing a tool that can extract all the .cas chunks to file with the proper filename?

I wrote a small tool that can extract and decompress .cas chunks, but the filename is wrong. CAS files store 20-bit SHA1 ids, but I need these chunks named by their 16-bit UUID to make them useful. So, now I have to dig through these .sb files looking for them.

Just wondering if someone already has a tool that does this, otherwise I will keep at it.
xrb936
Posts: 6
Joined: Sun Mar 19, 2017 9:07 am

Re: Mass Effect Andromeda

Post by xrb936 »

michalss wrote:
weiyun wrote:
warrantyvoider wrote:simple answer, dawnless used my code and research, and made her own tool without mentioning me (afaik), so that tool came after DAItoolsWV (btw, the same goes for ehams tool, forgot how he called his)

greetz


I ported your DAI code for stringtable and it works. Game uses TTF as font file this time.

Image


I think VW code for stringtable was not correct, coz of encoding i think, it must be unicode not ascii. We did complete localization tools for DAI in the past with my friend, so string table repack is not a problem to be honest. What im looking for is to create own patch :D to localize this game.. BTW in DAI was use Flash font GFX. Dont see why this game would be a different yet or ? :)

Could you please share your old tools about DAI? THX!
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

yay, my chinese friend showed me where the fonts are stored...

Image

then choose one of the res objects

Image

export them as .ttf and you can preview them

Image

greetz WV
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

switched to using context menus, also you can load now entire bundles from the main view and ebx/res/chunk items from structure view
Image

as texture data can have MANY formats (see MSDN), I made a quick helper tool to figure out proper header for the texture data, it also allows you to export the raw texture data for experiments, sofar ive seen most common format seems to be 0x42 and 0x3C, but no idea yet how to make a dds header for it...

Image

you need to load all chunks and res into VFS, so TDP can find the res data aswell as the texture data, at best simply load entire bundles

greetz WV

PS:just wanna add that I removed "File System" menu now entirely, as its still visible in aboves screenshot...
Hairless_Wookiee
Posts: 12
Joined: Thu Sep 24, 2015 9:03 pm

Re: Mass Effect Andromeda

Post by Hairless_Wookiee »

warrantyvoider wrote:but no idea yet how to make a dds header for it...

Possibly via texconv? https://github.com/Microsoft/DirectXTex

Although I haven't had any luck trying to extract a viable image from hex dumps using any tools. I'm unsure if I am reading your suggested format correctly. For example, is 0x43 (67) D3DFMT_A2W10V10U10? If that is the case, what is 0x42 (66), as I can't see it on the linked format chart? There's also this format chart - https://msdn.microsoft.com/en-us/library/windows/desktop/bb173059(v=vs.85).aspx
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

Hairless_Wookiee wrote:
warrantyvoider wrote:but no idea yet how to make a dds header for it...

Possibly via texconv? https://github.com/Microsoft/DirectXTex

Although I haven't had any luck trying to extract a viable image from hex dumps using any tools. I'm unsure if I am reading your suggested format correctly. For example, is 0x43 (67) D3DFMT_A2W10V10U10? If that is the case, what is 0x42 (66), as I can't see it on the linked format chart? There's also this format chart - https://msdn.microsoft.com/en-us/library/windows/desktop/bb173059(v=vs.85).aspx


damn! I really dont know, I just guess and compare with other code... well I can gurantuee that the res data in hex preview is the data belonging to the res and that the hex in TDP preview is the chunk data referenced by that res. now the texture infos displayed, is extracted from the res data by the structure definition I had from DAI, just they added an unknown int, that seems to be zero all the time, and proof me wrong, but thats how it makes sense sofar (height,width, etc...). making the dds header isnt easy, this is only the dds data, the header has to be generated.

as Im at work and dont have the game here, cant some run the game and use one of the texture dumper tools to determine the format of the loaded textures in memory?

greetz
Hairless_Wookiee
Posts: 12
Joined: Thu Sep 24, 2015 9:03 pm

Re: Mass Effect Andromeda

Post by Hairless_Wookiee »

warrantyvoider wrote:as Im at work and dont have the game here, cant some run the game and use one of the texture dumper tools to determine the format of the loaded textures in memory?

I actually tried that before your tools were available but couldn't get anything to work with the legit version. I assumed Origin was blocking the attempt. Maybe someone with the "cracked" (really emulated I guess?) version can do it.
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

well there are no protections against debugging and memory editing as far as ive seen, its really just a copy protection, so maybe they used a new format? 66 isnt used in the D3DFORMAT enum, but is included in your list, just there its "DXGI_FORMAT_R1_UNORM" which is a very special format for text rendering actually and doesnt make sense as face texture format, its also very thinly documented... so dunno, maybe something new?
Hairless_Wookiee
Posts: 12
Joined: Thu Sep 24, 2015 9:03 pm

Re: Mass Effect Andromeda

Post by Hairless_Wookiee »

You'd think they'd follow DAI. What did that have? Off the top of my head, normal maps were BC5, there were some masks that were uncompressed 8.8.8.8 ARGB, then DXT1 and 5 for various others.
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

I really cant remember, but they definitly use different ones, as ive seen in my code. the idea would be to guess the format, create a file with that setting and the size of your texture (notice the mip start, if wsize is f.e. 1024 and mipstart is 3, that means the mips start with 256 wsize) and then c&p then exported hex over the image data, keeping the header. first problem already is: a 256x256 texture seem to never have the same datasize as the exported data, so even with trial and error I dont see yet, which format it could be

PS: DAI code supported formats: 0x00, 0x01, 0x03, 0x04, 0x0B, 0x0C, 0x0D, 0x10, 0x13, 0x14 and 0x36
OClear
Posts: 45
Joined: Tue Feb 16, 2016 6:36 pm

Re: Mass Effect Andromeda

Post by OClear »

warrantyvoider wrote:PS:just wanna add that I removed "File System" menu now entirely, as its still visible in aboves screenshot...


Doesn't work for me anymore. FS -> load FS -> crash.

Code: Select all

************** Exception Text **************
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at MEAExplorerWV.TOC..ctor(Byte[] data)
   at MEAExplorerWV.FS.TOCEntry..ctor(String path, String display, Byte[] input)
   at MEAExplorerWV.FS.LoadTOCFile(String path, String display)
   at MEAExplorerWV.Form1.LoadFS()
   at MEAExplorerWV.Form1.loadFSToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

OClear wrote:
warrantyvoider wrote:PS:just wanna add that I removed "File System" menu now entirely, as its still visible in aboves screenshot...


Doesn't work for me anymore. FS -> load FS -> crash.

Code: Select all

************** Exception Text **************
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at MEAExplorerWV.TOC..ctor(Byte[] data)
   ...


so why has none of the other 26 downloaders this problem? do you bought the game? do you select the game exe? have you edited files alread? a bit more information than "it crashed" would be needed if you want help
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

was able to export format 0x37, its basic DXT1, so a start at least...

Image

Image

greetz WV
Devisaur
Posts: 15
Joined: Thu Mar 30, 2017 11:18 pm

Re: Mass Effect Andromeda

Post by Devisaur »

Unrelated to the texture/model discussion going on. I'm trying to determine where within these files would the text, specifically in-game written text not subtitles, be located? I've done some browsing using WV's tool --I've looked into the .loc files, is it possible that the text contained is within the texttables, or are texttables solely used for conversational agents?
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

most text is in talktables, so they can be easily replaced with the current loaded language (afaik) because a text is only referenced by its index

greetz
Devisaur
Posts: 15
Joined: Thu Mar 30, 2017 11:18 pm

Re: Mass Effect Andromeda

Post by Devisaur »

warrantyvoider wrote:most text is in talktables, so they can be easily replaced with the current loaded language (afaik) because a text is only referenced by its index

greetz


I see -- that makes sense. Helps narrow down my focus when there are a million different files. It looked like xrb936 successfully implemented your code -- I'll see if I can do the same. Unless they want to release their code :P
warrantyvoider
Posts: 236
Joined: Tue Apr 04, 2017 11:44 am

Re: Mass Effect Andromeda

Post by warrantyvoider »

im going to add the code to this project aswell, but do what you want