PDA

View Full Version : [Tutorial] Visual Basic 6.0 HEX Editing Functions - For Hacking ROMs.


Darthatron
April 2nd, 2008, 03:27 AM
Before we start:
Today I'm going to teach you how to make a basic program to Hack Diamond/Pearl in Visual Basic 6.0. :) Please, before reading on make sure you learn the very basics of Visual Basic 6.0 from somewhere, Google it or something. I'd give you links, but I do believe that is against the rules. :P Also, be sure you already own a Copy of VB6, you cannot download it from Microsoft anymore. You will have to find other ways of locating it. :D

Now, I'm going to show you how to make a Starter Editor for D/P. :D
_______________

Before you start coding... Step 1:
Before you even think of beginning to code you will need several Functions and of course the remarkable 'clsCommonDialog' Class Module. :D

First off, let's get you the Class Module, it is very helpful. And it stops people from getting the annoying "Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid." Error. :) You can get it here (http://www.pokecommunity.com/attachment.php?attachmentid=40052&d=1207211441). Please note, I have no idea who wrote it, but whoever they were they were truly a genius. :)

Also, you will need the HEX Editing Module, with all Functions made by me. You can get that here (http://www.pokecommunity.com/attachment.php?attachmentid=40842&d=1211094495).

Add those 2 files into your project, and then we can continue.
_______________

Now, let's begin. Step 2:
Now, you will want to make 2 Buttons.
1 Named "cmdOpen" and the Caption "Open"
1 Named "cmdSave" and the Caption "Save"

And also, make 3 ComboBoxes. (These will hold which Pokemon will be in the PokeBalls.)
1 Named "cmbPoke1" and the Style set to 2.
1 Named "cmbPoke2" and the Style set to 2.
1 Named "cmbPoke3" and the Style set to 2.

You also have to make the List Property of all the ComboBoxes to this: ??????????
Bulbasaur
Ivysaur
Venusaur
Charmander
Charmeleon
Charizard
Squirtle
Wartortle
Blastoise
Caterpie
Metapod
Butterfree
Weedle
Kakuna
Beedrill
Pidgey
Pidgeotto
Pidgeot
Rattata
Raticate
Spearow
Fearow
Ekans
Arbok
Pikachu
Raichu
Sandshrew
Sandslash
Nidoran-F
Nidorina
Nidoqueen
Nidoran-M
Nidorino
Nidoking
Clefairy
Clefable
Vulpix
Ninetales
Jigglypuff
Wigglytuff
Zubat
Golbat
Oddish
Gloom
Vileplume
Paras
Parasect
Venonat
Venomoth
Diglett
Dugtrio
Meowth
Persian
Psyduck
Golduck
Mankey
Primeape
Growlithe
Arcanine
Poliwag
Poliwhirl
Poliwrath
Abra
Kadabra
Alakazam
Machop
Machoke
Machamp
Bellsprout
Weepinbell
Victreebel
Tentacool
Tentacruel
Geodude
Graveler
Golem
Ponyta
Rapidash
Slowpoke
Slowbro
Magnemite
Magneton
Farfetch'd
Doduo
Dodrio
Seel
Dewgong
Grimer
Muk
Shellder
Cloyster
Gastly
Haunter
Gengar
Onix
Drowzee
Hypno
Krabby
Kingler
Voltorb
Electrode
Exeggcute
Exeggutor
Cubone
Marowak
Hitmonlee
Hitmonchan
Lickitung
Koffing
Weezing
Rhyhorn
Rhydon
Chansey
Tangela
Kangaskhan
Horsea
Seadra
Goldeen
Seaking
Staryu
Starmie
Mr.Mime
Scyther
Jynx
Electabuzz
Magmar
Pinsir
Tauros
Magikarp
Gyarados
Lapras
Ditto
Eevee
Vaporeon
Jolteon
Flareon
Porygon
Omanyte
Omastar
Kabuto
Kabutops
Aerodactyl
Snorlax
Articuno
Zapdos
Moltres
Dratini
Dragonair
Dragonite
Mewtwo
Mew
Chikorita
Bayleef
Meganium
Cyndaquil
Quilava
Typhlosion
Totodile
Croconaw
Feraligatr
Sentret
Furret
Hoothoot
Noctowl
Ledyba
Ledian
Spinarak
Ariados
Crobat
Chinchou
Lanturn
Pichu
Cleffa
Igglybuff
Togepi
Togetic
Natu
Xatu
Mareep
Flaaffy
Ampharos
Bellossom
Marill
Azumarill
Sudowoodo
Politoed
Hoppip
Skiploom
Jumpluff
Aipom
Sunkern
Sunflora
Yanma
Wooper
Quagsire
Espeon
Umbreon
Murkrow
Slowking
Misdreavus
Unown
Wobbuffet
Girafarig
Pineco
Forretress
Dunsparce
Gligar
Steelix
Snubbull
Granbull
Qwilfish
Scizor
Shuckle
Heracross
Sneasel
Teddiursa
Ursaring
Slugma
Magcargo
Swinub
Piloswine
Corsola
Remoraid
Octillery
Delibird
Mantine
Skarmory
Houndour
Houndoom
Kingdra
Phanpy
Donphan
Porygon 2
Stantler
Smeargle
Tyrogue
Hitmontop
Smoochum
Elekid
Magby
Miltank
Blissey
Raikou
Entei
Suicune
Larvitar
Pupitar
Tyranitar
Lugia
Ho-oh
Celebi
Treecko
Grovyle
Sceptile
Torchic
Combusken
Blaziken
Mudkip
Marshtomp
Swampert
Poochyena
Mightyena
Zigzagoon
Linoone
Wurmple
Silcoon
Beautifly
Cascoon
Dustox
Lotad
Lombre
Ludicolo
Seedot
Nuzleaf
Shiftry
Taillow
Swellow
Wingull
Pelipper
Ralts
Kirlia
Gardevoir
Surskit
Masquerain
Shroomish
Breloom
Slakoth
Vigoroth
Slaking
Nincada
Ninjask
Shedinja
Whismur
Loudred
Exploud
Makuhita
Hariyama
Azurill
Nosepass
Skitty
Delcatty
Sableye
Mawile
Aron
Lairon
Aggron
Meditite
Medicham
Electrike
Manectric
Plusle
Minun
Volbeat
Illumise
Roselia
Gulpin
Swalot
Carvanha
Sharpedo
Wailmer
Wailord
Numel
Camerupt
Torkoal
Spoink
Grumpig
Spinda
Trapinch
Vibrava
Flygon
Cacnea
Cacturne
Swablu
Altaria
Zangoose
Seviper
Lunatone
Solrock
Barboach
Whiscash
Corphish
Crawdaunt
Baltoy
Claydol
Lileep
Cradily
Anorith
Armaldo
Feebas
Milotic
Castform
Kecleon
Shuppet
Banette
Duskull
Dusclops
Tropius
Chimecho
Absol
Wynaut
Snorunt
Glalie
Spheal
Sealeo
Walrein
Clamperl
Huntail
Gorebyss
Relicanth
Luvdisc
Bagon
Shellgon
Salamence
Beldum
Metang
Metagross
Regirock
Regice
Registeel
Latias
Latios
Kyogre
Groudon
Rayquaza
Jirachi
Deoxys
Turtwig
Grotle
Torterra
Chimchar
Monferno
Infernape
Piplup
Prinplup
Empoleon
Starly
Staravia
Staraptor
Bidoof
Bibarel
Kricketot
Kricketune
Shinx
Luxio
Luxray
Budew
Roserade
Cranidos
Rampardos
Shieldon
Bastiodon
Burmy
Wormadam
Mothim
Combee
Vespiquen
Pachirisu
Buizel
Floatzel
Cherubi
Cherrim
Shellos
Gastrodon
Ambipom
Drifloon
Drifblim
Buneary
Lopunny
Mismagius
Honchkrow
Glameow
Purugly
Chingling
Stunky
Skuntank
Bronzor
Bronzong
Bonsly
Mime Jr.
Happiny
Chatot
Spiritomb
Gible
Gabite
Garchomp
Munchlax
Riolu
Lucario
Hippopotas
Hippowdon
Skorupi
Drapion
Croagunk
Toxicroak
Carnivine
Finneon
Lumineon
Mantyke
Snover
Abomasnow
Weavile
Magnezone
Lickilicky
Rhyperior
Tangrowth
Electivire
Magmortar
Togekiss
Yanmega
Leafeon
Glaceon
Gliscor
Mamoswine
Porygon-Z
Gallade
Probopass
Dusknoir
Froslass
Rotom
Uxie
Mesprit
Azelf
Dialga
Palkia
Heatran
Regigigas
Giratina
Cresselia
Phione
Manaphy
Darkrai
Shaymin
ArceusThat is just a list of Pokemon so the User can easily select which Pokemon they want to be in each PokeBall. :)
_______________

Now, let's begin coding. Step 3:
Ok. After reading the basic I'm sure you'll know what this line of code does.
Dim LoadedROM As StringFor those of you who 'forgot' what that line does I shall explain, in very little detail. That line basicly just enabled you to use the Variant "ROMLocation" to store the location of the ROM you let the User select.

Alright, so put that code at the very start of your Code. That way you can use it all through-out the current Form. :)
_______________

Making and decoding the 'Open' Button. Step 4:
Ok, in the 'View Object' Mode, double click your Open Button. Now, you should get something that looks like this in your code window: Private Sub cmdOpen_Click()

End SubWhat we want to do inside there is make the actual 'Open Dialog', and allow the User to choose which ROM they would like to edit. So... In the blank space there put the following code. Dim cdgOpen As clsCommonDialog
Set cdgOpen = New clsCommonDialog
LoadedROM = cdgOpen.ShowOpen(Me.hwnd, "Open Pokemon NDS ROM...", , "NDS ROMs (*.nds)|*.nds")
cmbPoke1.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855304, 2)))
cmbPoke2.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855308, 2)))
cmbPoke3.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855312, 2)))In the spoiler I will explain what each line does in as much detail as I can be bothered. :) Dim cdgOpen As clsCommonDialog That line just makes a new Variant called "cdgOpen" and will let you set it as a CommonDialog Control.

Set cdgOpen = New clsCommonDialog Alirght, that part let's you "Set" the cdgOpen Variant to be the same use as a Normal CommonDialog Control, well mostly anyway.

LoadedROM = cdgOpen.ShowOpen(Me.hwnd, "Open Pokemon NDS ROM...", , "NDS ROMs (*.nds)|*.nds") Now... That line is probably the most important so far. It actually shows the Open Dialog, and set's the "LoadedROM" Variant to the returned String. :D (I'll try and dim that sentence down a bit tomorrow, when I'm not so tired.)

cmbPoke1.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855304, 2))) Ok, this may very well be the most important HEX Editing you will ever learn. :) Infact, we have to break this down a little more to completely understand some of the functions...
CInt() is a function that is used to convert a HEX String into an Integer. You ALWAYS have to have a "&H" before the actual HEX number, otherwise it will return errors. Very annoying errors. :(ReverseHEX() is a Function made by yours truely. It is helpful in ROM Hacking due to the fact it will automaticly flip any HEX String you give it. This is good because data like Pokemon Numbers, Item Numbers and Offsets can be stored as Reversed HEX Numbers.ReadHEX() is another Function made by me which is used to read specific Hexadecimal Data from a ROM, or another File. This is the most important HEX Editing Function you will ever come across. You will almost always need this in making a ROM Hacking Tool. Ok... So, basically we have gone through all the Functions there and now we just need to get them to work. :) cmbPoke2.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855308, 2))) As above.
cmbPoke3.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855312, 2))) As above.
_______________

How to make a 'Save' Button. Step 5:
Ok, we are nearly there. We just have to make this Save Button, then we are basically finished. :D

Once again go into 'Design Mode' and double click your Save Button. You should get some code that looks like this: Private Sub cmdSave_Click()

End Sub What we want to do is add some code in there and to write the Data from the Combo Boxes to the ROM.

Ok... So, in the blank area there, put this code in. WriteHEX LoadedROM, 2855304, ReverseHEX(Right("0000" & Hex(cmbPoke1.ListIndex), 4)) What that code does is, it writes the data back into the ROM as the Flipped HEX String. But ofcourse, I will go into detail about what each Function does. :) WriteHEX() is yet another Function made by me which is used to save data into a Files Binary Data (aka it saves the HEX), this is incredibly helpful for any programmer who is in the HEX Editing Industry. :PReverseHEX() was explained before. Read up for more details.Right() is a function used to right a string from the right for a certain amount of characters. For example Right("Darth Is Cool", 7) would return the String "Is Cool". This is great for fixing up the length of a string, so it is never too long. :)Hex() is a another VB6 Function used to convert an Integer(Number) to a Hexadecimal Number. Example: Hex(99) would return "63", because 99 as an integer = 63 as Hex. :)
Woot! Nearly finished now... All you have to do is add the other 2 ComboBoxes, with the fixed offsets to write to and you are done. :D I'll let you do that, to see if you've learned anything. :)
_______________

Pretty your program up a little. Step 6:
All you got to do here is make your program look nice, add some picture or something. Just something to make it look original, and to help make using your tool more enjoyable. :)
_______________

FINISHED!. Step 7:
Finally, you are done. Your code should now look like this: Dim LoadedROM As String

Private Sub cmdOpen_Click()
Dim cdgOpen As clsCommonDialog
Set cdgOpen = New clsCommonDialog
LoadedROM = cdgOpen.ShowOpen(Me.hwnd, "Open Pokemon NDS ROM...", , "NDS ROMs (*.nds)|*.nds")
cmbPoke1.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855304, 2)))
cmbPoke2.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855308, 2)))
cmbPoke3.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855312, 2)))
End Sub

