News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 19th Mar 2009, 11:38 PM   #1
Zur
surrealistic mad cow
 
Zur's Avatar
 
Join Date: Jul. 8th, 2002
Posts: 11,682
UT Package signature

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
__________________


Last edited by Zur; 20th Mar 2009 at 09:50 AM.
Zur is offline   Reply With Quote
Old 20th Mar 2009, 03:34 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 20th Mar 2009, 04:06 PM   #3
Zur
surrealistic mad cow
 
Zur's Avatar
 
Join Date: Jul. 8th, 2002
Posts: 11,682
Quote:
Originally Posted by Wormbo View Post
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.
__________________

Zur is offline   Reply With Quote
Old 20th Mar 2009, 05:03 PM   #4
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer