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.

Reply
 
Thread Tools
  #1    
Old April 2nd, 2008, 03:27 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
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. 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.

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:
Code:
??????????
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 
Arceus
That 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.
Code:
Dim LoadedROM As String
For 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:
Code:
Private Sub cmdOpen_Click()

End Sub
What 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.
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. :)
Spoiler:
Code:
Dim cdgOpen As clsCommonDialog
That line just makes a new Variant called "cdgOpen" and will let you set it as a CommonDialog Control.

Code:
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.

Code:
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.)

Code:
    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...
Quote:
Code:
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. :(
Code:
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.
Code:
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. :)
Code:
    cmbPoke2.ListIndex = CInt("&H" & ReverseHEX(ReadHEX(LoadedROM, 2855308, 2)))
As above.
Code:
    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:
Code:
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.
Code:
    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. :)
Spoiler:
Code:
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. :P
Code:
ReverseHEX() was explained before. Read up for more details.
Code:
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. :)
Code:
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:
Code:
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.
Attached Files
File Type: zip CommonDialogModule.zip‎ (1.3 KB, 481 views) (Save to Dropbox)
File Type: zip HEXEditingModule.zip‎ (1.1 KB, 486 views) (Save to Dropbox)
__________________
あなた は しきしゃ です
わたし は ばか です

Last edited by hashtag; April 15th, 2010 at 08:17 AM.
Reply With Quote
  #2    
Old April 2nd, 2008, 04:10 AM
Swampert 22's Avatar
Swampert 22
Is making tools for you...
 
Join Date: Sep 2005
Location: Switzerland
Age: 23
Gender: Male
Nature: Brave
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!
__________________

I've made some tools for Pokémon hacking! Please check out the thread... Swampert Tools Showcase

Head over to my thread to check out my latest tool, Pokémon Red/Blue Trainer Editor!

Visit my site for Pokémon ROM Hacking tools! Swampert Tools Homepage
Reply With Quote
  #3    
Old April 2nd, 2008, 04:17 AM
thethethethe
Gym Leader
 
Join Date: Jun 2007
Location: Melbourne, Australia
Gender: Male
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). I'll have to read through this in more detail sometime soon. I'll be sure to save a lot of time.
__________________
Gone.
Reply With Quote
  #4    
Old April 2nd, 2008, 08:48 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Great, tut, Now I can make some tools

Something's wrong with the link
__________________
Reply With Quote
  #5    
Old April 2nd, 2008, 10:29 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by swampert22 View Post
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

Quote:
Originally Posted by thethethethe View Post
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). 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.

Quote:
Originally Posted by ZodiacDaGreat View Post
Great, tut, Now I can make some tools

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

I'm gonna add pictures after dinner.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #6    
Old April 2nd, 2008, 11:23 PM
ash2000's Avatar
ash2000
Beginning Trainner/Hacker
 
Join Date: May 2006
Location: South Pacific
Gender:
Nature: Calm
Quote:
Originally Posted by Darthatron View Post
Quote:
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.
__________________
Reply With Quote
  #7    
Old April 3rd, 2008, 12:32 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by ash2000 View Post
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
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #8    
Old April 3rd, 2008, 12:36 AM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
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?
__________________
Reply With Quote
  #9    
Old April 3rd, 2008, 01:08 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
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.
__________________
あなた は しきしゃ です
わたし は ばか です

Last edited by Darthatron; April 3rd, 2008 at 01:14 AM. Reason: Fixed.
Reply With Quote
  #10    
Old April 3rd, 2008, 01:31 AM
Innocence's Avatar
Innocence
PC Lurker: I'm watching you...
 
Join Date: Aug 2004
Location: Queensland, Australia. What are you, a stalker?
Age: 20
Gender: Male
Nature: Lonely
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.
__________________

I cringe at things I've said here in the past years.
Reply With Quote
  #11    
Old April 3rd, 2008, 11:12 AM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
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
__________________
Reply With Quote
  #12    
