Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old November 28th, 2013 (1:52 PM).
xGal xGal is offline
Mhm
     
    Join Date: Nov 2011
    Location: A tree
    Gender: Other
    Nature: Relaxed
    Posts: 243
    Even though it's quite simple, I still find lots of people that don't know how to do that, so that's why I decided to make that tutorial!

    What you need:
    Spoiler:
    - A hex editor (I use HxD)
    - A THUMB compiler (I use HackMew's)
    - Notepad
    - A ROM (For this tutorial, I use FireRed)

    PART 1 - GETTING THE .BIN FILE


    Spoiler:
    Okay, for this one let's take Jambo51's battle mugshots extention.
    (Link: http://www.pokecommunity.com/showthread.php?t=240183)

    Okay, first routine:

    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global mugshothackone
    main:
     ldrb r5, [r4, #0x3]
     lsl r5, r5, #0x18
     lsr r5, r5, #0x18
     cmp r5, #0x0
     beq normalchecks
     mov r1, #0x5A
     ldr r5, returnone
     bx r5
    normalchecks: cmp r1, #0x57
     bne later
     add r1, r2, #0x0
     mov r0, #0xCD
     ldr r5, returntwo
     bx r5
    later: ldr r5, returnone
     bx r5
    .align
    returntwo: .word 0x0807FFA5
    returnone: .word 0x08080009
    Copy that and paste into notepad. Once you've done copying the code, click Save As. Down, where it says ".txt file", click and change it to "All Files", and call the file [randomname].asm. Remember to save it on the folder where you put the THUMB compiler.

    Now, simply drag the .asm file you created into the file "thumb". Now, there should be a new .bin file. That's the file we want!


    PART 2 - INSERTING IT INTO THE ROM AND REPOINTING BYTES

    Spoiler:
    Okay, inserting the code into the ROM is so easy. Open the newly created .BIN file in your hex editor. You should see this code:
    Code:
    E5 78 2D 06 2D 0E 00 2D 02 D0 5A 21 05 4D 28 47 57 29 03 D1 11 1C CD 20 01 4D 28 47 01 4D 28 47 A5 FF 07 08 09 00 08 08
    Now, also open your ROM with the hex editor. Seek for a free space. I always look for a free space that ends with "0" (for example: 0x800000, 0x960000, 0x862180 etc.).

    Once you found the free space, press CTRL+B (NEVER CTRL+V). Write down the offset where the ASM code start at. Add 1 to it, and reverse it. If what I said right now was too complicated, well, let me explain it:
    If you picked up the offset 0x800000, add 1 to it. 800000 + 1 = 800001. To make it look more simple, after every byte (Byte = XX), press space, so it will now like that: 80 00 01. Now, switch the first byte with the last byte, so it will result: 01 00 80. Easy, isn't it?

    Quote:
    Originally Posted by Jambo51
    Musghot Hack One:
    Insert at 0x0807FF90:
    004A1047XXXXXX08
    Press CTRL+G, or Go to the written offset. the written offset is 0807FF90, but wait... This offset doesn't even exist in the ROM! Just remove the 080, it's not necessary for navigating to specific offsets. Now, go to 7FF90, and change the bytes there to
    Code:
    00 4A 10 47 XX XX XX 08
    Instead of the XX XX XX, put the offset we reversed earlier, so it will be
    Code:
    00 4A 10 47 01 00 80 08
    Good job! Now, there are three routines, so do what I did with the first routine, but do it with the other routines.

    Now, once you've done all the 3 routines,
    Quote:
    Originally Posted by Jambo51
    Finally, change the byte at 0x080801F5 to 0x78
    Just navigate to 080801F5 and change the byte there to 78.

    PART 3 - CREATING THE TABLE

    Spoiler:
    Navigate to another free space in your ROM, and now take a look:
    Quote:
    Originally Posted by Jambo51
    0x3FA660 (Agatha)
    0x3FA680 (Bruno)
    0x3FA6A0 (Lorelei)
    0x3FA6C0 (Lance)
    0x3FA6E0 (Gary Champion)
    0x3FA700 (Male Player BG)
    0x3FA720 (Female Player BG)
    All of these offsets are for the pallets that the mugshot uses, so just write pointers to them. Here, I already made it:
    Code:
    60 A6 3F 08 80 A3 3F 08 A0 A6 3F 08 C0 A6 3F 08 E0 A6 3F 08 00 A7 3F 08 20 A7 3F 08
    Now, in order to make it appear ingame, before battle, write a normal trainer battle script:

    Code:
    trainerbattle 0xA 0xB 0xC @Message1 @Message2 @Message3
    (Message3 used if you want something to happen right after the battle).

    Replace A with the battle type, replace B with the trainer number and replace C with the pallet you want. Agatha is the first, so it will be 100. Bruno is the second, so it will be 200 and Female Player BG is the last, so it will be 700. Simple, huh?

    Now, let's test ingame... And it worked! If it doesn't you probably did something wrong :O

    Thanks for reading, I hope this actually helps!


    Credits:
    Me - Writing this tutorial!
    Jambo51 - The routines & teaching me how to insert an ASM routine!
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old November 30th, 2013 (11:16 PM).
    Sniper's Avatar
    Sniper Sniper is offline
    ふゆかい
       
      Join Date: Nov 2013
      Location: Philippines
      Gender: Male
      Nature: Quiet
      Posts: 1,453
      Yay, thanks!
      I think this is very useful to people like me.
      __________________


      Reply With Quote
        #3    
      Old December 3rd, 2013 (12:47 PM).
      Velocity's Avatar
      Velocity Velocity is offline
         
        Join Date: Nov 2013
        Location: Virginia (America)
        Gender: Male
        Nature: Naughty
        Posts: 14
        this is probably an incredibly stupid question but what does ASM stand for and what does it do haha.. im sorry im just trying to get a little bit of knowledge for all aspects of hacking
        Reply With Quote
          #4    
        Old December 4th, 2013 (2:11 AM).
        xGal xGal is offline
        Mhm
           
          Join Date: Nov 2011
          Location: A tree
          Gender: Other
          Nature: Relaxed
          Posts: 243
          Quote:
          Originally Posted by Velocity View Post
          this is probably an incredibly stupid question but what does ASM stand for and what does it do haha.. im sorry im just trying to get a little bit of knowledge for all aspects of hacking
          You use ASM to insert something that doesn't exist in the ROM, if I am not wrong (I am not that good when it comes to making an ASM code) and/or extending some sort of table.
          __________________
          Reply With Quote
            #5    
          Old December 4th, 2013 (4:01 AM).
          karatekid552's Avatar
          karatekid552 karatekid552 is offline
          What happens if I push it?....
             
            Join Date: Nov 2012
            Location: Do you really want to know? Really?
            Gender: Male
            Nature: Bold
            Posts: 1,766
            Quote:
            Originally Posted by Velocity View Post
            this is probably an incredibly stupid question but what does ASM stand for and what does it do haha.. im sorry im just trying to get a little bit of knowledge for all aspects of hacking
            http://www.pokecommunity.com/showthread.php?t=299696

            This will greatly advance your knowledge.
            __________________

            Paired with Simba
            Reply With Quote
              #6    
            Old January 30th, 2014 (8:59 AM).
            Astraea's Avatar
            Astraea Astraea is offline
            The Storm of Friendship
               
              Join Date: Sep 2013
              Location: Otago, New Zealand
              Age: 20
              Gender: Male
              Nature: Brave
              Posts: 2,115
              Hex in any tutorials has always been complicated for me but it surely is easy, thanx for this tutorial.
              __________________
              Reply With Quote
              Reply

              Quick Reply

              Join the conversation!

              Create an account to post a reply in this thread, participate in other discussions, and more!

              Create a PokéCommunity Account

              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 10:52 AM.