Private Sub cmdSave_Click()
WriteHEX LoadedROM, 2855304, ReverseHEX(Right("0000" & Hex(cmbPoke1.ListIndex), 4))
WriteHEX LoadedROM, 2855308, ReverseHEX(Right("0000" & Hex(cmbPoke2.ListIndex), 4))
WriteHEX LoadedROM, 2855312, ReverseHEX(Right("0000" & Hex(cmbPoke3.ListIndex), 4))
End Sub If it doesn't look something like that, you didn't follow my guise properly. :( Just try again and read carefully. Good luck making some cool Pokemon Hacking Tools! :D

Disclaimer:

If you use these Functions you must Credit me, Darthatron. If you do not credit me, I will cry. If you think I should waive this rule for you, please PM me about it.

If you want to post this on your website or repost it somewhere please PM me.

Swampert 22
April 2nd, 2008, 04:10 AM
Wahaay Darthatron!

I've been looking through that source code you sent me every day, trying to make heads or tails of it and making <ahem> not much progress!

This is great that you've taken the time to do this though, I should be able to understand from this. If not, well I guess I'm just not a programmer!

Well done mate, hopefully aa lot of talent will emerge from this!

thethethethe
April 2nd, 2008, 04:17 AM
I wish you'd posted this before I read through all the source code of other programs. This way looks lots easier than the way I found. I did it everything one byte at a time (without your functions:P). I'll have to read through this in more detail sometime soon. I'll be sure to save a lot of time.

ZodiacDaGreat
April 2nd, 2008, 08:48 PM
Great, tut, Now I can make some tools

Something's wrong with the link

Darthatron
April 2nd, 2008, 10:29 PM
Wahaay Darthatron!

I've been looking through that source code you sent me every day, trying to make heads or tails of it and making <ahem> not much progress!

This is great that you've taken the time to do this though, I should be able to understand from this. If not, well I guess I'm just not a programmer!

Well done mate, hopefully aa lot of talent will emerge from this!
Hell yeah! I rock! :D

I wish you'd posted this before I read through all the source code of other programs. This way looks lots easier than the way I found. I did it everything one byte at a time (without your functions:P). I'll have to read through this in more detail sometime soon. I'll be sure to save a lot of time. Lol sorry, I only wrote it up yesterday. In like an hour and a half. :P

Great, tut, Now I can make some tools

Something's wrong with the link

Which link? D:
____________

I'm gonna add pictures after dinner. :P

ash2000
April 2nd, 2008, 11:23 PM
Originally Posted by ZodiacDaGreat
Great, tut, Now I can make some tools

Something's wrong with the link
Which link? D:


I think he means the links for
"Before you start coding... Step 1:"
There are two links there which does not work.

Darthatron
April 3rd, 2008, 12:32 AM
I think he means the links for
"Before you start coding... Step 1:"
There are two links there which does not work.
I see... Well... I fixed them now. :D

ZodiacDaGreat
April 3rd, 2008, 12:36 AM
I see... Well... I fixed them now.
Thanks for fixing em, by the way how do you replace hex values in a ROM of say 10 bytes?

Darthatron
April 3rd, 2008, 01:08 AM
Thanks for fixing em, by the way how do you replace hex values in a ROM of say 10 bytes?

To read the string of 10 Bytes: String = ReadHEX(ROMLocation, Offset, 10)

To write a string of 10 Bytes: WriteHEX ROMLocation, Offset, Right("00000000000000000000" & Data, 20)
You see, you need to use the number of Bytes times 2, for the number of 0's you need to use. So, for 15 Bytes, you need 30 0's. the same goes for the number at the end.
_______________

Hope that helped.

Innocence
April 3rd, 2008, 01:31 AM
Thank you Darthatron! I've always wanted to be able to make my own rom hacking tools, but couldn't because I had no idea how to make the program read hex! At the very least I'm going to start making my own G/S editor.

ZodiacDaGreat
April 3rd, 2008, 11:12 AM
Quote:
Originally Posted by ZodiacDaGreat View Post
Thanks for fixing em, by the way how do you replace hex values in a ROM of say 10 bytes?
To read the string of 10 Bytes:
Code:

String = ReadHEX(ROMLocation, Offset, 10)

To write a string of 10 Bytes:
Code:

WriteHEX ROMLocation, Offset, Right("00000000000000000000" & Data, 20)

You see, you need to use the number of Bytes times 2, for the number of 0's you need to use. So, for 15 Bytes, you need 30 0's. the same goes for the number at the end.
_______________

Hope that helped.

Sorry, again, could you give me an example, ok, if I want to put hex values "47BC89097378" at 0x800000 how do you do it?
I dont quite understand the procedure

D-Trogh
April 3rd, 2008, 01:38 PM
Sorry, again, could you give me an example, ok, if I want to put hex values "47BC89097378" at 0x800000 how do you do it?
I dont quite understand the procedure Dim Data As String
Data = "47BC89097378"
WriteHEX ROMLocation, 8388608, Right("000000000000" & Data, 12))Should work..

cooley
April 3rd, 2008, 02:18 PM
I guess this is how decompiling and recompiling scripts work...

ash2000
April 3rd, 2008, 10:31 PM
Could anyone tell me how to declare a list of numbers (233243) as byte?

Dim x as byte
x = "233243"

I tried this, it doesn't work, could anyone help?

Darthatron
April 3rd, 2008, 10:45 PM
I guess this is how decompiling and recompiling scripts work...

Yeah, but the easier way would be to use the Select Case Function, if you need more info on how to do that, just PM me.

Could anyone tell me how to declare a list of numbers (233243) as byte?

Dim x as byte
x = "233243"

I tried this, it doesn't work, could anyone help?

What do you mean by list of numbers..?

ash2000
April 3rd, 2008, 10:49 PM
What do you mean by list of numbers..?

You know:

Dim x as byte
x = ""

How do you declare a list of bytes?

I want to do this:
Dim Data as Byte
Data = "23232323"
Put #FileNum, &H800000, Data

Inserting 23 23 23 at 800000

Darthatron
April 4th, 2008, 02:22 AM
You know:

Dim x as byte
x = ""

How do you declare a list of bytes?

I want to do this:
Dim Data as Byte
Data = "23232323"
Put #FileNum, &H800000, Data

Inserting 23 23 23 at 800000
Ohhhh. ALl you have to do is declare the Data as a String. I'm pretty sure that Bytes are just 2 letters long, so that mucks it up...

So......
Dim Data as String
Data = "23232323"
Put #FileNum, CInt("&H800000"), Data And I really think you should use my Functions, they make it easier for me to help you...

ZodiacDaGreat
April 4th, 2008, 03:38 PM
Um, Darthatron, Im stuck, Could you give a code, how do you use writehex to: write:
"39600AE202B4024900F000F80F470000" in HEX at Offset "406C0"???


WriteHEX ROMLocation, Offset, Right("00000000000000000000" & Data, 20)

should the Offset be in Hex (6digits reversed) or in decimal?

D-Trogh
April 4th, 2008, 04:03 PM
Um, Darthatron, Im stuck, Could you give a code, how do you use writehex to: write: "39600AE202B4024900F000F80F470000" in HEX at Offset "406C0"???

should the Offset be in Hex (6digits reversed) or in decimal?Have you seen my post (http://pokecommunity.com/showpost.php?p=3463762&postcount=12)?
If you've read it, you should know how to write that line of code to your ROM.
And, as you see, offsets are in decimal ;)

ZodiacDaGreat
April 4th, 2008, 04:15 PM
Have you seen my post?
If you've read it, you should know how to write that line of code to your ROM.
And, as you see, offsets are in decimal ;)

Sorry, D-trogh, I didn't notice, well, its fixed now. Thanks alot, I'll credit you.

One more thing how do you use the reverse hex for writing pointers?
eg.
"21348008"?

D-Trogh
April 4th, 2008, 04:30 PM
Sorry, D-trogh, I didn't notice, well, its fixed now. Thanks alot, I'll credit you.

One more thing how do you use the reverse hex for writing pointers?
eg.
"21348008"?You don't need to credit me.. Next time just try and read, k?
And, to answer on your question: ReverseHEX(HEXString) will ^^
So ReverseHEX(08123456) will return 56341208

