Gildor's Forums

Author Topic: Trying to modify a XXX package...  (Read 21866 times)
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: Trying to modify a XXX package...
« Reply #15 on: June 08, 2014, 01:32 »

You can't append entries without overwriting package contents, or without shifting content to a few bytes - but in this case you'll need to fix up all file offsets in package (which could be found not only in package tables, but in object data too).
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #16 on: June 08, 2014, 01:50 »

Gildor:

Let me explain the entire process that i'm going through and maybe that might help (or you might still tell me that i'm going in the wrong direction).

1) I'm taking CHAR_SubZero_C.xxx from the game's asset folder and decompressing it using your decompress.exe
2) Taking that new Decompressed File that i've renamed and rehashed to CHAR_SubZero_D.xxx using a renamer tool (this allows modders for MK9 to have multiple costumes with different names).  I could simply do the same thing by finding the hex values within an hex editor to change the name as well.  This works nicely
3) Then i go to the extracted folder contents and i physically replace all of those packages with similar packages that the game uses already from other characters.  For example:  With the character Noob from MK9 he has the CHAR_RetroNinja_Male_MK2.Package that is native to the game, so i'm simply replacing the one within SubZero's (CHAR_RetroNinja_Male_MK1.Package) along with any other files that go along with the MK2 version.  So, i shouldn't have to edit any of the bytes within each of these packages (at least i don't think so).
4) I'm using Scorpion2k7's old xxx-repacker that i've dissambled and changed to handle little Endian format.  By doing so, i'm able to extract and repackage and play just fine as long as i don't change anything within the header file (until i figure it out lol).
5) the xxx-repacker reads the original header from the CHAR_SubZero_D.xxx and uses those header values.  Then it draws in the contents that are within the extracted folders to produce a new .xxx file (CHAR_SubZero_D_new.xxx).  The problem that i'm facing is that it reuses the original header that doesn't reflect that new packages that i've already swapped.

Does that make more sense now?  So, in theory; if i can get my header file correct the rest should package just fine.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #17 on: June 08, 2014, 01:51 »

So, in the character Noob's NameTable you will see C_Tie entries already and they go along with his MK2 package.  So, the theory is if i can just add those name entries everything else should be fine.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #18 on: June 08, 2014, 01:58 »

... it just dawned on me that i can pull up CHAR_Noob_D.xxx decompressed version in HexEditor and just copy over those values lol.  I'll try that and post up my results.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #19 on: June 08, 2014, 02:42 »

Gildor:

Ok, so i think i've got the NameTable clean.  Here's the next challenge.  I might be off with namecount or something.  Attached is the next error that i'm receiving.  It seems that the extractor believes i'm looking at what is suppose to be part of the ImportTable structure; but at that location within the HexEditor it still is parsing part of the NameTable end names.

Thoughts?

[вложение удалено Администратором]
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #20 on: June 08, 2014, 08:13 »

Update

My offsets needed to be recalculated. Now im at the exporttable section. I do have some issues there that im going to trouble shoot more tomorrow. Essentially the way that the program was rebuilding the exporttable section of the header isnt quite accurate. This section will be much more challenging i fear as with the others i was able to guide myself with word value names within the hex editor ... Now its down to the random characters lol

Hopefully ill figure it out tomorrow after some sleep
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #21 on: June 10, 2014, 03:51 »

Gildor:

I'm further along.  I now longer get any parsing errors when trying to extract the newly created .xxx file.  In fact, it starts to unpackage everything.  But, the challenge that i face is down below.

1) it's not fully extracting everything; but yet i had no problems reading the original files that was used to determine the bytes hydrated into the new .xxx file .  Below is an example of one of the lines within CMD.

"5701/5727: unable to create file ./CHAR_SubZero_D_template_full_new/FX_BloodImpact/TEdgePreservingFilterPixelShader<18>/FX_Ghost_Whisp_mic.ActorFactorySkeletalMesh_-452984833

what's intersting is all "unable to create" file lines have -452984833 at the end.

2) The files/folders that it does extract are somewhat accurate; but then it seems that it has taken lines from my nametable and turned them into folders ... such as my new "C_Tie_00" line and a few others (which is not correct).

