Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 3:53 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: ASM loop/goto problem
PostPosted: Sat Jul 18, 2009 3:04 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
Hi i've got a problem with asm, when I want to code a code with an loop in it, the game crashes. Here is an exemple:
Code:
ldr r0,=0x00000043
ldr r1,=0x00000F30
loop:
ldr r2,=0x020DB45D
str r2,[r2]
mla r3,r2,r1,r0
cmp r3,r1
bne loop                 ;if r3 is not equal to r1, go to loop
bx r14


But when I try a code like this, the game freezes. Any suggestions?

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 18, 2009 1:15 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Your code basically looks like this, written in C:
Code:
do {
    *(u32*)0x020DB45D = 0x020DB45D;
} while (0x302344B3 != 0x00000F30);
return;


Maybe that helps to see what causes the infinite loop. But, I really don't understand the misaligned write...

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 20, 2009 2:47 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
hmm I could try your code, is there existing a compiler to compile c in ards?

P.S.: is it possible to load an 8-bit/16-bit address in asm?

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 20, 2009 7:41 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
You don't want to compile the code I posted; it is functionally equivalent to what you posted, thus is would still hang. The reason I posted it at all was to illustrate the problem in a higher level language. The loop checks for the condition that the number 0x302344B3 is not equal to the number 0x00000F30. This condition is always true. Therefore, the loop will never end.

To answer your second question: yes.
Code:
ldrb: Load byte (8-bit)
ldrh: Load halfword (16-bit)
ldr:  Load word (32-bit)


I take it you haven't done any programming before?

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 21, 2009 3:40 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
Thats what I want, i want a infinite loop but maybe this is the reason why the game crashes.
I did qbasic, basic, visual basic, some c, html and now asm.
But im only 14 years old so im not so experienced.
thanks a lot!

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 21, 2009 5:34 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
An "infinite loop" is a crash: http://en.wikipedia.org/wiki/Infinite_loop

Besides, if that's all you wanted, it's actually a lot more simple:
Code:
loop:
b    loop

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2009 8:50 am 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:46 pm
Posts: 2331
Location: *poof*
Title: The Mad Hacker
I just lol'd

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 22, 2009 1:49 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
why?

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 23, 2009 9:30 am 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
Because it will be stuck in your loop forever and never get to the actual game code.

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 23, 2009 4:40 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Maybe it would be better trying to explain the specific goal you are after, instead of "putting the game into an infinite loop without crashing it ..." Because that's totally nonsensical.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 24, 2009 1:32 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
I'm trying to make an autokill code for metroid prime hunters eu 1.1
I have all addresses but when I try to use the autokill code the game crashes.

Code:
ldr r0,=0x020da6c7
ldr r0,[r0]
ldr r1,=0x00000000
PLAYER1:
cmp r1,r0
beq PLAYER2
ldr r3,=0x020db27e
ldr r3,[r3]
cmp r3,r1
beq PLAYER2
LOOP1:
ldr r3,offset
ldr r4,playerx
mla r2,r0,r3,r4
ldr r2,[r2]
ldr r4,playery
ldr r5,offset
mla r3,r0,r5,r4
ldr r3,[r3]
ldr r6,playerz
mla r4,r0,r5,r6
ldr r4,[r4]
ldr r5,=0x020DB7e0
ldr r6,=0x020DB7e4
ldr r7,=0x020DB7e8
str r2,[r5]
str r3,[r6]
str r4,[r7]
ldr r3,=0x020db27e
ldr r3,[r3]
cmp r3,r1
beq PLAYER2
bne LOOP1
PLAYER2:
cmp r0,#0x00000001
beq PLAYER3
ldr r3,=0x020DC1AE
ldr r3,[r3]
cmp r3,r1
beq PLAYER3
LOOP2:
ldr r3,offset
ldr r4,playerx
mla r2,r0,r3,r4
ldr r2,[r2]
ldr r4,playery
ldr r5,offset
mla r3,r0,r5,r4
ldr r3,[r3]
ldr r6,playerz
mla r4,r0,r5,r6
ldr r4,[r4]
ldr r5,=0x020DB7e0
ldr r6,=0x020DB7e4
ldr r7,=0x020DB7e8
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
str r2,[r5]
str r3,[r6]
str r4,[r7]
ldr r3,=0x020DC1AE
ldr r3,[r3]
cmp r3,r1
beq PLAYER3
bne LOOP2
PLAYER3:
cmp r0,#0x00000002
beq PLAYER4
ldr r3,=0x020DD0DE
ldr r3,[r3]
cmp r3,r1
beq PLAYER4
LOOP3:
ldr r3,offset
ldr r4,playerx
mla r2,r0,r3,r4
ldr r2,[r2]
ldr r4,playery
ldr r5,offset
mla r3,r0,r5,r4
ldr r3,[r3]
ldr r6,playerz
mla r4,r0,r5,r6
ldr r4,[r4]
ldr r5,=0x020DB7e0
ldr r6,=0x020DB7e4
ldr r7,=0x020DB7e8
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
str r2,[r5]
str r3,[r6]
str r4,[r7]
ldr r3,=0x020DD0DE
ldr r3,[r3]
cmp r3,r1
beq PLAYER4
bne LOOP3
PLAYER4:
cmp r0,#0x00000003
beq PLAYER1
ldr r3,=0x020DE00E
ldr r3,[r3]
cmp r3,r1
beq PLAYER1
LOOP4:
ldr r3,offset
ldr r4,playerx
mla r2,r0,r3,r4
ldr r2,[r2]
ldr r4,playery
ldr r5,offset
mla r3,r0,r5,r4
ldr r3,[r3]
ldr r6,playerz
mla r4,r0,r5,r6
ldr r4,[r4]
ldr r5,=0x020DB7e0
ldr r6,=0x020DB7e4
ldr r7,=0x020DB7e8
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
add r5,r5,#0x00000f30
add r6,r6,#0x00000f30
add r7,r7,#0x00000f30
str r2,[r5]
str r3,[r6]
str r4,[r7]
ldr r3,=0x020DE00E
ldr r3,[r3]
cmp r3,r1
beq PLAYER1
bne LOOP4
bx r14
offset:
.word 0x00000F30
playerx:
.word 0x020DB7e0
playery:
.word 0x020DB7e4
playerz:
.word 0x020DB7e8


In this code I didn't take the right addresses cause I don't whant some noobs to cheat in the wi-fi.

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 24, 2009 3:34 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
n00bz, cheating on wifi? oh noes, the sky! It's falling!!!

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 24, 2009 9:06 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
Just to be an ass, I'd like to point out that arm-eabi-as accepts

Code:
b $

And would yield the same thing as

Code:
loop:
b loop

The $ operator is pretty damn nice.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2009 1:23 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Thu Jul 16, 2009 5:26 am
Posts: 24
Location: Berlin
Title: Cheater (not online)
I don't understand what you mean Zeld, sorry

_________________
Cheating, Hacking, Deviluc!
http://freenet-homepage.de/mphar/
http://deviluc.de.funpic.de


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 150 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group