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!

Reply
 
Thread Tools
  #1    
Old September 14th, 2010 (5:07 AM). Edited November 7th, 2010 by knizz.
knizz's Avatar
knizz knizz is offline
     
    Join Date: Aug 2007
    Posts: 192
    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.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
    VBA-M with lua scripting support
    Reply With Quote

    Relevant Advertising!

      #2    
    Old October 16th, 2010 (6:30 AM).
    knizz's Avatar
    knizz knizz is offline
       
      Join Date: Aug 2007
      Posts: 192
      Update: I'm pretty sure that 08002B9C is "malloc", that 08002BB0 is "malloc_and_clear", and that 08002A08 is "free".
      __________________
      Firered IDA 6.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
      VBA-M with lua scripting support
      Reply With Quote
        #3    
      Old October 23rd, 2010 (4:15 PM).
      Full Metal's Avatar
      Full Metal Full Metal is offline
      C(++) Developer.
      • Silver Tier
       
      Join Date: Jan 2008
      Location: In my mind.
      Age: 21
      Gender: Male
      Nature: Timid
      Posts: 806
      [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 knizz is offline
         
        Join Date: Aug 2007
        Posts: 192
        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.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
        VBA-M with lua scripting support
        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

        Forum Jump


        All times are GMT -8. The time now is 7:20 AM.