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

8F ASM: turn AF into a deadly weapon depending on play time counter (min+sec) - Page 1

8F ASM: turn AF into a deadly weapon depending on play time counter (min+sec)

Posted by: Spoink
Date: 2014-10-12 14:44:08
I was playing with… Pokeémon stuff… And I came up with an ASM that kills the game depending on how much playing time logged on the counter

The Item list/ hexadecimal
TM50 x69 (FA 45)
TM18 x234 (DA EA)
TM39 x192 (EF C0)
TM50 x70 (FA 46)
TM18 x234 (DA EA)
TM40 x192 (F0 C0)
TM01 x*** (C9 **)

The resulting ASM

ld a,($DA45)
ld ($C0EF),a
ld a,($DA46)
ld ($C0F0),a

If you have any questions, comments, or other ASMs related to this, leave a reply.

Re: 8F ASM: turn AF into a deadly weapon depending on play time counter (min+sec)

Posted by: Torchickens
Date: 2014-10-12 16:03:25
That looks cool. DA46 isn't a play-time byte, so you'll probably want to change DA44 and DA45.

This would probably be more chaotic if you made this code a custom map script (make D36E-D36F jump to stored items #2 @D53D, i.e. put Soda Pop x213 in position 41, and then put your code in the PC items starting from item 2.

That should make the game keep altering C0EF and C0F0 out of the menu many times, as if you used 8F multiple times quickly. See my video.

Instead of play time, you can use D-sum addresses FFD3/FFD4 for more randomness.

Re: 8F ASM: turn AF into a deadly weapon depending on play time counter (min+sec)

Posted by: Stackout
Date: 2014-10-12 21:06:04
I got confused for a little bit then. Mainly due to the written asm having the two operands the wrong way around.

I'm guessing what you actually meant was this:

ld a,($DA45)
ld ($C0EF),a
la a,($DA46)
ld ($C0F0),a

Re: 8F ASM: turn AF into a deadly weapon depending on play time counter (min+sec)

Posted by: Spoink
Date: 2014-10-17 22:08:23

I got confused for a little bit then. Mainly due to the written asm having the two operands the wrong way around.

I'm guessing what you actually meant was this:

ld a,($DA45)
ld ($C0EF),a
la a,($DA46)
ld ($C0F0),a



Oh sorry I am bad at ASM I took from memory.