Page 1 of 1

[HELP/QUESTION] Recursive address increment in AA possible?

Posted: Sun Nov 14, 2021 6:33 am
by mlengka93
So, here is my Starting script to get Base Pointer
Spoiler

Code: Select all

[ENABLE]
aobscan(memorystart,D0 FF BD 27 21 68 A0 00 03 00 A3 30 01 00 05 24)
label(memoryS)
registersymbol(memoryS)
memorystart:
memoryS:
[DISABLE]
unregistersymbol(memoryS)
Is it possible to add another script to edit multiple address (recursive) in AA? something like this

Code: Select all

newmem:
cmp [counter],#23
jle code
jmp return

code:
cmp [counter],#23
jg return
add [recursive],4 //add 4 each write
mov [memoryS+recursive],#99
add [counter],#1
jle newmem
jmp return

counter:
dd 1
return:
and is it possible to grab memoryS address from first script to other?

Re: [HELP/QUESTION] Recursive address increment in AA possible?

Posted: Fri Nov 19, 2021 7:53 pm
by TheByteSize
Yes, you can. When you register a Symbol, it become a Global variable that you can access from any other scripts as long as it's initialized aka registered. Here is example.

Code: Select all

label(initialize)
label(loop)
label(exit)

initialize:
	push eax
	push ebx
	xor eax,eax
	xor ebx,ebx
	mov eax, [memoryS]
	
loop:
	mov [eax+ebx*4],#99
	inc ebx
	cmp ebx,#23
	jl loop
	
exit:
	pop ebx
	pop eax

Re: [HELP/QUESTION] Recursive address increment in AA possible?

Posted: Fri Nov 19, 2021 9:17 pm
by GreenHouse
You're better off by pushing registers for counters and all of that. Pointers are a bad idea and will make it more complicated to write.