Good Night (2:30AM !!)

ZodiacDaGreat
April 4th, 2008, 06:41 PM
yep, so far everything's working fine,
Now, I need a code that does this:

there's a textbox(named txtR)which is used for inputting offsets(6 digits), I need a code that changes the number value in the textbox to decimal, so I can use writehex, romlocation, "offset" how do you do it?

Darthatron
April 4th, 2008, 08:02 PM
yep, so far everything's working fine,
Now, I need a code that does this:

there's a textbox(named txtR)which is used for inputting offsets(6 digits), I need a code that changes the number value in the textbox to decimal, so I can use writehex, romlocation, "offset" how do you do it?
WriteHex ROMLocation, CLng("&H" & txtR.Text), Data
That should do it.

ZodiacDaGreat
April 4th, 2008, 08:25 PM
That should do it.

Worked again!, now how about a code that checks whether theres a value in the textbox, in my case txtR. So there wont be any mis-compilation of bytes into the ROM

Thanks again, Darthatron

Darthatron
April 4th, 2008, 08:44 PM
Worked again!, now how about a code that checks whether theres a value in the textbox, in my case txtR. So there wont be any mis-compilation of bytes into the ROM

Thanks again, Darthatron
If Len(txtR.Text) > 0 Then
WriteHex ROMLocation, CLng("&H" & txtR.Text), Data
End If

The Len() Function checks the length of a String. It is used mostly for checking if you have any data held in a Variant. :D

The code "If Len(txtR.Text) > 0 Then" checks if the Length of the Data in the String is above 0. 'If' it is then it will do the code before 'End If'.

cooley
April 5th, 2008, 04:06 PM
It was a great Idea to make this Thread. Especially for me!
I have a question, will these commands work for Visual basic 2008 Express edition? Because I can't find VB 6.0 anywhere!

Oh yeah, another thing, As long as you have the data for the Rom, you can make tools for it right?

Darthatron
April 5th, 2008, 05:39 PM
It was a great Idea to make this Thread. Especially for me!
I have a question, will these commands work for Visual basic 2008 Express edition? Because I can't find VB 6.0 anywhere!

Oh yeah, another thing, As long as you have the data for the Rom, you can make tools for it right?

No, I don't think they will work with VB 2008. Although these languages are similar, they also have some major differences. When I get time I will try and make functions for .Net 2008. :)

Swampert 22
April 6th, 2008, 09:16 AM
Hey everyone. The development of new tools is coming along at a simply staggering pace now. I wish to add my own to the mix!

It is a RBY gym and elite4 editor.

It reads data from the rom ok, but writing it back is the only problem. We all know (well most of us) that a Pokémon's "hexbyte" only lasts one byte in RBYGSC, but whenever my program writes, it writes 2 bytes, and erases the byte after the desired one aswell. Does anyone know how to get it to write just one byte?

Thanks

ZodiacDaGreat
April 6th, 2008, 11:24 PM
Yeah, Thanks to this thread, I've made my first tool, which is in the toolbox.

Bravo! Darthatron!

Darthatron
April 7th, 2008, 03:57 AM
Hey everyone. The development of new tools is coming along at a simply staggering pace now. I wish to add my own to the mix!

It is a RBY gym and elite4 editor.

It reads data from the rom ok, but writing it back is the only problem. We all know (well most of us) that a Pokémon's "hexbyte" only lasts one byte in RBYGSC, but whenever my program writes, it writes 2 bytes, and erases the byte after the desired one aswell. Does anyone know how to get it to write just one byte?

Thanks
WriteHEX LoadedROM, Offset, Right("00" & Data, 2) That should work a charm. :)

Reaper 6
April 7th, 2008, 04:10 AM
how do u make other tools such as a tile editor

Darthatron
April 7th, 2008, 05:12 AM
how do u make other tools such as a tile editor
Well.... You would have to decompile the actual tile image and then get the program to read it and make it editable, then work out how to recompile it and insert it into the ROM. :)

Good luck, I don't know how to do it.

Swampert 22
April 7th, 2008, 05:13 AM
Thanks Darthatron buddy, I'd tryed that but it hadn't worked before, I think I didn't Dim LoadedRom as String???

Thanks again. My tool will be out soon!

Reaper 6
April 7th, 2008, 05:17 AM
Well.... You would have to decompile the actual tile image and then get the program to read it and make it editable, then work out how to recompile it and insert it into the ROM. :)

Good luck, I don't know how to do it.

oh i dont understand it that much but thanks anyway

Dan13x
April 7th, 2008, 07:33 PM
Where do I make it the tools? In which program?

ZodiacDaGreat
April 7th, 2008, 08:07 PM
Where do I make it the tools? In which program?

lol, a programming language of course, people here mostly use VisualBasic 6, just as the thread suggests, a download can be found if you search at wikipedia, thats where I found mine.

It isn't simple though, to code

X-Buster
April 13th, 2008, 05:03 AM
and how do you use it?

messagetoshortmessagetoshortmessagetoshortmessagetoshortmessagetoshortmessagetoshort

Game goer
April 14th, 2008, 02:56 AM
sweet! I finally fulfilled my dream of making a tool! lol

Darthatron, do you mind if i take this tutorial for a youtube video? I'll give you all the credit!

Lin
April 15th, 2008, 05:59 PM
This is pretty much useless to me, because I've like mastered VB and already know ROM Hacking: This just uses methods that contain Get, Seek, Put, Open, etc... And here's my main question: I need to know how to hack graphics. Get this: I've been trying for almost a year now. I've tried the set pixel method, Line, etc... And looked at so many sources, even the EM sources and I can't grab graphics. I went to Jathy's IRC channel (Creator of SMILE) and tried to learn to graphics hack from him. He just explained to me what I needed to know, the format of the gb/c/a, and that just made it worse, because I already knew the format of the graphics. I've edited the graphics of a ROM via hex editor, like I did in Zelda LA, and I can't display the graphics in VB. I just don't know how to check the byte on an offset and display that pixel. I know how the hex editing works, byte pairs, offsets, etc... And the format of the systems. I was wondering if you knew how and could teach me; I've gone on long enough without knowing... Thanks, and sorry for the super long reply for a simple question :)

EDIT: I already know you use ASM for uncompressing the graphics and then recompressing them, but in the games I want to hack, such as Zelda LA, a bunch of the tiles aren't compressed. So I just need to know the method...

Dan13x
April 20th, 2008, 09:57 PM
I'm using Visual Basic 2008 Express edition, does anyone know how to create a ROM Hacking tool in this program?

Swampert 22
April 21st, 2008, 09:34 AM
I'm using Visual Basic 2008 Express edition, does anyone know how to create a ROM Hacking tool in this program?

It is possible, but some of the commands in 2008 are different to VB6. Your best bet is to do a google search for VB6. It's around somewhere. Then you can open up sources that come with programs to see what meakes 'em tick!:D

lugiale
April 23rd, 2008, 11:29 AM
Thanks very much for the tutorial darthatron,it helped to me a lot.
I hope you will do more interesting tutorials like this one : D


Bye!

Dan13x
April 25th, 2008, 11:32 PM
Finally, I was able to successfully install VB6! Now I can create ROM Hacking tools!

ZodiacDaGreat
April 26th, 2008, 12:09 AM
OK, for those who donot have vb6, a copy can be found at http://www.brandinimp.com/VBBasics1/tut.html

