PDA

View Full Version : UE1 - UT UT Package signature


Zur
19th Mar 2009, 11:38 PM
I'm trying to create a utility in Java to read the information contained in a package file.

However, the information on the link below doesn't seem to correspond. For example, the signature at the start should be "0x9E2A83C1" but it's not.

Am I doing things wrong or was the format changed after this was written ?

http://wiki.beyondunreal.com/Legacy:Package_File_Format

Wormbo
20th Mar 2009, 03:34 AM
Open packages with a hex editor to see the real thing. Keep in mind that Java, unlike most other programming languages, uses big-endian byte order by default. The Unreal package file format is defined to use little-endian, though.

Zur
20th Mar 2009, 04:06 PM
Keep in mind that Java, unlike most other programming languages, uses big-endian byte order by default.

Good remark. I'll see if it's possible to convert from little-endian to big-endian.

Wormbo
20th Mar 2009, 05:03 PM
Either use "Integer.reverseBytes(in.readInt())" or simply read the value byte-wise and use bit-shifting and bitwise OR to combine them in little endian order.