The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old November 28th, 2013, 01:52 PM
xGal's Avatar
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold

Advertise here
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!
__________________
Hey guys, I made a soundcloud account not long ago, and I would be very happy if you guys will check it out: https://soundcloud.com/dewombat. Thanks .

Also, if you ever wanted to make a ROM hacking tool, click here: http://www.pokecommunity.com/showthread.php?t=334348
Reply With Quote
  #2    
Old November 30th, 2013, 11:16 PM
Flower's Avatar
Flower
ワイルドフラワー
 
Join Date: Nov 2013
Location: Void
Gender: Male
Nature: Quiet
Send a message via Skype™ to Flower
Yay, thanks!
I think this is very useful to people like me.
__________________
PM | Flower | VM
Reply With Quote
  #3    
Old December 3rd, 2013, 12:47 PM
Velocity's Avatar
Velocity
 
Join Date: Nov 2013
Location: Virginia (America)
Gender: Male
Nature: Naughty
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, 02:11 AM
xGal's Avatar
xGal
du bist n00b
 
Join Date: Nov 2011
Location: A tree
Gender: Male
Nature: Bold
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.
__________________
Hey guys, I made a soundcloud account not long ago, and I would be very happy if you guys will check it out: https://soundcloud.com/dewombat. Thanks .

Also, if you ever wanted to make a ROM hacking tool, click here: http://www.pokecommunity.com/showthread.php?t=334348
Reply With Quote
  #5    
Old December 4th, 2013, 04:01 AM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
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, 08:59 AM
IndianCharizard#'s Avatar
IndianCharizard#
aka Brendon McCullum
 
Join Date: Sep 2013
Location: Delhi ,India
Age: 19
Gender: Male
Nature: Brave
Send a message via Skype™ to IndianCharizard#
Hex in any tutorials has always been complicated for me but it surely is easy, thanx for this tutorial.
__________________
My PC Family
| Pokelovers Server | Johto League Showdown Hack Thread |My Team ThreadPaired With - Ansirent Rytham
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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 09:57 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.