Old April 3rd, 2008, 01:38 PM
D-Trogh's Avatar
D-Trogh
Dead
 
Join Date: Jul 2005
Location: Belgium
Age: 23
Gender: Male
Send a message via Windows Live Messenger to D-Trogh
Quote:
Originally Posted by ZodiacDaGreat View Post
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
Code:
    Dim Data As String
    Data = "47BC89097378"
    WriteHEX ROMLocation, 8388608, Right("000000000000" & Data, 12))
Should work..
__________________
[NTME | WPEDS | HTPE | SGPE | TGPE | PDEDS]
Reply With Quote
  #13    
Old April 3rd, 2008, 02:18 PM
cooley's Avatar
cooley
///Keepin' it simple
Community Supporter
 
Join Date: Feb 2007
Location: United States
Age: 20
Gender: Male
Nature: Impish
Send a message via Windows Live Messenger to cooley Send a message via Skype™ to cooley
I guess this is how decompiling and recompiling scripts work...
__________________

Reply With Quote
  #14    
Old April 3rd, 2008, 10:31 PM
ash2000's Avatar
ash2000
Beginning Trainner/Hacker
 
Join Date: May 2006
Location: South Pacific
Gender:
Nature: Calm
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?
__________________
Reply With Quote
  #15    
Old April 3rd, 2008, 10:45 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by cooley View Post
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.

Quote:
Originally Posted by ash2000 View Post
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..?
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #16    
Old April 3rd, 2008, 10:49 PM
ash2000's Avatar
ash2000
Beginning Trainner/Hacker
 
Join Date: May 2006
Location: South Pacific
Gender:
Nature: Calm
Quote:
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
__________________

Last edited by ash2000; April 3rd, 2008 at 11:10 PM.
Reply With Quote
  #17    
Old April 4th, 2008, 02:22 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by ash2000 View Post
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......
Code:
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...
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #18    
Old April 4th, 2008, 03:38 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Um, Darthatron, Im stuck, Could you give a code, how do you use writehex to: write:
"39600AE202B4024900F000F80F470000" in HEX at Offset "406C0"???


Quote:
WriteHEX ROMLocation, Offset, Right("00000000000000000000" & Data, 20)
should the Offset be in Hex (6digits reversed) or in decimal?
__________________
Reply With Quote
  #19    
Old April 4th, 2008, 04:03 PM
D-Trogh's Avatar
D-Trogh
Dead
 
Join Date: Jul 2005
Location: Belgium
Age: 23
Gender: Male
Send a message via Windows Live Messenger to D-Trogh
Quote:
Originally Posted by ZodiacDaGreat View Post
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?
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 ;)
__________________
[NTME | WPEDS | HTPE | SGPE | TGPE | PDEDS]
Reply With Quote
  #20    
Old April 4th, 2008, 04:15 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
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"?
__________________
Reply With Quote
  #21    
Old April 4th, 2008, 04:30 PM
D-Trogh's Avatar
D-Trogh
Dead
 
Join Date: Jul 2005
Location: Belgium
Age: 23
Gender: Male
Send a message via Windows Live Messenger to D-Trogh
Quote:
Originally Posted by ZodiacDaGreat View Post
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 !!)
__________________
[NTME | WPEDS | HTPE | SGPE | TGPE | PDEDS]
Reply With Quote
  #22    
Old April 4th, 2008, 06:41 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
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?
__________________
Reply With Quote
  #23    
Old April 4th, 2008, 08:02 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by ZodiacDaGreat View Post
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?
Code:
WriteHex ROMLocation, CLng("&H" & txtR.Text), Data
That should do it.
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #24    
Old April 4th, 2008, 08:25 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
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
__________________
Reply With Quote
  #25    
Old April 4th, 2008, 08:44 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by ZodiacDaGreat View Post
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
Code:
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'.
__________________
あなた は しきしゃ です
わたし は ばか です
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:56 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.