Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitch
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Search Wiki

 

Search Forums

 

Author Topic: Hacking tutorial  (Read 12557 times)

0 Members and 1 Guest are viewing this topic.

WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Hacking tutorial
« on: February 27, 2008, 03:31:21 pm »
I'm new to hacking (never done it).

What is a good way to get started? i.e. tools, games, ect...

Thanks
« Last Edit: March 20, 2012, 11:50:16 pm by IIMarckus »

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #1 on: February 28, 2008, 12:30:34 am »
For starters, you need a ROM. If you're starting out, I heartily recommend Pokemon Gold, as it has nice clean programming (unlike Red, Blue, and Yellow), and has a fair amount of tools for it (unlike Crystal). If you want to do GBA games, you certainly can, but the ROMs are much more complex and they also fall under the "too many tools" syndrome -- some things are best done with a hex editor.


So, a hex editor should be your next requirement. Translhextion is a solid choice; it has its bad points, but you shouldn't have any major problems with it.

And, of course, an emulator. VisualBoyAdvance should be fine for our purposes.



Open Pokemon Gold in your hex editor. On the leftmost side, you'll see a list of numbers going "00000000, 00000010, 00000020," and so on. This is the offset, or file position. When somebody says "Such-and-such data is located at offset 18AC42," this means to scroll to that offset. (You can also get to a specific offset by hitting Ctrl+G and typing in "x18AC42" or whatever the offset is.)

In the middle you'll see rows of two-digit hexadecimal numbers. These are the bytes that make up our file. When we edit these, it'll change what happens in the game. Each byte has a value that can go from 00 to FF (the hexadecimal equivalent of 0 to 255).

On the right is the ASCII representation of each byte. ASCII is a method of storing text where one byte equals one letter -- 41 is 'A', 42 is 'B', 43 is 'C', and so on.


Now, let's start with something simple: editing text. This would be easy if Pokemon games used the ASCII standard to store their text -- but they don't! Instead of the above, Pokemon Gold makes 80 'A', 81 'B', and so on. So what to do?

ROM hackers came up with the solution to this some time ago. It's called "Thingy tables." A Thingy table is a text file that tells the hex editor what byte represents what letter. To make the Thingy table for Gold, open Windows Notepad and copy the following text into a new file:
Code: [Select]
7F=
80=A
81=B
82=C
83=D
84=E
85=F
86=G
87=H
88=I
89=J
8A=K
8B=L
8C=M
8D=N
8E=O
8F=P
90=Q
91=R
92=S
93=T
94=U
95=V
96=W
97=X
98=Y
99=Z
A0=a
A1=b
A2=c
A3=d
A4=e
A5=f
A6=g
A7=h
A8=i
A9=j
AA=k
AB=l
AC=m
AD=n
AE=o
AF=p
B0=q
B1=r
B2=s
B3=t
B4=u
B5=v
B6=w
B7=x
B8=y
B9=z
F6=0
F7=1
F8=2
F9=3
FA=4
FB=5
FC=6
FD=7
FE=8
FF=9
Then save it as "gold.tbl". Be sure to include the quotation marks when you save!


I've purposely left this table incomplete. When you're hacking and you find out that another byte represents a character, add it to your table!


Now, you should have your table file, gold.tbl. To use it in Translhextion, go to Script > Open Thingy Table, open the table, and then click the box that says "Thingy View Active."

Not everything in this ROM is text, of course. To find some, go to offset 195624. This is Oak's speech at the beginning of the game. Don't change the 00; this is a special control code that means "Print text until you reach a 57." Starting with the next byte, replace with this:

93 A7 A8 B2 7F A8 B2 7F A0 7F A7 A0 A2 AA E7 4F 93 A4 B2 B3 A8 AD A6 E8 E8 E8 57

"This is a hack! Testing..."

Save your ROM, and try it out!


That's how you edit text. Experiment, and you'll be able to do more on your own!


The next thing most people want to do is rearrange the maps. There are multiple tools to do this; I recommend MegaMap. (You may need some extra files to get MegaMap to ron, such as zerolib.dll or MSCOMCT2.OCX.) It has some quirks: mainly that it's only partially translated (from German). However, it's a great editor, and IMO better than Goldmap.

WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: help please?
« Reply #2 on: February 28, 2008, 06:35:51 pm »
Thanks for the help!


I can't find 195624 though
« Last Edit: February 28, 2008, 06:54:55 pm by WithLightsOut »

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #3 on: February 28, 2008, 08:50:34 pm »
On the leftmost side, you'll see a list of numbers going "00000000, 00000010, 00000020," and so on. This is the offset, or file position. When somebody says "Such-and-such data is located at offset 18AC42," this means to scroll to that offset. (You can also get to a specific offset by hitting Ctrl+G and typing in "x18AC42" or whatever the offset is.)
So hit Ctrl+G and type "x195624". 195624 will be the fifth byte on the row marked "195620".

WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: help please?
« Reply #4 on: February 29, 2008, 04:06:07 pm »
I did what you said but when it got to where Professor Oak talks, it just started the game over. What did i do wrong? :???:

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #5 on: February 29, 2008, 05:29:25 pm »
Sounds like you overwrote the 00 that starts the text. Don't do that; only replace the bytes after it.

WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: help please?
« Reply #6 on: February 29, 2008, 09:12:02 pm »
Yep that was it but now another problem (I think) XD

When I copied in the line you said "
93 A7 A8 B2 7F A8 B2 7F A0 7F A7 A0 A2 AA E7 4F 93 A4 B2 B3 A8 AD A6 E8 E8 E8 57" he said colors and letters lol

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #7 on: February 29, 2008, 09:34:11 pm »
I don't get that result when I try. Could you post a screenshot of what you're getting?
« Last Edit: February 29, 2008, 09:34:57 pm by IIMarckus »

Sherkel

  • Reasonably.
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Reasonably.
    • View Profile
Re: help please?
« Reply #8 on: March 01, 2008, 05:49:13 am »
For starters, you need a ROM. If you're starting out, I heartily recommend Pokemon Gold, as it has nice clean programming (unlike Red, Blue, and Yellow), and has a fair amount of tools for it (unlike Crystal). If you want to do GBA games, you certainly can, but the ROMs are much more complex and they also fall under the "too many tools" syndrome -- some things are best done with a hex editor.


So, a hex editor should be your next requirement. Translhextion is a solid choice; it has its bad points, but you shouldn't have any major problems with it.

And, of course, an emulator. VisualBoyAdvance should be fine for our purposes.



Open Pokemon Gold in your hex editor. On the leftmost side, you'll see a list of numbers going "00000000, 00000010, 00000020," and so on. This is the offset, or file position. When somebody says "Such-and-such data is located at offset 18AC42," this means to scroll to that offset. (You can also get to a specific offset by hitting Ctrl+G and typing in "x18AC42" or whatever the offset is.)

In the middle you'll see rows of two-digit hexadecimal numbers. These are the bytes that make up our file. When we edit these, it'll change what happens in the game. Each byte has a value that can go from 00 to FF (the hexadecimal equivalent of 0 to 255).

On the right is the ASCII representation of each byte. ASCII is a method of storing text where one byte equals one letter -- 41 is 'A', 42 is 'B', 43 is 'C', and so on.


Now, let's start with something simple: editing text. This would be easy if Pokemon games used the ASCII standard to store their text -- but they don't! Instead of the above, Pokemon Gold makes 80 'A', 81 'B', and so on. So what to do?

ROM hackers came up with the solution to this some time ago. It's called "Thingy tables." A Thingy table is a text file that tells the hex editor what byte represents what letter. To make the Thingy table for Gold, open Windows Notepad and copy the following text into a new file:
Code: [Select]
7F=
80=A
81=B
82=C
83=D
84=E
85=F
86=G
87=H
88=I
89=J
8A=K
8B=L
8C=M
8D=N
8E=O
8F=P
90=Q
91=R
92=S
93=T
94=U
95=V
96=W
97=X
98=Y
99=Z
A0=a
A1=b
A2=c
A3=d
A4=e
A5=f
A6=g
A7=h
A8=i
A9=j
AA=k
AB=l
AC=m
AD=n
AE=o
AF=p
B0=q
B1=r
B2=s
B3=t
B4=u
B5=v
B6=w
B7=x
B8=y
B9=z
F6=0
F7=1
F8=2
F9=3
FA=4
FB=5
FC=6
FD=7
FE=8
FF=9
Then save it as "gold.tbl". Be sure to include the quotation marks when you save!


I've purposely left this table incomplete. When you're hacking and you find out that another byte represents a character, add it to your table!


Now, you should have your table file, gold.tbl. To use it in Translhextion, go to Script > Open Thingy Table, open the table, and then click the box that says "Thingy View Active."

Not everything in this ROM is text, of course. To find some, go to offset 195624. This is Oak's speech at the beginning of the game. Don't change the 00; this is a special control code that means "Print text until you reach a 57." Starting with the next byte, replace with this:

93 A7 A8 B2 7F A8 B2 7F A0 7F A7 A0 A2 AA E7 4F 93 A4 B2 B3 A8 AD A6 E8 E8 E8 57

"This is a hack! Testing..."

Save your ROM, and try it out!


That's how you edit text. Experiment, and you'll be able to do more on your own!


The next thing most people want to do is rearrange the maps. There are multiple tools to do this; I recommend MegaMap. (You may need some extra files to get MegaMap to ron, such as zerolib.dll or MSCOMCT2.OCX.) It has some quirks: mainly that it's only partially translated (from German). However, it's a great editor, and IMO better than Goldmap.
Hmm...wow! Nice! I think I may want to use this too!

WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: help please?
« Reply #9 on: March 02, 2008, 08:22:52 pm »

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #10 on: March 02, 2008, 11:02:11 pm »
You need to type the bytes in the left (middle) column. You can switch between columns by pressing Tab.



WithLightsOut

  • GCLF Member
  • Offline Offline
  • Gender: Male
    • View Profile
Re: help please?
« Reply #11 on: March 03, 2008, 06:11:03 pm »
Now I got it!

Thanks  ;D

Brocco Guy

  • Βροκκω Γαι
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • d(^.^)b
    • View Profile
Re: help please?
« Reply #12 on: April 06, 2008, 07:29:22 pm »
For starters, you need a ROM. If you're starting out, I heartily recommend Pokemon Gold, as it has nice clean programming (unlike Red, Blue, and Yellow), and has a fair amount of tools for it (unlike Crystal). If you want to do GBA games, you certainly can, but the ROMs are much more complex and they also fall under the "too many tools" syndrome -- some things are best done with a hex editor.


So, a hex editor should be your next requirement. Translhextion is a solid choice; it has its bad points, but you shouldn't have any major problems with it.

And, of course, an emulator. VisualBoyAdvance should be fine for our purposes.



Open Pokemon Gold in your hex editor. On the leftmost side, you'll see a list of numbers going "00000000, 00000010, 00000020," and so on. This is the offset, or file position. When somebody says "Such-and-such data is located at offset 18AC42," this means to scroll to that offset. (You can also get to a specific offset by hitting Ctrl+G and typing in "x18AC42" or whatever the offset is.)

In the middle you'll see rows of two-digit hexadecimal numbers. These are the bytes that make up our file. When we edit these, it'll change what happens in the game. Each byte has a value that can go from 00 to FF (the hexadecimal equivalent of 0 to 255).

On the right is the ASCII representation of each byte. ASCII is a method of storing text where one byte equals one letter -- 41 is 'A', 42 is 'B', 43 is 'C', and so on.


Now, let's start with something simple: editing text. This would be easy if Pokemon games used the ASCII standard to store their text -- but they don't! Instead of the above, Pokemon Gold makes 80 'A', 81 'B', and so on. So what to do?

ROM hackers came up with the solution to this some time ago. It's called "Thingy tables." A Thingy table is a text file that tells the hex editor what byte represents what letter. To make the Thingy table for Gold, open Windows Notepad and copy the following text into a new file:
Code: [Select]
7F=
80=A
81=B
82=C
83=D
84=E
85=F
86=G
87=H
88=I
89=J
8A=K
8B=L
8C=M
8D=N
8E=O
8F=P
90=Q
91=R
92=S
93=T
94=U
95=V
96=W
97=X
98=Y
99=Z
A0=a
A1=b
A2=c
A3=d
A4=e
A5=f
A6=g
A7=h
A8=i
A9=j
AA=k
AB=l
AC=m
AD=n
AE=o
AF=p
B0=q
B1=r
B2=s
B3=t
B4=u
B5=v
B6=w
B7=x
B8=y
B9=z
F6=0
F7=1
F8=2
F9=3
FA=4
FB=5
FC=6
FD=7
FE=8
FF=9
Then save it as "gold.tbl". Be sure to include the quotation marks when you save!


I've purposely left this table incomplete. When you're hacking and you find out that another byte represents a character, add it to your table!


Now, you should have your table file, gold.tbl. To use it in Translhextion, go to Script > Open Thingy Table, open the table, and then click the box that says "Thingy View Active."

Not everything in this ROM is text, of course. To find some, go to offset 195624. This is Oak's speech at the beginning of the game. Don't change the 00; this is a special control code that means "Print text until you reach a 57." Starting with the next byte, replace with this:

93 A7 A8 B2 7F A8 B2 7F A0 7F A7 A0 A2 AA E7 4F 93 A4 B2 B3 A8 AD A6 E8 E8 E8 57

"This is a hack! Testing..."

Save your ROM, and try it out!


That's how you edit text. Experiment, and you'll be able to do more on your own!


The next thing most people want to do is rearrange the maps. There are multiple tools to do this; I recommend MegaMap. (You may need some extra files to get MegaMap to ron, such as zerolib.dll or MSCOMCT2.OCX.) It has some quirks: mainly that it's only partially translated (from German). However, it's a great editor, and IMO better than Goldmap.
Whenever I do this, it comes out with so many # it will drive you bananas.

IIMarckus

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Impersonal Text
    • View Profile
    • iimarck.us
Re: help please?
« Reply #13 on: April 07, 2008, 09:20:10 am »
Whenever I do this, it comes out with so many # it will drive you bananas.
Whenever you do what? Could you be more specific?

Brocco Guy

  • Βροκκω Γαι
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • d(^.^)b
    • View Profile
Re: help please?
« Reply #14 on: April 07, 2008, 01:49:39 pm »
Um...
When I make the Thingy Table and put it into the Hex Editor (For Gold) it comes out with a few P's and then _ and so on, (it's not understandable) and then #####################!