The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.

Reply
 
Thread Tools
  #1    
Old September 14th, 2010, 05:07 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Game Freak removed all debug-strings from the final game except those for malloc/free. I found out that allocated blocks have this format:

0x00 / Halfword / Flag / 01 00 = used, 00 00 = unused
0x02 / Halfword / Magic-number / Always A3 A3
0x04 / Word / Idk but not a pointer, probably the size of the data
0x08 / Word / Pointer to the previous block
0x0C / Word / Pointer to the next block
0x10 / Depends / Data
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)

Last edited by knizz; November 7th, 2010 at 07:21 PM.
Reply With Quote
  #2    
Old October 16th, 2010, 06:30 AM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Update: I'm pretty sure that 08002B9C is "malloc", that 08002BB0 is "malloc_and_clear", and that 08002A08 is "free".
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
  #3    
Old October 23rd, 2010, 04:15 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
[jq]"malloc_and_clear"[/jq]
so, this would be...
free(ptr);
ptr = malloc(nSize);
??
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #4    
Old October 23rd, 2010, 10:51 PM
knizz's Avatar
knizz
 
Join Date: Aug 2007
Quote:
Originally Posted by Full Metal View Post
[jq]"malloc_and_clear"[/jq]
so, this would be...
free(ptr);
ptr = malloc(nSize);
??
No. Its more like
ptr=ptr2=malloc(size);
while(size--)*ptr2++=0;
return ptr;
__________________
Firered IDA 6.1 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support (no longer in development)
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 05:28 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.