Thread: [Tutorial] HackMew's Knowledge
View Single Post
  #25    
Old February 17th, 2009 (06:48 AM). Edited February 21st, 2009 by hi sir tomato my password is syvniti.
hi sir tomato my password is syvniti's Avatar
hi sir tomato my password is syvniti hi sir tomato my password is syvniti is offline
gggggggggggggggggg
 
Join Date: Jan 2007
Location: My user name _ asciii_ +&h1!" lulz
Posts: 581
Wow, This is propperly the tutorial I like most here at pc, You did an awesome job.

I'm really Excited about the next tutorial. I spended nearly about an hours but it was all the time worth. Now I realeized that ASM isn't a big green garlic junior'ish monster living under my bed...


Is that ok?


SPOILER - Do not open this if you plan on reading the tutorial or are currently doing it. Please don't.
Spoiler:
First I wanted to just copy the intire 4 byte long word with both the id and the secret one, But the compiler wouldn't let me do that since the offset had to be a multiplication of &h4, I couldn't do that (But if there is a solution where I could do some thing like that please tell me.)
So then I decided to both parts seperatly, But since the ID was stored in the last two bytes of a word and I didn't know how to only get the last part of the word, I copyed the intiere word to to variables (&h800A and &h800B) Which emptys the 800A with zeros.
To get the secret ID I allmost did excatly like you did, except I changed the offset a bit.
The thing I spended most time on was finding the location of the vars, I just thought they were in order (like 800B, 800C, 800D) and not storred in that random way.
Here's my code.
Code:
.text
.align 2
.thumb
.thumb_func
.global lesson1

main:
	push {r0-r1, lr}
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldr r1, .VAR
	ldr r0, [r0, #0x8]
	str r0, [r1]
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldrh r0, [r0, #0xC]
	strh r0, [r1, #0x4]	
	pop {r0-r1, pc}

.align 2
.PLAYER_DATA:
	.word 0x0300500C
.VAR:
	.word 0x020370CC
Is it aproved? (I mean, I filled the 0x800A with zeros.)
If I was aloud to use other registers I would propperly just have saved the data location offset, and save a bit space / time there.

Edit: I just tryed fixing my routine, and first I just used the var 800A instead of 800D for the secret ID since I had to use to vars for the normal one at first anyway...
Next I tryed using the third register instead of emptying the first one and reload the first offet again.
Code:
	push {r0-r1-r2, lr}
	ldr r0, .Var1
	ldr r0, [r0]
	ldr r1, .Var2
	ldr r2, [r0, #0x8]
	str r2, [r1]
	ldrh r0, [r0, #0xC]
	strh r0, [r1]	
	pop {r0-r1-r2, pc}
Was it a good idea to use the register 2?

SPOILER - Do not open this if you plan on reading the tutorial or are currently doing it. Please don't.

Last I would like too tell I'm really really happy for this tutorial, and you're doing a great job. It's really well written and I'm looking forward to part two!
EDIT INSIDE THE SPOILER!
__________________
THE CAKE IS A LIE!!!!!!!!!!!!!!!!!!!!!!!
Reply With Quote