Dan13x
April 26th, 2008, 01:33 PM
Woah, it's hard to code!

My message is too short...

ZodiacDaGreat
May 3rd, 2008, 09:15 PM
whats the code to copy large amount of hex data, say for example. From offset &H800000 to &H800500, after copying those, paste at &H900000 to &H900500. Which is basically copy and paste. So whats the code?:P

Darthatron
May 5th, 2008, 01:36 AM
whats the code to copy large amount of hex data, say for example. From offset &H800000 to &H800500, after copying those, paste at &H900000 to &H900500. Which is basically copy and paste. So whats the code?:P

WriteHex LoadedROM, CLng("&H800000"), ReadHEX(LoadedROM, CLng("&H900000"), CLng("&H500"))

That should work, however I didn't test it. :)

X-Buster
May 7th, 2008, 03:24 PM
How do I install it?

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

cloudffvii2696
May 7th, 2008, 05:53 PM
augh, i broke my rom... I think it had to do with the code i typed in...
i would ask somebody what i typed wrong, but i file shredded those files out of anger...
or is it cus i was dumb and used a leaf green rom?

yessss 15 posts! now i can start my thread!

Darthatron
May 7th, 2008, 08:36 PM
How do I install it?

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Download it, then open the Install file..?

augh, i broke my rom... I think it had to do with the code i typed in...
i would ask somebody what i typed wrong, but i file shredded those files out of anger...
or is it cus i was dumb and used a leaf green rom?

yessss 15 posts! now i can start my thread!

If you didn't change the offsets, it's because your dumb. :) If possible try and show me your code and I'll see if I can fix it?

X-Buster
May 7th, 2008, 08:47 PM
I download what ZDG post here, what should i install..?the file name..?

NytewolfAU2k7
May 7th, 2008, 08:59 PM
Nice work :) , I wrote a basic hex editor myself once, though I did it in C++ rather than VB6.

ZodiacDaGreat
May 7th, 2008, 09:30 PM
I download what ZDG post here, what should i install..?the file name..?

try the setup 1st then acmboot(something like that) if not acmboot then setup, honestly you should try first - wont damage your pc, or check the readme:shocked:

X-Buster
May 8th, 2008, 02:07 AM
now their asking for the CD Key, where could I find It..?

Darthatron
May 8th, 2008, 03:47 AM
now their asking for the CD Key, where could I find It..?

in most versions on the net the key "000000000000000000" works. :D

X-Buster
May 8th, 2008, 04:32 AM
Thanks for the both of you..!^^

hi sir tomato my password is syvniti
May 8th, 2008, 04:58 AM
Once agian i need your wonderfull help. As you might Know I'm making md tool, But then i need to ask you, About Text Editing?
How could i make a Text editor, so i go load the text from the text part (Not hex) And then show, and you will be able to rewrite and save it.. Mainly My ask, is How does i make it as it only loads the part with the text i want to use, and not any thing else?
I can not just load all the text into a richtextbox.
Does you know how? (Sorry if it don't belong here...)

Darthatron
May 8th, 2008, 05:58 AM
Once agian i need your wonderfull help. As you might Know I'm making md tool, But then i need to ask you, About Text Editing?
How could i make a Text editor, so i go load the text from the text part (Not hex) And then show, and you will be able to rewrite and save it.. Mainly My ask, is How does i make it as it only loads the part with the text i want to use, and not any thing else?
I can not just load all the text into a richtextbox.
Does you know how? (Sorry if it don't belong here...)

I'll write you up a Function and send it to you on MSN, and if you like I can explain what everything means. Tommorow, I'm going to bed now, BYE!!!!!

cloudffvii2696
May 8th, 2008, 12:10 PM
...I'm not dumb...
I'm just a little special...

Darthatron
May 8th, 2008, 08:33 PM
...I'm not dumb...
I'm just a little special...

I didn't mean to insult, but make sure to read over the details in Tutorials before you ask questions. Thankyou. :D

Swampert 22
May 9th, 2008, 10:37 AM
Hey Darthatron buddy, it's been a while, since I asked you a question, but I need your wisdom to progress!

How do you get a listbox's list values to be data that the program has read from the ROM?

I'll explain what I mean:

I want the list of 'words' in the list box to be Pokémon. But the order is obviously dependant on what the program reads. If I got it to read data at &H30303 for example, and the hex-byte was 0A, I would want it to say "Caterpie", if it was FB I would want it to say "Celebi". This list would have to be as long as there as relevant bytes to change, so the list could be 251 'words' long.

I hope you understand that, cus I don't think i understand what I just wrote lol!

Thanks Darthatron!

Darthatron
May 9th, 2008, 09:39 PM
Hey Darthatron buddy, it's been a while, since I asked you a question, but I need your wisdom to progress!

How do you get a listbox's list values to be data that the program has read from the ROM?

I'll explain what I mean:

I want the list of 'words' in the list box to be Pokémon. But the order is obviously dependant on what the program reads. If I got it to read data at &H30303 for example, and the hex-byte was 0A, I would want it to say "Caterpie", if it was FB I would want it to say "Celebi". This list would have to be as long as there as relevant bytes to change, so the list could be 251 'words' long.

I hope you understand that, cus I don't think i understand what I just wrote lol!

Thanks Darthatron!

I think I understand....

ListBox.ListIndex = ReadHEX(LoadedROM, Location, 1)

Is that it? Unless you mean the list of Pokemon is jumbled up and you want to read the Byte, rather than the location?

First off you'd make the ItemData to the actual number of the Pokemon.

Check out this demo source and see if you can understand it. I did comment it, so it shouldn't be too difficult.

CLICK HERE! (http://rapidshare.com/files/113832471/ItemData.zip)

Hope I could help? If not try and rephrase the question. :D

X-Buster
May 10th, 2008, 12:07 AM
how do i make a file change its file type..? (example: I'll make a tool that will open a .raw and saving it, it will turn into a .wraw?)

Lin
May 12th, 2008, 03:18 PM
Hey, just to let you know, I grabbed tiles from a ROM and displayed them. It's very hard though, but I made a function to. Pretty much all of the credits to helping me do it goes to Cearn. He's a genius with this stuff. He's helping me cover saving now, and it's a lot harder than you'd think ;)

[HoN] Jereziah
May 12th, 2008, 05:40 PM
Can someone Mail me the download link of Visual Basic 6.0...
PLease ... so i can make a tool...
Thanks...

Cool Thread
Can you please Mail me the download link of Visual Basic 6.0
Thanks and in addition Im gonna rate this 5/5...

zacdet
May 16th, 2008, 01:15 AM
How do i make buttons? I don't understand

cooley
May 16th, 2008, 06:44 AM
Can someone Mail me the download link of Visual Basic 6.0...
PLease ... so i can make a tool...
Thanks...

Cool Thread
Can you please Mail me the download link of Visual Basic 6.0
Thanks and in addition Im gonna rate this 5/5...
Just download an ISO version of it and mount it with MagicISO.

Darthatron
May 16th, 2008, 06:49 AM
How do i make buttons? I don't understand

As I've said many times. Don't use this guide unless you understand the basics of VB6.

cooley
May 16th, 2008, 09:59 AM
Thanks Darthatron! Look what I made:
http://i185.photobucket.com/albums/x18/Cooley833/untitled-4.jpg

Well with all the0 Gold Data anyways

Darthatron
May 16th, 2008, 09:09 PM
Thanks Darthatron! Look what I made:
http://i185.photobucket.com/albums/x18/Cooley833/untitled-4.jpg

Well with all the0 Gold Data anyways

Well, from the picture it looks okay, but I can't really see it due it's small size. :( Perhaps you could upload a larger version? :)
____________________________________________________________

In other news I updated the HEX Editing Module, now the WriteHEX Function will be faster and use less memory. :)

hi sir tomato my password is syvniti
May 17th, 2008, 11:28 PM
Thanks forupdating the hex functions, you are a true hero!
I'm not realy able to fell the diferrence, just like that, but that's probely just me...
Anyway, you are doing a big work in helping with programing!

ThuGie
May 18th, 2008, 08:57 AM
Hey,
I checked out your function "ReverseHex",
And to tell you the truth it gave me the creeps :p,

First i noticed that when you run this its a example

Dim test As String
test = "01"
msgbox(ReverseHex(test))
msgbox(test)
test will be empty after your function has been used,
And your for loop well you did add a break to it but stil you make it run 2 times it actually needs to loop.
But here's my remake of it.


Public Function ReverseHex(HexData As String) As String
Dim i As Integer
Dim Temp As String
Dim HexHold As String

HexHold = HexData

If InStr(Len(HexHold) / 2, ",") > 0 Then HexHold = "0" & HexHold

For i = 0 To (Len(HexHold) / 2) - 1
Temp = Left(Right(HexHold, Len(HexHold) - (i * 2)), 2) & Temp
Next i

ReverseHex = Temp
End Function
I was bored anyway :-),
And dont say i simple made a copy of your and changed it a bit.
I didnt do any speed check but it should be faster.
At least i think its cleaner that your current one.

edit:
Changed a small thing,
Still if your using mine updating would be smart.
Since now it wont alter the input data at all!

D-Trogh
May 18th, 2008, 09:06 AM
Same problem occurs when you want to use your WriteHEX function to write some data a couple of times..
An example:
WriteHEX sROM, &H<offset1>, sData
WriteHEX sROM, &H<offset2>, sData
WriteHEX sROM, &H<offset3>, sData
Would result in the program writing 'sData' to offset1, but not to offset2 or offset3, as sData is empty..

ThuGie
May 18th, 2008, 09:13 AM
Same problem occurs when you want to use your WriteHEX function to write some data a couple of times..
An example:
WriteHEX sROM, &H<offset1>, sData
WriteHEX sROM, &H<offset2>, sData
WriteHEX sROM, &H<offset3>, sDataWould result in the program writing 'sData' to offset1, but not to offset2 or offset3, as sData is empty..

Yeah its quite a strange thing,
But i think its because he changes the data itself that the function is given,
Like the function gets sData,
In the function itself its called HexData,
He alters HexData but probably in vb6 HexData is simply sData just under a diffrent name,
So because he alters it more like clears it up.
The next time you want to use it its empty,
Its quite easy to fix though,
Simple first Place HexData into a temp and use the temp to alter it ;).
I will take a look maybe i will also recreate that function.

D-Trogh
May 18th, 2008, 09:18 AM
Yeah well..
Maybe 'we' (Read: All people interested in programming ROM Hack tools) should create this module file with good/fast working HEX Edit functions.
Darthatron started all this by sharing his functions.. But as there are some (minor) things that don't work properly..
I also heard Darthatron aren't the fastest.. Haven't checked the latest 'release' though

ThuGie
May 18th, 2008, 09:30 AM
Darthatron was kind enough to release his functions,
And people are ofcourse using them,

But so far i have seen nobody has even tryed to fix the problems that the functions still have,
They use them and compain about the problems,

For me i dont even use the functions but i thought why not take a look and thought well this could use some fixing and i did,
People should be more kind to share what they know help each other.
I will when i have time try and make functions like the other 2 that he released,
But when that will be i dont know i was bored so i made ReverseHex.
But thats only took a few minutes and the other functions will take probably about the same time..
But when you calculate the time spend on all 3 it will add up in 1 day time.
And to tell the truth i think making functions like this is boring :p,
So thank god it only needs to be done once and the 2e time to see if any fixes/tweaks are posible :D.

But really people try and be a bit more open source ;).

Well as i still had some time i fixt the function a bit up,
As you where talking about speed it could be because it writes 1 byte at a time..
Not sure why but i kept it that way.
If really intersted i could rewrite it to write multiple byte's at once probably.


Public Function WriteHex(FilePath As String, Offset As Long, HexData As String)
On Error GoTo ErrHandle

Dim FileNum As Integer
Dim i As Integer
Dim Temp As String
Dim HexHold As String
Dim HexValue() As Byte
HexHold = HexData
FileNum = FreeFile

If InStr(Len(HexHold) / 2, ",") > 0 Then HexHold = "0" & HexHold

ReDim HexValue((Len(HexHold) / 2) - 1)
For i = 0 To (Len(HexHold) / 2) - 1

HexValue(i) = CLng("&H" & Mid(HexHold, 1 + (i * 2), 2))

Next i

Open FilePath For Binary As FileNum
Put FileNum, Offset + 1, HexValue
Close FileNum

Exit Function
ErrHandle:
MsgBox Err.Description, vbOKOnly, "Error: " & Err.Number
End Function
As you see i used mostly his code just tweaked it.
But you should be able to call it using Data as many times you want :).

edit:
D-Trogh, Pointed me to a mistake what i just fixed i had Offset As integer, It should have been Offset As Long
edit2:
I compared my function and Darthatron's function and it seems his is a bit faster so if you want faster you should go for his version.
edit3:
I noticed that DoEvents was the cause of slowness,
But also i updated it even more it now write's all data to file in 1 go!
And as for speed its faster then Darthatron's now did a test writing 5kb 1000 times,
Mine will take around 8 seconds while his will take around 42 seconds.
I really do like speed dont you ?

cooley
May 18th, 2008, 05:37 PM
Well, from the picture it looks okay, but I can't really see it due it's small size. :( Perhaps you could upload a larger version? :)
____________________________________________________________

In other news I updated the HEX Editing Module, now the WriteHEX Function will be faster and use less memory. :)
Well The programs in the attachment below...

Darthatron
May 18th, 2008, 08:08 PM
Darthatron was kind enough to release his functions,
And people are ofcourse using them,

But so far i have seen nobody has even tryed to fix the problems that the functions still have,
They use them and compain about the problems,

For me i dont even use the functions but i thought why not take a look and thought well this could use some fixing and i did,
People should be more kind to share what they know help each other.
I will when i have time try and make functions like the other 2 that he released,
But when that will be i dont know i was bored so i made ReverseHex.
But thats only took a few minutes and the other functions will take probably about the same time..
But when you calculate the time spend on all 3 it will add up in 1 day time.
And to tell the truth i think making functions like this is boring :p,
So thank god it only needs to be done once and the 2e time to see if any fixes/tweaks are posible :D.

But really people try and be a bit more open source ;).

Well as i still had some time i fixt the function a bit up,
As you where talking about speed it could be because it writes 1 byte at a time..
Not sure why but i kept it that way.
If really intersted i could rewrite it to write multiple byte's at once probably.


Public Function WriteHex(FilePath As String, Offset As Long, HexData As String)
On Error GoTo ErrHandle

Dim FileNum As Integer
Dim i As Integer
Dim Temp As String
Dim HexHold As String
Dim HexValue() As Byte
HexHold = HexData
FileNum = FreeFile

If InStr(Len(HexHold) / 2, ",") > 0 Then HexHold = "0" & HexHold

ReDim HexValue((Len(HexHold) / 2) - 1)
For i = 0 To (Len(HexHold) / 2) - 1

HexValue(i) = CLng("&H" & Mid(HexHold, 1 + (i * 2), 2))

Next i

Open FilePath For Binary As FileNum
Put FileNum, Offset + 1, HexValue
Close FileNum

Exit Function
ErrHandle:
MsgBox Err.Description, vbOKOnly, "Error: " & Err.Number
End Function
As you see i used mostly his code just tweaked it.
But you should be able to call it using Data as many times you want :).

edit:
D-Trogh, Pointed me to a mistake what i just fixed i had Offset As integer, It should have been Offset As Long
edit2:
I compared my function and Darthatron's function and it seems his is a bit faster so if you want faster you should go for his version.
edit3:
I noticed that DoEvents was the cause of slowness,
But also i updated it even more it now write's all data to file in 1 go!
And as for speed its faster then Darthatron's now did a test writing 5kb 1000 times,
Mine will take around 8 seconds while his will take around 42 seconds.
I really do like speed dont you ?

Well I feel stupid. :P Then again I did write the first functions about 4 months ago, I have learned a lot from then. Also I'm sure if I re-wrote them they would be up to standard, then again, I'm too busy right now, if you need a faster function use TheGie's version. For now... :)

EDIT: You seemed to have Dimmed "Temp" and not used it, removing it could add precious micro-seconds. :)

EDIT2: After re-writing the WriteHEX Code from scratch I came to realize how bad my old method was. Anyway, I did a Speed Test between my Function and TheGie's. I made each Function run 4000 times. Each 1000 times it would return how fast it was going then at the end it would show the Average, here are the results:
[Darthatron]
First: 921
Second: 938
Third: 906
Forth: 1047

Average: 953

[TheGie]
First: 1047
Second: 1000
Third: 937
Forth: 953

Average: 984.25
As you can see mine is only slightly faster. I'd also like to note my Computer is VERY slow and these speed should be closer to 500 or 600.

I plan to redo my ReadHEX Function, though I don't think it can get much faster, then again it's pretty sloppy too. :)

ThuGie
May 19th, 2008, 01:27 AM
First its not TheGie but ThuGie :D,
Second for the test are you using your rewriten code or the currect one in the package,
Also what kind of test did you do,
I used a bit of a stress test of 5k writing 1000x times,
As size could slow yours down as your writing byte by byte.

And it could be so that yours is faster for smaller sizes but try to run both tests :).

Darthatron
May 19th, 2008, 02:10 AM
First its not TheGie but ThuGie :D,
Second for the test are you using your rewriten code or the currect one in the package,
Also what kind of test did you do,
I used a bit of a stress test of 5k writing 1000x times,
As size could slow yours down as your writing byte by byte.

And it could be so that yours is faster for smaller sizes but try to run both tests :).

Yes, the test is with my new Function. It writes 1 Byte at a time. It writes 4 by 1000x.

Both Function's run after each other.

Also, sorry about the name I was pretty tired when I wrote everything up. :)

ThuGie
May 19th, 2008, 02:16 AM
Ah try and run them seperate,
But also try to write 5kb per function each time it runs ;). so 1000x 5kb

cooley
May 22nd, 2008, 04:34 PM
Darthatron, I need your help with VB 6

1. What is Len, LenB etc. I always see them everywhere, but I never know what they mean.

2. Every time I Write hex back to the ROM then it puts the data one byte ahaed or behind the actual offset. Do you know why? The code is below:


Option Explicit

Dim sFile As String
___________________________________
Private Sub Command1_Click()
Dim iFileNum As Integer

iFileNum = FreeFile
sFile = frmMain.CommonDialog1.FileName

If cmbPoke.Text = "" Then
MsgBox ("Pick a Pokemon please")

Else

Open sFile For Binary As #iFileNum
Put #iFileNum, &H5FDE, cmbPoke.ListIndex

Close #iFileNum
Unload Me
End If
End Sub
3. I put cmbPoke.ListIndex, how does VB know we're talking about hex? For the pokemon numbers that is. When there aren't any hex values assigned to the Pokemon themselves?

Ex. I click Pikachu(&h19 and no. 25) how does it write 19 back to the rom when it's no. 25 on the list?

ThuGie
May 22nd, 2008, 05:29 PM
1. What is Len, LenB etc. I always see them everywhere, but I never know what they mean.
Len is used to calculate the lenght of a string, LenB does the same but it seems a bit faster..

2. Every time I Write hex back to the ROM then it puts the data one byte ahaed or behind the actual offset. Do you know why? The code is below:
do +1 by the offset since it begins at 0.

3. I put cmbPoke.ListIndex, how does VB know we're talking about hex? For the pokemon numbers that is. When there aren't any hex values assigned to the Pokemon themselves?
cmbPoke.ListIndex will result in a integer value of the item selected like if you choose the 2e in line it wil result in 2. so nothing to do with hex.

Ex. I click Pikachu(&h19 and no. 25) how does it write 19 back to the rom when it's no. 25 on the list?
And if your talking about the offset here well &H tells it that you are using Hex.

cooley
May 22nd, 2008, 05:42 PM
Is this correct to write all these bytes next to each other?

Thanks, by the way!

If opt2.Value = True Then
Put #iFileNum, &H5AD5, &H2
Put #iFileNum, &H5AD6, &H0
Put #iFileNum, &H5AD7, &H1
Put #iFileNum, &H5AD8, &HFF
If opt3.Value = True Then
Put #iFileNum, &H5AD9, &O3
Put #iFileNum, &H5ADA, &H0
Put #iFileNum, &H5ADB, &H1
Put #iFileNum, &H5ADC, &H2
Put #iFileNum, &H5ADD, &HFF
If opt4.Value = True Then
Put #iFileNum, &H5ADE, &H4
Put #iFileNum, &H5ADF, &H0
Put #iFileNum, &H5AE0, &H1
Put #iFileNum, &H5AE1, &H2
Put #iFileNum, &H5AE2, &H3
Put #iFileNum, &H5AE3, &HFF
Close #iFileNum

Darthatron
May 22nd, 2008, 09:32 PM
Is this correct to write all these bytes next to each other?

Thanks, by the way!

If opt2.Value = True Then
Put #iFileNum, &H5AD5, &H2
Put #iFileNum, &H5AD6, &H0
Put #iFileNum, &H5AD7, &H1
Put #iFileNum, &H5AD8, &HFF
If opt3.Value = True Then
Put #iFileNum, &H5AD9, &O3
Put #iFileNum, &H5ADA, &H0
Put #iFileNum, &H5ADB, &H1
Put #iFileNum, &H5ADC, &H2
Put #iFileNum, &H5ADD, &HFF
If opt4.Value = True Then
Put #iFileNum, &H5ADE, &H4
Put #iFileNum, &H5ADF, &H0
Put #iFileNum, &H5AE0, &H1
Put #iFileNum, &H5AE1, &H2
Put #iFileNum, &H5AE2, &H3
Put #iFileNum, &H5AE3, &HFF
Close #iFileNum

Yes, but you never opened the File for Editing...

Also, you didn't end your IF Statements.