So, i believe i'm off with something; but not quite sure what that is yet.  two things that I'm wondering about.

   a.  Perhaps my new header-length isn't correct with the addition of the new lines within the nametable?
   b.  Or, perhaps theres more to the header that i need to add?  For example, see the screen shot below.  Gildor you've done an amazing job explaining to many of us about were to find the nametable count, offsets, and various other things; but what about this space highlighted below?  I'm not quite sure what it is.  The highlight actually goes all the way down to beginning of the nametable's section.

Thanks again,

[вложение удалено Администратором]
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: Trying to modify a XXX package...
« Reply #22 on: June 10, 2014, 11:55 »

"5701/5727: unable to create file ./CHAR_SubZero_D_template_full_new/FX_BloodImpact/TEdgePreservingFilterPixelShader<18>/FX_Ghost_Whisp_mic.ActorFactorySkeletalMesh_-452984833
It looks like your object's class name is corrupted. FName has the following structure:
int32 index1;
int32 index2;

Index1 points to string from name table. Usually index2 is zero, so name is just "SomeName". But when index2 is not zero, name is "SomeName_<index-1>", so, for index2=0 it is "SomeName", for index2=1 it is "SomeName_0", for index2=100 it is "SomeName_99" etc.

Quote
... but what about this space highlighted below?  I'm not quite sure what it is.  The highlight actually goes all the way down to beginning of the nametable's section.
I don't know. I think that's a part of MK's header, which doesn't exist in original Unreal engine. Umodel doesn't read that, it's not needed for work.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #23 on: June 10, 2014, 17:52 »

Gildor:

Thanks for the reply, that makes sense. These indexes still within the header within the nametable section im guessing correct?

Also, does the extractor read/us the .objectreferencer file within the package. If so, is that something else i need to adjust and whats the structure of that file?

Thanks again,
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: Trying to modify a XXX package...
« Reply #24 on: June 10, 2014, 20:24 »

These indexes still within the header within the nametable section im guessing correct?
This table looks like array of some structure, consisting of FName + FGuid (there's 16 byte random values between strings).
Quote
Also, does the extractor read/us the .objectreferencer file within the package. If so, is that something else i need to adjust and whats the structure of that file?
I never worked with ObjectReferencer. From UE3 scripts:
Code:
/** Handles to object references; used by the engine to e.g. the prevent objects from being garbage collected. */
var const array<ObjectReferencer> ObjectReferencers;
And the ObjectReferencer itself:
Code:
class ObjectReferencer extends Object
native;

/** Array of objects being referenced. */
var() array<object> ReferencedObjects;

So, there's nothing interesting there.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #25 on: June 11, 2014, 05:36 »

...
It looks like your object's class name is corrupted. FName has the following structure:
int32 index1;
int32 index2;

Index1 points to string from name table. Usually index2 is zero, so name is just "SomeName". But when index2 is not zero, name is "SomeName_<index-1>", so, for index2=0 it is "SomeName", for index2=1 it is "SomeName_0", for index2=100 it is "SomeName_99" etc.

So, i've been reviewing this now that i'm back home from work.  How is this even possible.  Attached below is another screenshot of the beginning section of the nametable.  I've selected the section for the name "A".  Now, if i tamper with any of the leading or ending bytes before "A" the extractor tool doesn't even try to extract.  So, how can I have that index2 not even present and the extractor tool gets this far?  Or, am i looking at the wrong section when you are refering to index1&2?

Thanks again for all your help,

[вложение удалено Администратором]
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: Trying to modify a XXX package...
« Reply #26 on: June 11, 2014, 14:14 »

Name table contains just names and some flags. But name referenced from object serialized as 2 ints.
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #27 on: June 11, 2014, 20:38 »

Name table contains just names and some flags. But name referenced from object serialized as 2 ints.

Ok, that makes sense; but were in the .xxx package can i find the start of these?  What would be my offset that i go to to find them?

Thanks again,
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7957



View Profile WWW
Re: Trying to modify a XXX package...
« Reply #28 on: June 11, 2014, 20:40 »

To find what?
Logged
Maddmatt
Newbie
*
Posts: 21


View Profile
Re: Trying to modify a XXX package...
« Reply #29 on: June 11, 2014, 21:25 »

It looks like your object's class name is corrupted. FName has the following structure:
int32 index1;
int32 index2;

To find these that you referenced earlier. If they are not part of the nametable section of the header; where can i find these to make sure i have them correct. Does that make more sense?
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS