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

Closed Thread
 
Thread Tools
  #1    
Old November 19th, 2007 (2:13 PM). Edited December 10th, 2011 by score_under.
score_under's Avatar
score_under score_under is offline
I program the *other* ASM.
  • Crystal Tier
 
Join Date: Aug 2005
Location: Hertfordshire, England
Age: 24
Nature: Rash
Posts: 525
I am no longer active on these forums; if you need to contact me please use e-mail unless your name is Seth in which case please run a virus scan first. I probably won't develop this tool any more, you can steal the code or something.

Works in: Pokemon Gold, Pokemon Silver, Pokemon Crystal, Pokemon Fire Red, Pokemon Leaf Green, Pokemon Emerald, Pokemon Ruby, and Pokemon Sapphire. (Now dynamic offsets work in Gold too)


Most of the posts on the first page (except this one) that I have made are for the old command-line version.
If you don't have a webkit-based (e.g. Safari), Mozilla-based (e.g. Firefox), or css3-compliant browser, get firefox now as this page's CSS renders well ONLY in one or more of these conditions. If you use, for example, Internet Explorer, it will not display correctly.

Simple Guide Here
Beginners only - PKSV is so much more than this!


Warning: Never use #org $1 (or similar pokescript parlance), as it will write to position 1 in the ROM and corrupt vital data.
Get it at http://pk-script-view.sourceforge.net/.


Simply put, PKSV is a Pokémon Advance script editor. A very good one...
One you will instantly get hooked on - It's only a matter of time before you download!
The package you most probably want is the package with GUI.
Here's how it looks:

Anyone with spare time, a brain, and a sharp eye for bugs can develop it if they want - I give away ALL the source code in the download link!

I have developed this program in my free time because I found that Rubikon and PokeScript weren't advanced enough to suit my needs. This program will also automatically notify you of updates [version data] whenever they're available.

Two of the most unique features about this program:
  • It compiles movements into easy-to-read movement lists, not #raw!
  • It has a built in script generator! (But I'll need some more people to give me ideas about some other simple scripts that I could generate!)
  • Heck, you can even zoom in and out with ctrl+mouse wheel. (Or indeed, ctrl+numpad+ and ctrl+numpad- respectively)

How to install:
Use an unzipping program (if you don't have EITHER Windows XP OR one of these, do a google search for AlZip) to unzip the file you downloaded (usually pksvui_pkg?-?-?.zip).
Unzip it into its own folder and when you are happy with the place you have put it, double-click "AssociateShell.bat" to register PKSV in its current folder with your system.
Now all you have to do is run "pksvui.exe" and play around!


(If you're interested in how Gold #dynamic works, look here)
Spoiler:
Code:
#dyn findfromgold
#org @test
loadfont
2writetext :test
yesorno
2ptjump :asd
:test
= Testing\nTest1\e
:asd
#3ptr @zzzz
#org @zzzz
3writetext @asdf
3jump @yyyy
#org @yyyy
end

#org @asdf
= Message 2\e
Notice that 2-byte pointers use :labels and 3-byte pointers use @blocks. This is because "#org" blocks will never cross a bank, so a label inside them ensures it will be able to use a 2-byte pointer safely. You cannot use labels for 3-byte commands, unfortunately, you will have to use a code block.


Please reply if you like it!
...or rate this thread, or add reputation to this post, or PM me with hate, or add to my visitor messages.

Tech stuff:
Spoiler:
PKSV is a GPL-licenced decompiler and compiler for Pokémon Advance ROMs, currently with only one developer - me!
There are 2 executables: pksvui.exe is the frontend (the graphical IDE) and pksv.exe is the backend.
It is programmed in a mixture of C and ASM, and compiled with Visual C++.

Relevant Advertising!

  #2    
Old November 24th, 2007 (5:58 AM).
Kristian's Avatar
Kristian Kristian is offline
     
    Join Date: Sep 2007
    Location: Norway? :b
    Nature: Calm
    Posts: 170
    WOW, i tested it and it work perfectly! :p really simple to use to =)
      #3    
    Old November 25th, 2007 (1:04 AM).
    light_trainer921's Avatar
    light_trainer921 light_trainer921 is offline
    Flamethrower Helper
       
      Join Date: Nov 2006
      Location: Treasure Town at the human world
      Age: 21
      Gender:
      Nature: Timid
      Posts: 137
      I hate to be off-topic or breaking the rules but how can I get the program to work?
      __________________
        #4    
      Old November 25th, 2007 (2:12 AM).
      Kristian's Avatar
      Kristian Kristian is offline
         
        Join Date: Sep 2007
        Location: Norway? :b
        Nature: Calm
        Posts: 170
        Quote:
        Originally Posted by light_trainer921 View Post
        I hate to be off-topic or breaking the rules but how can I get the program to work?
        first you have to download the: pksv_sourcecode,
        when you have download that, unzip it,
        then open pksv.exe,
        then you load your rom then you type the offset you wanna see..
          #5    
        Old November 25th, 2007 (7:25 AM).
        Teamtyranitar's Avatar
        Teamtyranitar Teamtyranitar is offline
        Fizz-X
           
          Join Date: Nov 2007
          Location: Enjoying life
          Age: 22
          Gender:
          Nature: Lax
          Posts: 214
          umm what offset
          ......................
          __________________
            #6    
          Old November 25th, 2007 (11:33 PM).
          Dan13x's Avatar
          Dan13x Dan13x is offline
             
            Join Date: Apr 2007
            Location: Brisbane, Australia
            Age: 21
            Gender: Male
            Nature: Quiet
            Posts: 75
            Wow! I've always wanted to see some of the scripts. Thanks score_under!
              #7    
            Old November 26th, 2007 (9:10 AM).
            D-Trogh's Avatar
            D-Trogh D-Trogh is offline
            Dead
               
              Join Date: Jul 2005
              Location: Belgium
              Age: 25
              Gender: Male
              Posts: 438
              Send a message via Windows Live Messenger to D-Trogh
              Quote:
              Originally Posted by dan123410 View Post
              Wow! I've always wanted to see some of the scripts. Thanks score_under!
              Yeah, l0l.. why didn't you use ScriptEd or ScriptDec then? XD
              __________________
              [NTME | WPEDS | HTPE | SGPE | TGPE | PDEDS]
                #8    
              Old November 26th, 2007 (12:09 PM). Edited August 23rd, 2008 by score_under.
              score_under's Avatar
              score_under score_under is offline
              I program the *other* ASM.
              • Crystal Tier
               
              Join Date: Aug 2005
              Location: Hertfordshire, England
              Age: 24
              Nature: Rash
              Posts: 525
              This post applies to an OLD version of the program only
              Spoiler:


              Now it does even more: recompiles strings! I should have had this 2 days ago, but sourceforge didn't like the package.

              @ D-Trogh:
              It can decompile most scripts without problems, and makes a Clear Distinction between pause and pauseevent, while rubikon labels them as just pause *ambiguous*.
              It also makes a distinction between msgbox (part of loadpointer) and message (something else to do with berry script, same effect).
              And it doesn't forget to apply #org to any movement data. Shame on Rubikon!

              @ Everyone!
              UPDATE: Example script for storetext!
              Code:
              #org 0x6B09F8
              lock
              faceplayer
              checkflag 0xE000
              if 0x1 jump 0x6b0C50
              jump 0x6b0C30
              
              #org 0x6B0B00
              = Dude, where's my \v\h02?\p...
              
              #org 0x6b0C00
              = car
              
              #org 0x6b0C10
              = burrito of doom?!
              
              #org 0x6b0c30
              setflag 0xE000
              storetext 0x0 0x86b0C00 'storetext 0x0 ADDR means store ADDR into \v\h02.
                                      'likewise, storetext 0x1 ADDR means store ADDR into \v\h03.
                                      'storetext 0x50 ADDR means store ADDR into \v\h52.
                                      'Get it?
              jump 0x6b0d00
              
              #org 0x6b0c50
              clearflag 0xE000
              storetext 0x0 0x86b0c10
              jump 0x6b0d00
              
              #org 0x6b0d00
              message 0x6B0B00
              showmsg
              waitbutton
              closemsg
              release
              end
              Now just assign some guy to 0x6B09F8 in advancemap, and he says:
              * Dude, where's my car?
              and
              * Dude, where's my burrito of doom?
              in an alternating pattern.

              Edit #1 000 000 000 or something like that :D
              Use storevar to store a var as text.
              EG. If 0x800D contains 0xC, storevar 0x0 0x800D will store the text "12" into text-var \v\h02.
              __________________
              Plz not to PM me, I don't come here often enough. Email if you need me
                #9    
              Old November 29th, 2007 (10:37 PM).
              Dan13x's Avatar
              Dan13x Dan13x is offline
                 
                Join Date: Apr 2007
                Location: Brisbane, Australia
                Age: 21
                Gender: Male
                Nature: Quiet
                Posts: 75
                Quote:
                Originally Posted by D-Trogh View Post
                Yeah, l0l.. why didn't you use ScriptEd or ScriptDec then? XD
                I don't use any of them because for ScriptEd the text won't show up and for ScriptDec when I type in the offset and type N then press enter it disappears! That's why I use PKSV more.
                  #10    
                Old December 2nd, 2007 (1:48 PM).
                score_under's Avatar
                score_under score_under is offline
                I program the *other* ASM.
                • Crystal Tier
                 
                Join Date: Aug 2005
                Location: Hertfordshire, England
                Age: 24
                Nature: Rash
                Posts: 525
                Please feel free to subtly suggest things you might want to see in a future version of PKSV.
                __________________
                Plz not to PM me, I don't come here often enough. Email if you need me
                  #11    
                Old December 2nd, 2007 (6:01 PM).
                cooley's Avatar
                cooley cooley is offline
                ///Keepin' it simple
                • Silver Tier
                 
                Join Date: Feb 2007
                Location: United States
                Age: 22
                Gender: Male
                Nature: Impish
                Posts: 1,147
                Send a message via Windows Live Messenger to cooley
                I think you should make tutorials for n00bs. Some don't even know what an offset is.
                __________________

                  #12    
                Old January 18th, 2008 (5:39 AM).
                Mitchman Mitchman is offline
                Banned
                   
                  Join Date: Dec 2007
                  Location: Southern Europe
                  Age: 24
                  Gender: Male
                  Nature: Hasty
                  Posts: 7,480
                  im anoob at hacking what is an adress for a rom say like emerald
                    #13    
                  Old January 18th, 2008 (6:10 AM).
                  Teamtyranitar's Avatar
                  Teamtyranitar Teamtyranitar is offline
                  Fizz-X
                     
                    Join Date: Nov 2007
                    Location: Enjoying life
                    Age: 22
                    Gender:
                    Nature: Lax
                    Posts: 214
                    Quote:
                    Originally Posted by cooley View Post
                    I think you should make tutorials for n00bs. Some don't even know what an offset is.
                    Hey i have never had done scripting but never mind i figured it out
                    __________________
                      #14    
                    Old January 18th, 2008 (6:11 AM).
                    Mitchman Mitchman is offline
                    Banned
                       
                      Join Date: Dec 2007
                      Location: Southern Europe
                      Age: 24
                      Gender: Male
                      Nature: Hasty
                      Posts: 7,480
                      um yeah what is an offset
                        #15    
                      Old January 18th, 2008 (6:50 AM).
                      WaterSplash's Avatar
                      WaterSplash WaterSplash is offline
                      Common
                         
                        Join Date: Jan 2008
                        Location: Wherever I am, I am
                        Age: 24
                        Gender: Male
                        Nature: Serious
                        Posts: 70
                        Send a message via AIM to WaterSplash
                        I understand how to work the program, but I'm not sure how to change the scripts.

                        When I open it it comes up with a strange black box, then gives a prompt to open the ROM.
                        After that it asks for an offset. So I put it in and it comes up with the offset I asked for. But then if I hit any button it clicks out.

                        Help?
                        __________________

                        Berries Grow, Birds Fly, Sun Shines, and Brotha...I Splash People.
                          #16    
                        Old January 18th, 2008 (7:47 AM).
                        organization XIII's Avatar
                        organization XIII organization XIII is offline
                           
                          Join Date: Jan 2008
                          Location: N/A
                          Gender:
                          Nature: Calm
                          Posts: 2
                          whats an offset? can any1 explain please?
                            #17    
                          Old January 18th, 2008 (7:51 AM).
                          Swampert 22's Avatar
                          Swampert 22 Swampert 22 is offline
                          Is making tools for you...
                          • Silver Tier
                           
                          Join Date: Sep 2005
                          Location: Switzerland
                          Age: 26
                          Gender: Male
                          Nature: Brave
                          Posts: 393
                          An offset is the point in the rom where the data you want is stored. To find an offset, go into advance map and click on an event. It should then, in the address box have $XXXXXX.
                          X obviously being a number. Remember that offset, than put it into PKSV. Then it will decompile the script at that offset.
                          __________________

                          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
                            #18    
                          Old January 18th, 2008 (5:59 PM). Edited January 18th, 2008 by organization XIII.
                          organization XIII's Avatar
                          organization XIII organization XIII is offline
                             
                            Join Date: Jan 2008
                            Location: N/A
                            Gender:
                            Nature: Calm
                            Posts: 2
                            thanks, never could have guess that stuff. but there is still a problem. it is that when i type the offset, then it will say "enter hex number! (Too late now!) what is that suppose to mean?
                            __________________
                            no sig yet *_*
                              #19    
                            Old January 19th, 2008 (2:34 PM).
                            cooley's Avatar
                            cooley cooley is offline
                            ///Keepin' it simple
                            • Silver Tier
                             
                            Join Date: Feb 2007
                            Location: United States
                            Age: 22
                            Gender: Male
                            Nature: Impish
                            Posts: 1,147
                            Send a message via Windows Live Messenger to cooley
                            Hey, I was wondering how to compile scripts with this program? If it's possible.
                            __________________

                              #20    
                            Old January 19th, 2008 (3:14 PM).
                            Teamtyranitar's Avatar
                            Teamtyranitar Teamtyranitar is offline
                            Fizz-X
                               
                              Join Date: Nov 2007
                              Location: Enjoying life
                              Age: 22
                              Gender:
                              Nature: Lax
                              Posts: 214
                              Quote:
                              Originally Posted by organization XIII View Post
                              thanks, never could have guess that stuff. but there is still a problem. it is that when i type the offset, then it will say "enter hex number! (Too late now!) what is that suppose to mean?
                              Totreial ok go to advanced map then click on a event it should have an offset fill that in without th $
                              __________________
                                #21    
                              Old February 2nd, 2008 (3:45 AM). Edited July 15th, 2009 by score_under.
                              score_under's Avatar
                              score_under score_under is offline
                              I program the *other* ASM.
                              • Crystal Tier
                               
                              Join Date: Aug 2005
                              Location: Hertfordshire, England
                              Age: 24
                              Nature: Rash
                              Posts: 525
                              This post applies to an OLD version of the program only
                              Quote:
                              Hey, I was wondering how to compile scripts with this program? If it's possible.
                              Save the file as a .PKS file, right-click it, then press Compile. <- NOT USED IN PKSV 2.0 (This was used before v0.9)

                              Old version of post:
                              Spoiler:
                              Sorry for the inactivity.
                              Quote:
                              Hey, I was wondering how to compile scripts with this program? If it's possible.
                              Go to command prompt and CD to the PKSV directory, then type...
                              Code:
                              pksv -r script.txt rom.gba
                              I've just started working on it again - working on getting it to decompile slot-machine scripts. (eg. buying coins, using slots). I've been testing on ruby.
                              __________________
                              Plz not to PM me, I don't come here often enough. Email if you need me
                                #22    
                              Old February 2nd, 2008 (11:38 AM).
                              Swampert 22's Avatar
                              Swampert 22 Swampert 22 is offline
                              Is making tools for you...
                              • Silver Tier
                               
                              Join Date: Sep 2005
                              Location: Switzerland
                              Age: 26
                              Gender: Male
                              Nature: Brave
                              Posts: 393
                              Hey score-under, I had an idea that may make a useful addition to the program. Functionality to export the decompiled script to a txt file. Whadda ya think, cus sometimes, on a really long script it chops the top off. This would let you read the whole thing, and make basing new scripts on the decoded ones easier.

                              Just an idea!
                              __________________

                              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
                                #23    
                              Old February 4th, 2008 (10:39 AM). Edited August 23rd, 2008 by score_under.
                              score_under's Avatar
                              score_under score_under is offline
                              I program the *other* ASM.
                              • Crystal Tier
                               
                              Join Date: Aug 2005
                              Location: Hertfordshire, England
                              Age: 24
                              Nature: Rash
                              Posts: 525
                              This post applies to an OLD version of the program only

                              Old post:
                              Spoiler:
                              OK, but to do this at the moment, I do:
                              Code:
                              pksv ruby.gba ABCDEF > script.txt
                              Check here to see some of my compiler woes implementing the feature:
                              Spoiler:

                              EDIT:
                              Compiler blues atm :(
                              Code:
                              In file included from codeproc.h:182,
                                               from pksv.c:28:
                              decompiler.h: In function `writescr':
                              decompiler.h:50: error: syntax error before "va_list"
                              decompiler.h: In function `DecodeProc':
                              decompiler.h:73: warning: assignment from incompatible pointer type
                              Fixed with a simple replacement of va_list with va_arg (simple mistake)
                              and placing (typeof(func)) before one of the lines.
                              Now, I'm getting:
                              Code:
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s: Assembler messages:
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2681: Error: ambiguous operand size for `cmp'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2683: Error: ambiguous operand size for `dec'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2686: Error: no such instruction: `movl -16(%ebp),%edx'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2687: Error: no such instruction: `leal -16(%ebp),%eax'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2688: Error: no such instruction: `addl $4,(%eax)'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2689: Error: no such instruction: `movl (%edx),%eax'
                              C:\DOCUME~1\Charles\LOCALS~1\Temp/ccmybaaa.s:2690: Error: no such instruction: `movl %eax,-65564(%ebp)'
                              EDIT:
                              All solved with vsprintf. Good old vsprintf. Also freed about 6 bytes of memory!

                              New post:

                              Hey people! I got a new version out today.
                              It can decompile codes for the slot-machine much better now, with commands for altering and checking the coin case, and some purely semantic commands (to prevent false data being decompiled).
                              The unknown commands are prefixed with a "CMD_" both in the program AND in the decompiled code, and are useless until I find out what they actually do :D
                              @swampert22: This version can now do that!

                              EDIT:

                              Random no-confirmation trading script
                              Code:
                              setvar 0x8004 0x0 ' Their poke, slot number (still don't know the variable for trainer)
                              setvar 0x8005 0x0 ' Our poke, slot number [0-5]
                              special 0xfd
                              special 0xfe
                              waitspecial
                              __________________
                              Plz not to PM me, I don't come here often enough. Email if you need me
                                #24    
                              Old February 12th, 2008 (5:05 AM).
                              Lyzo's Avatar
                              Lyzo Lyzo is offline
                              On vacation
                                 
                                Join Date: Mar 2007
                                Location: The Netherlands
                                Age: 22
                                Gender: Male
                                Nature: Bold
                                Posts: 252
                                Send a message via Windows Live Messenger to Lyzo
                                Hey I've been trying to get the poké ball script because i still don't know how it works anyway the program worked but it says all these weird things that i don't get.

                                Here's what it says if anyone knows what it means please tell me.

                                copyvarifnotzero 0x8000 0x148
                                copyvarifnotzero 0x8001 0x1
                                callstd MSG_FIND ' PLAYER found one XXXXXX!
                                end


                                I think i understand the last 2 sentences. It plays a message just like the code message $**** and then the message. Then it ends. But i don't understand the first 2.
                                  #25    
                                Old February 14th, 2008 (3:59 AM). Edited July 15th, 2009 by score_under.
                                score_under's Avatar
                                score_under score_under is offline
                                I program the *other* ASM.
                                • Crystal Tier
                                 
                                Join Date: Aug 2005
                                Location: Hertfordshire, England
                                Age: 24
                                Nature: Rash
                                Posts: 525
                                This post applies to an OLD version of the program only

                                Hi,
                                Code:
                                copyvarifnotzero 0x8000 0x148
                                copyvarifnotzero 0x8001 0x1
                                When you find/obtain an item, the game needs to know which item and how much.
                                The number stored in 0x8000 tells it which item (0x148 = TM40 Aerial Ace)
                                The number stored in 0x8001 tells it how many (one)
                                then it calls the function to give the item (callstd MSG_FIND) and ends the script.

                                Also, be careful not to mix up message and msgbox in pksv - they mean different things.
                                Code:
                                message 0x????????  ' Gets ready to show a message (only one page, ie. cannot have \p or \l)
                                showmsg
                                waitbutton
                                closemsg
                                end
                                
                                --------------
                                
                                msgbox 0x???????? 'can have multiple pages
                                callstd MSG_NORMAL 'shows message
                                end
                                message 0x???????? is used primarily in the "berry" script, as it provides more control over when the message closes, what it does, etc.
                                msgbox 0x???????? is used for general-purpose messages.

                                How to edit scripts
                                This is a copy of a PM I sent - I hope it's useful to you.
                                Spoiler:

                                Quote:
                                I understand how to work the program, but I'm not sure how to change the scripts.

                                When I open it it comes up with a strange black box, then gives a prompt to open the ROM.
                                After that it asks for an offset. So I put it in and it comes up with the offset I asked for. But then if I hit any button it clicks out.

                                Help?
                                Sorry for being a bit ;) late, but if you're still at a loss, here's how to do it:

                                Save this as EditScript[NAME].bat (or something you can remember) EDIT: You need to put .bat on the end or it does not work!
                                Code:
                                @echo off
                                pksv ROMFILE.GBA OFFSET >edit_script
                                notepad edit_script
                                pksv -r edit_script ROMFILE.GBA
                                For example:
                                EditScript[Berry].bat
                                Code:
                                @echo off
                                pksv RubyRom.gba 1A14DD >edit_script
                                notepad edit_script
                                pksv -r edit_script RubyRom.gba
                                Then, move the EditScript[NAME].bat file into the PKSV folder (along with the ROM, if you don't know how to change BAT-files accordingly)
                                Now, double-click your .bat file and it should open notepad. Change the script in there, and as soon as you save and exit notepad, it will compile your script.

                                The 1st PKSV command chooses the ROM and offset, and decompiles it.
                                The last PKSV command chooses the ROM and script, and compiles it again.
                                ps. only 25% of people download this from pokecommunity.com - the rest come from pokecommunity.com
                                __________________
                                Plz not to PM me, I don't come here often enough. Email if you need me
                                Closed Thread
                                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

                                Forum Jump


                                All times are GMT -8. The time now is 1:27 PM.