interdpth
May 22nd, 2008, 11:10 PM
I'd like to point out, that while your little HEX module is handing it's easily replaceable.
For dealing with hex values
&H
that reverse hex is just declaring the proper variable
dim byte1 as byte'Handles 1 byte
byte1=&H0C
viewing with a hex editor you'll see 0x
dim integer1 as integer'Handles 2 bytes
integer1=&HFF04
viewing with a hexeditor
04 FF

and the one I guess that reversehex is mainly used for

the long

dim long1 as long'4 bytes usually for a pointer
long1=&h8123456
in a hex editor
56 34 12 08
Get it now?

Readhex is simply reduced to
dim byte1 as byte
open filepath for binary as #1
get #1, offset+1,byte1
or
seek #1, offset+1
get #1, ,byte1
close #1
for integers

just change the byte to integer

for long just change integer or byte to long

to write data to a rom use put instead of get

and to extract the address from a long
just take the 8 off so
offset-&h8000000

make sure if you're pointing a pointer into a rom make sure to add the &H8000000


simple.

And not bloated.

Darthatron
May 23rd, 2008, 12:54 AM
I'd like to point out, that while your little HEX module is handing it's easily replaceable.
For dealing with hex values
&H
that reverse hex is just declaring the proper variable
dim byte1 as byte'Handles 1 byte
byte1=&H0C
viewing with a hex editor you'll see 0x
dim integer1 as integer'Handles 2 bytes
integer1=&HFF04
viewing with a hexeditor
04 FF

and the one I guess that reversehex is mainly used for

the long

dim long1 as long'4 bytes usually for a pointer
long1=&h8123456
in a hex editor
56 34 12 08
Get it now?

Readhex is simply reduced to
dim byte1 as byte
open filepath for binary as #1
get #1, offset+1,byte1
or
seek #1, offset+1
get #1, ,byte1
close #1
for integers

just change the byte to integer

for long just change integer or byte to long

to write data to a rom use put instead of get

and to extract the address from a long
just take the 8 off so
offset-&h8000000

make sure if you're pointing a pointer into a rom make sure to add the &H8000000


simple.

And not bloated.

Simple for you and I, but not for people who don't understand Visual Basic, or who are only just learning, this is for those people. Thanks for the lesson though, I had no idea each Variant was meant to hold a different amount of data... :)

interdpth
May 23rd, 2008, 06:39 AM
Honestly you shouldn't even try to program if you don't know variables. If anyone wants i'll teach more

ℜªℳ
May 29th, 2008, 01:46 PM
I just got into porgramming 4 days ago so I'm new but I already have C++ down. I'm trying to learn VB and I just have a simple question about your tools(I will ask questions in the future since I'm new in this area). Do I have to use VB6 for this becuz it is very out dated and there has been many recent VBs like VB 2008 which is known as VB9? Also, its not possible for you to give us a free download of VB6 is it? (little infringement won't hurt any1) just joking.

@all- If any1 contacts me via email I can help them get one painlessly (sorry for simple spamming and cheapAd)

I also have another question (sorry for the double post if it shows as so and doesn't merge)...
In the second step when entering the pokeballs I don't see where "style" is to put in the number 2. can any1 help? My tool has index, shortcut, help contextId, and negotiate position (it say none, middle, left, right) and the 4 chk offs. There's no style to writee the number 2 in. Also I have no idea as where I'm supposed to insert the list for the pokemon. Like I said before I just started with visual basic and my friend Akido said its the best for programming so here I am.

Darthatron
May 29th, 2008, 06:08 PM
I just got into porgramming 4 days ago so I'm new but I already have C++ down. I'm trying to learn VB and I just have a simple question about your tools(I will ask questions in the future since I'm new in this area). Do I have to use VB6 for this becuz it is very out dated and there has been many recent VBs like VB 2008 which is known as VB9? Also, its not possible for you to give us a free download of VB6 is it? (little infringement won't hurt any1) just joking.

@all- If any1 contacts me via email I can help them get one painlessly (sorry for simple spamming and cheapAd)

I also have another question (sorry for the double post if it shows as so and doesn't merge)...
In the second step when entering the pokeballs I don't see where "style" is to put in the number 2. can any1 help? My tool has index, shortcut, help contextId, and negotiate position (it say none, middle, left, right) and the 4 chk offs. There's no style to writee the number 2 in. Also I have no idea as where I'm supposed to insert the list for the pokemon. Like I said before I just started with visual basic and my friend Akido said its the best for programming so here I am.

Hello. First off let me say, if you know C++ stick with it, as you said VB6 is way outdated, and Vista barely supports it anymore. I'd recommend using the built in File Editing resources for C++.

If you really need help with VB6 I'll help,m but I would seriously recommend sticking with one of the newer versions of the Visual Studio family. :)

ThuGie
June 1st, 2008, 02:32 AM
I agree with Darthatron,
If you know a higher lvl language then vb6 stick with it.

ℜªℳ
June 1st, 2008, 06:16 AM
ok but unfortanutely there isn't any tutorial on how to create a hack tool with it so I chose to learn VB6 since many ppl use it. wat I now need to know is will the new visual basics work with this same tutorial?

OM3GA Umbr30n
September 12th, 2009, 01:33 PM
Ive recently searched the microsoft download site looking for VB 6.0 and i found the installer!
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=5fbbc453-cd04-4562-a66e-5c21436e6f56

madarawolf
September 22nd, 2009, 12:24 PM
When I try to run the program it says there is sometinhg wrong with this line
"Private Sub cmdOpen_Click()
Dim cdgOpen As clsCommonDialog"
I'm not sure whats wrong tho.
if this question is noobish forgive my impudence for I have just started in a programing class and haven't learned too much yet.

Elite Trainer Red
May 16th, 2010, 10:58 AM
Finnaly i can make my tools ^_^

SilentCoders
April 7th, 2011, 01:26 PM
You don't need to credit me.. Next time just try and read, k?
And, to answer on your question: ReverseHEX(HEXString) will ^^
So ReverseHEX(08123456) will return 56341208

Good Night (2:30AM !!)
how do you add the functions in ?

Aljam
April 13th, 2011, 02:41 PM
This seems very interesting, but why would I need the comdlg module? There is already one by default in vb6.

gamesharkhacker
April 18th, 2011, 05:58 PM
Does anybody know how to insert a file that has been opened with the program into a rom that has been also opened with the program using WriteHEX? Is it possible?
If not, is there any other ways of doing it? Can you please get back to me soon on this as this is the only thing keeping me back from releasing my program.

Thanks, GSH.

ShadowMrk
May 10th, 2011, 03:12 PM
Does anybody know how to insert a file that has been opened with the program into a rom that has been also opened with the program using WriteHEX? Is it possible?
If not, is there any other ways of doing it? Can you please get back to me soon on this as this is the only thing keeping me back from releasing my program.

Thanks, GSH.

Sounds like that is a major part of your program. Anyways, just use a For...Next loop to store the bytes from the source file and then use the writehex function in another For...Next loop to insert the bytes into the target file making sure to use a base address and using your counter variable as an offset of the base address.

jjf_kira
July 29th, 2011, 03:54 AM
Hey can you give me some code for editing the levels of the selected pokemon?:(

Hey can you tell me the code for the starter levels?
because if i choose a legendary pokemon its weak because it is low level

batexplorer1999
October 1st, 2011, 06:56 AM
why does it give me failed or an error on it