Extracting game data (images, textures and models)

Talk about game mods and editors, no game hacking here (cheat engine..etc)

Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 19, 2010 8:01 am

Hi sethioz!

I have this game I want to mod but the data I need to do this is stored in pkg files. It can't be extracted by conventional methods and I was browsing and searching them with hex-editor but nothing makes sense.

For now I just want to find some simple in-game pictures like portraits. I tried searching the usual formats in hex like jpg, gif etc but found nothing. So I think the data is encrypted.

Now as I understand (I'm not a programmer) if data is encrypted it must be decrypted when game is running. So I used tsearch to open the process and it's hex code.. if something is currently running on my game screen i.e. the pic I want to extract then it must be somewhere in the hex-code, right?

If I find manage to extract a piece of data this way I should be able to have some reference to decrypt the rest of the files I need for modding..

So my questions is can it be done? I don't want to lose time in vain... what I tend to do lot taking on tasks which are virtually impossible. I know this gaming company is very strict and paranoid when it comes to stuff like this. They didn't release the SDK or simple map editor even there were some promises in the beginning.

Thanks in advance...
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby KEN » Sun Sep 19, 2010 8:19 am

Maikon wrote:
I have this game

but which game?
y not mod it with img editor instead of hex?
User avatar
KEN
Moderator
Moderator
 
Posts: 756
Joined: Thu Jan 28, 2010 8:11 am

Re: Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 19, 2010 8:42 am

KEN wrote:but which game?
rts order of war by [] enix

KEN wrote:y not mod it with img editor instead of hex?
I presumed there isn't one out for this game..and I usually changes textures with photoshop and models with 3dsmax...

i want to start small like by changing flag textures but can't access any of game data files...
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Sun Sep 19, 2010 1:40 pm

first of, wrong place, this isnt hacking, its modding, so MOVED

secondly, name the game and more information about the game at start, that is most important.

i dont think that there is actual .jpg in the memory, it loads the file, but it never shows the filename. only some rare and old games might show it. that only happens, if game is pointed to a file and it loads it externally. like on websites, you can include off-site avatar. you point to a avatar path, this is why some games have like blah.jpg in the memory, otherwise it is just FJ((#()@$)@#R. exactly what you would see if you open picture with a hex or text editor.
so its useless to do what you tried to do.
however you were on the right track with Tsearch, but still not the way.
what you want, is the decryption key. that can be found using debugger. that is in case files really are encrypted, they might be just packed, instead of encryption.

in either case, im not a modder, but ive heard and seen things, so this is a job for Luigi's QuickBMS.

1. Here's the QuickBMS script for Order of War (next time post the fucking game title first, cuz pkg is used in other programs too and it says nothing. its the application that matters, not the .format).
http://aluigi.org/papers/bms/order_of_war.bms

2. QuickBMS > http://aluigi.org/papers.htm#quickbms

that should be all you need.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 19, 2010 7:20 pm

Thank you very much! This works fine, now I have the files I needed and can start modding.
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Maikon » Tue Sep 21, 2010 5:28 pm

Actually the extractor doesn't work as it should, today I got some time to look at them and all extracted files are unusable... first I thought it may be that dds files are protected but even the simple font ttf files are unusable... any other ideas? If not thanks anyway for the effort...
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Tue Sep 21, 2010 7:44 pm

you must ask Luigi about this problem, it might be that it does not extract them properly or maybe they really are encrypted too. i have never touched this game, so i cant tell. post the exact issue on his forum and see what he says.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Wed Sep 22, 2010 9:57 am

I was too hasty the extractor works just not on all pkg files... While data.pkg files extracted are unusable, models.pkg and units.pkg are extracted well. Probably data.pkg uses different script for unpacking then models and units.pkg. This is visible from .lua files of these files while in models they are clean and make sense in data.pkg they are all scrambled saying $#"&#&"% when extracted. I will contact Luigi on how to extract these data.pkg files and other stuff. Thanks again you helped me a lot!
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Wed Sep 22, 2010 11:40 am

there is one possibility you are not considering, some games do not have readable data at all. some games do use such data, that it only makes sense to game itself, that there's no data that any person can use or even read.
but see what Luigi says, might be different script as you said or encryption. would be nice if you post final solution here, after you contact Luigi. so thread would be complete, in case somebody else looking for this.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Thu Sep 23, 2010 12:09 pm

Hi, I have found out a few things since last visit. The most important that files quickbms extracted are neither compressed nor encrypted just packed some way conventional extractors don't recognize.. Only 2 files that are encrypted are data and game.pkgs, yet they aren't extracted properly and thus aluigi's xor key in bms script is useless (I informed his of this already). How do I know this: I used hex editor on extracted files and pkg and found extracted files hex-code to be the same as in pkg files. Then I copied same parts from pkgs to blank files and got functional files after renaming to right extension. Yet in data.pkg there is nothing similar to this in hex code.

Now to what I was trying to do... I made a custom flag for the game I want to insert into the game (DXT1 format, same size as original file). So I thought I can simply paste hex code of this modified file over the original hex code in pkg. Yet I couldn't paste directly files so big (pkg models has over 700mb) since program is reporting not enough memory to allocate. But there is a way around this. There is also a models_p1.pkg which is probably from a later update and contains newer version of some files from models and is very small. Then I tried to paste it to this smaller file in a way done in the larger one, yet when I do this nothing happens and pkg becomes unusable with quickbms extractor, it says "can't allocate negative bytes -124933495" or something like this. So I reckon that this models_p1 is now unusable by game too and it simply uses files from models... I tried to insert original flag.dds to same position and the same thing happens so I know problem is not with the new file but in a way I was trying to insert it. I am attaching you original flag dds and models_pkg in rar archive to this post, so please if u have the time try to look at them in hex and try to get it working in quickbms... then I bet it will work with the game engine too.
Attachments
WIP.rar
Look at these filez:
(1.17 MiB) Downloaded 185 times
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Thu Sep 23, 2010 1:13 pm

yes i saw your thread on Luigi's forum.
as i said before, im not a modder, however if you do not have enought RAM to edit 700mb files, theres' a way around this. you can use filesplitter >
TheFileSplitter.rar
(48.75 KiB) Downloaded 190 times

split the file into pieces, find the piece that holds the information you want to edit and edit it, then use filesplitter to put it back together again (it generates a .exe file that will do that for you).

if you are using HEX editor, then it should not corrupt the file. try using something lite, like XVI32
it can insert a string or replace it. its not 123 easy to use, but you'll find it out how to INSERT a string by increasing the file size, not overwriting existing bytes if its too small for your custom string or if your string is smaller than original, then it will reduce the file size.
hex workshop also works, but its massive.

i have 3gb ram, so i rarely have any problems with memory, that means i always edit files directly, but try this method.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Thu Sep 23, 2010 2:33 pm

Ha, ha! I don't know why I didn't thought of that, I have a splitter installed already, it so elegantly simple. Yes I'm using xvi32 btw. Thanks m8!

Here's somthng for ya:

Image
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Thu Sep 23, 2010 2:53 pm

i see it worked fine with splitting. nice work on the flag :)
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Fri Sep 24, 2010 6:14 pm

Sethioz can u take a look at these files: first is encoded txt files which I believe contains game dialogs for 1st mission (90% sure), and second contains actual text I rewrote from the game. Is it possible to find a way it is encrypted using these files?
Attachments
fajlz.zip
(4.57 KiB) Downloaded 166 times
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Fri Sep 24, 2010 7:19 pm

umm not like this, you need to find encyption key, which again is Luigi's field.
you should be able to find the key using olly, but i dont know details on how.
also it would require me to download the game, but im not interested in that game at all, ask Luigi and see if he knows anything about it.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 26, 2010 7:04 pm

Sethioz, aluigi corrected his script and now works fine. I see that your'e online so a quick question, I have the file opened in hex and I know a key with which I need to xor encrypt it, how do to this? Is there an option inside xvi32 to do encryption?
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Sun Sep 26, 2010 7:15 pm

uhm don't think that XVI32 can encrypt/decrypt files. there must be some special tool for this.
> his name is Luigi not aluigi (it comes from his name Luigi Auriemma)
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 26, 2010 7:36 pm

Sethioz wrote:uhm don't think that XVI32 can encrypt/decrypt files. there must be some special tool for this.
> his name is Luigi not aluigi (it comes from his name Luigi Auriemma)


yes it can, i got it but only partially, under xvi script go to editor --> insert command -> bitwise op -> bitxor....

now it works but only for key with lenght of one, it encodes all the places with this key, however it can't get it to works with longer stuff...

this is the scheme: BITOR <hex byte> [byte count]

if I only write first char of the code it encodes all the places in file with this char i.e. with 83. but how to get it to work with longer codes i don't understand... I have 50 char long code so this is a problem... it says something about syntax error, so I'll have to figure it out... i tried a few already but they didn't work, any ideas?

p.s. I know his name is Luigi, just this is his nick on his forum
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Re: Extracting game data (images, textures and models)

Postby Sethioz » Sun Sep 26, 2010 7:43 pm

i dont know much about encrypted and decrypting. google sounds like a good idea tho. try and see if there's any other hex editors that can do that, maybe it is limitation of XVI32 or just error in XVI32. after all its a small and fast tool, not meant to carry out big tasks.

as usual, you should update this thread once you get all working. and maybe if you feel like it, you could write article for my wiki. you have to PM me about this if you are interested.
User avatar
Sethioz
Admin
Admin
 
Posts: 4757
Joined: Fri Jul 27, 2007 5:11 pm
Location: unknown

Re: Extracting game data (images, textures and models)

Postby Maikon » Sun Sep 26, 2010 7:50 pm

phuck! argh! i've tried every possible combination... hex after bit, the hexes first then bits later, separated them by , . / and other stuff I can think of but it simply doesn't work. perhaps you are right and xvi32 really can do encryption with multiple number codes... i will surf the web and report when this is solved. no problem i'll write you a complete detailed guide on how to mod this game once i finish but I have a lot of stuff to do and figure out before that. c you later, thanks for trying
Maikon
Newbie..
Newbie..
 
Posts: 23
Joined: Sun Sep 19, 2010 7:57 am

Next

Return to Game - Modding / Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron