Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Arbitrary Code Execution Discussion

Making sense of the arbitrary code execution glitch - Page 1

Making sense of the arbitrary code execution glitch

Posted by: iamnguyen
Date: 2016-07-16 17:53:23
Hi, I am new to glitches. I have read several posts but still have a hard time understanding this glitch. Any help is much appreciated.

On one of the posts, it is stated that I can use Gameshark code with this method.

The following item list will work the same way a game-altering device does.

8F

Any item x Any qty

X Accuracy x(b2)

Carbon x(b3)

Max Revive x(b1)

Poké Ball x201

To obtain the 201 Poké Balls stack, have Poké Balls x73 in the sixth item pack slot, then encounter / capture MissingNo or 'M. It will be a stack of 201 Poké Balls. It is also possible to use the Non-key items duplication code.

This code aims to write code like the Gameshark code "01(b1)(b2)(b3)".

For example, the code 010138CD, which allows to walk through walls, can be transcripted into the following :

X Accuracy x(b2)

Carbon x(b3)

Max Revive x(b1)

Poké Ball x201


I notice that many Gameshark codes contain letters. How can I make an item list to accommodate that? Please help. Thank you very much in advance.

Re: Making sense of the arbitrary code execution glitch

Posted by: ISSOtm
Date: 2016-07-16 18:08:05
The gameshark codes are written in hexadecimal forms, and what you are looking for is a decimal form.
I could tell you :
* either you learn what hexadecimal is, and I could recommend you the introduction of [http://glitchcity.info/wiki/index.php/GB_Programming#A_new_world this wiki article]. The rest of it, even though it is a WIP, can help you understand ACE a bit.
* or, you can just be lazy and use a [http://www.binaryhexconverter.com/hex-to-decimal-converter converter]. Do your choice !

Re: Making sense of the arbitrary code execution glitch

Posted by: iamnguyen
Date: 2016-07-16 18:14:16
Thank you so so much!!! There's a page on how to program the whole thing?!

Re: Making sense of the arbitrary code execution glitch

Posted by: Krys3000
Date: 2016-07-17 03:44:11
I explain shortly here how to go from a memory address to a gameshark code then to an 8F inventory: http://forums.glitchcity.info/index.php/topic,6638.msg199419.html#msg199419

The RAM Map I refer to is this one, and the big list is this one.

Oh, and don't hesitate to use windows' calculator for translations, too.

Re: Making sense of the arbitrary code execution glitch

Posted by: iamnguyen
Date: 2016-07-18 13:46:25
Thank you so much!!! I was about to make a post asking how all three are related. I would like ask if the GS codes are multi lines, can I execute each line with 8F separately? Can I combine all lines in an item list?

Re: Making sense of the arbitrary code execution glitch

Posted by: Krys3000
Date: 2016-07-18 14:30:39
You can execute each code separately. But you could also create an 8F code which will execute all of them at the same time. This might be a little tricky if you're not used with opcodes yet, but don't hesitate to ask here for help.

Re: Making sense of the arbitrary code execution glitch

Posted by: iamnguyen
Date: 2016-07-18 19:55:54
I notice that your profile picture is a Lugia. Did you add it to a generation 1 game through a glitch? I went through the RAM map but I could not find any byte I can manipulate to add a new Pokemon to the Pokedex.

Re: Making sense of the arbitrary code execution glitch

Posted by: ISSOtm
Date: 2016-07-18 20:03:21
Nah, it's just a montage :P

Re: Making sense of the arbitrary code execution glitch

Posted by: iamnguyen
Date: 2016-07-18 20:16:26
That was my guess. The Pokemon data must be stored in ROM and cannot be modified. But then again, nothing is impossible. I wonder if anyone has found anything to manipulate ROM…

Re: Making sense of the arbitrary code execution glitch

Posted by: Krys3000
Date: 2016-07-19 01:00:30
It's not a 'montage' actually. I implanted Lugia's sprite in my 1G game using VBA's memory editor :)

Re: Making sense of the arbitrary code execution glitch

Posted by: ISSOtm
Date: 2016-07-19 06:06:57
Did you paste data into VRAM, or did you actually edit the sprite in the ROM ?

Re: Making sense of the arbitrary code execution glitch

Posted by: Krys3000
Date: 2016-07-19 06:25:31
Nah, I just created a dmp file with the RAM values from $8FF0 onwards (current sprite of a stat page) on a 2G game and loaded it into a 1G game. It was just to take a nice screenshot :p

Re: Making sense of the arbitrary code execution glitch

Posted by: ISSOtm
Date: 2016-07-19 06:51:22
So, you just edited VRAM.

Re: Making sense of the arbitrary code execution glitch

Posted by: Krys3000
Date: 2016-07-19 10:01:01
Yep!