xboxscene.org forums

Author Topic: Xbe Title Location In Xbes  (Read 41 times)

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« on: December 22, 2004, 04:10:00 PM »

i've looked at the document on xbox-linux project site about the layout of an xbe file, but i'm not really getting it.  i'm trying to read in the xbetitle and store it in a string.  i'm really close, but it seems like the byte-location where the title begins is different with every xbe.  with some xbes i get some trash at the beginning on others i don't.  can someone help me understand how to determine the location of the titles embedded in xbes?  thanks!
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Xbe Title Location In Xbes
« Reply #1 on: December 22, 2004, 05:10:00 PM »

ImageHeaderSize is an unint32 at 0x0110
TitleName is an WCHAR[40] at (ImageHeaderSize + 0x000C)

See also CUtil::GetXBEDescription.
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« Reply #2 on: December 22, 2004, 05:36:00 PM »

smile.gif

unint32 = unsigned integer.  but how big is the integer? 32 bits?  32 bytes?

wchar[40] = no idea.  how big is that in bytes?

check my calculation on this:
0x0110 would be 272 bytes from the beginning of the file?

thanks again.  i'll check out that link now.  funny, that the link goes to xbmc and python...that's what i'm trying to do this in smile.gif  er.. unsure.gif actually, i'm a little paranoid now...must check PC for trojans smile.gif
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Xbe Title Location In Xbes
« Reply #3 on: December 22, 2004, 07:19:00 PM »

smile.gif
wchar = a data type for Unicode characters, 2 byte per char, total length of TitleName is always 40 characters
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« Reply #4 on: December 23, 2004, 08:17:00 AM »

thanks for clearing that up for me!
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« Reply #5 on: December 23, 2004, 10:03:00 PM »

sad.gif
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Xbe Title Location In Xbes
« Reply #6 on: December 24, 2004, 04:30:00 AM »

smile.gif

The integer value is in little-endian format, which basically means they reversed it.

Thus 0x84010000 little endian == 0x00000184 big endian == 388 decimal

So you XBE title should be starting at byte 400.

Anecdote:
QUOTE
The terms big-endian and little-endian are derived from the Lilliputians of Gulliver's Travels, whose major political issue was whether soft-boiled eggs should be opened on the big side or the little side. Likewise, the big-/little-endian computer debate has much more to do with political issues than technological merits.


HTH
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« Reply #7 on: December 24, 2004, 08:16:00 AM »

ah...thank you.  i had actually thought of big endian/little endian, but it has been SOOO long since i studied this stuff in school and actually used it.  i had tried converting 1048 to decimal.  i forgot that each byte is reversed.  thank you very much!
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Xbe Title Location In Xbes
« Reply #8 on: December 24, 2004, 09:10:00 AM »

um, nevermind that last post *embarrased*
except for the 'thank you' part!
Logged