Fable: The Lost Chapters Mod Scene
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Fable TLC » Development » Advanced Modding » BigTools
Re: .big Reading [message #66242 is a reply to message #66235] Thu, 29 March 2012 06:48 Go to previous messageGo to previous message
xenn is currently offline  xenn
Messages: 17
Registered: February 2012
Location: Canada
morerunes wrote on Wed, 28 March 2012 23:10

Alright, I've written some code that seems to work, but I'm not convinced. The output is giving me a bank address of 401621575, which just seems too big to me. Am I missing something?

- edit -

I've fixed an error, and gotten a more reasonable bank address value: 6570567

My Code
[/align]


The number that :
Quote:

// Capture the bank address
buffer += 2;
long *bankAddress;
bankAddress = (long *) buffer;
buffer -= 2;

printf("Bank Address: %ld", *bankAddress);



is reading out, is the high word of "Char [4] ‘BIGB’" and the low word of "Char [4] Version", which is, for most of the .BIG files I've checked, the red segment in :

Quote:

BIGBd...

or 00644247 in hex,
or 6,570,567 in decimal.

I think by "buffer += 2;", you mean to add 2 dwords to the buffer address.
Instead, what the program does is only add two bytes to the buffer address.

You can resolve this by using "buffer += 2*4;", or, essentially the same thing, "buffer += 8;".

Fixed,
Quote:

// Capture the bank address
buffer += 2*4;
long *bankAddress;
bankAddress = (long *) buffer;
buffer -= 2*4;

printf("Bank Address: %ld", *bankAddress);



should read out the correct bank address (in decimal).

Of the original files, for example, these .BIG files should read out :

graphics.big -> 243,841,850
shaders.big -> 452,290
frontend.big -> 13,794,314
textures.big -> 533,633,006



http://i.imgur.com/vAT1z.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New lev Crap
Next Topic: Executable Functions
Goto Forum:
  


Current Time: Tue Jan 19 23:54:42 PST 2021

Total time taken to generate the page: 0.00972 seconds