Page 1 of 1
Auto IT to Micromacro
Posted: Mon Oct 11, 2010 12:57 am
by el_dios85
I want to translate auto it script to micromacro
In Auto IT:
Local $TAR_TEMP = memread(memread(memread($staticbase_ptr) + 0x20) + 0x38c)
Local $POINTER = memread(memread(memread(memread($staticbase_ptr) + 0x8) + 0x24) + 0x18)
For $I=0 To 768
Local $CUR_BASE = memread(memread($POINTER + $I*0x4) + 0x4)
If $TAR = memread($cur_base + 0x11C) Then
$TAR_BASE = $CURBASE;
ExitLoop
EndIf
Next
$TARMAXHP = memread($TAR_BASE+ $OFFSET_TARMAXHP)
I try to coding it in micromacro
tartempptr_addr = memoryReadInt(proc, staticbase_ptr) + 0x20 + 0x38c;
pointer = memoryReadInt(proc, staticbase_ptr) + 0x8 + 0x24 + 0x18;
for i = 0, 768 do
curbase = memoryReadInt(proc, pointer) + i*0x4 + 0x4;
if (tar == memoryReadInt(proc, curbase) + 0x11C) then
tarbase = curbase;
coroutine.yield();
end
end
MaxHPtar = memoryReadIntPtr(proc, tarbase, MaxHPtar_offset);
Error: memoryReadIntPtr ((null)) on line "MaxHPtar = memoryReadIntPtr(proc, tarbase, MaxHPtar_offset);"
Is there something wrong with my translation?
Thanks
Re: Auto IT to Micromacro
Posted: Mon Oct 11, 2010 3:43 am
by el_dios85
I got some clue.
pointer = memoryReadInt(proc, staticbase_ptr) + 0x8 + 0x24 + 0x18;
become
pointer_offset = {0x8, 0x24, 0x18};
pointer = memoryReadIntPtr(proc, staticbase_ptr, pointer_offset);
Now the problem is
1. Local $CUR_BASE = memread(memread($POINTER + $I*0x4) + 0x4)
2. If $TAR = memread($cur_base + 0x11C) Then
Thanks.
Re: Auto IT to Micromacro
Posted: Mon Oct 11, 2010 12:11 pm
by Administrator
el_dios85 wrote:
1. Local $CUR_BASE = memread(memread($POINTER + $I*0x4) + 0x4)
Code: Select all
local CUR_BASE = memoryReadInt(proc, memoryReadInt(proc, POINTER + I * 0x4) + 0x4);
2. If $TAR = memread($cur_base + 0x11C) Then
Code: Select all
TAR = memoryReadInt(proc, CUR_BASE + 0x11C);
if( TAR ~= 0 ) then
Re: Auto IT to Micromacro
Posted: Mon Oct 11, 2010 7:36 pm
by el_dios85
Thanks...
"WARNING: Failure reading memory from 0x1DFDC0 at 0x4 in memoryReadInt(). Error code 299 (Only part of a ReadProcessMemory or WriteProcessMemory request was completed.)"
This error always occured. I'm confuse. What should I check?
actually I want to recode auto it script to micromacro.
Code: Select all
Func GetSelected()
If Not $PROCESS_ID Then Return 0
Local $TAR_TEMP = memread(memread(memread($APP_BASE_ADDRESS) + 0x20) + $OFFSET_AT)
Local $TARID_TEMP = memread(memread(memread($APP_BASE_ADDRESS) + 0x20) + $OFFSET_AT)
If $TAR_TEMP = 0 Then
$TAR = 0
$TAR_BASE = 0
ElseIf $TAR_TEMP <> $TAR Then
$TAR = $TAR_TEMP
Local $POINTER = memread(memread(memread(memread($APP_BASE_ADDRESS) + 0x8) + 0x24) + 0x18)
For $I=0 To 768
Local $CUR_BASE = memread(memread($POINTER + $I*0x4) + 0x4)
If $TAR = memread($cur_base + 0x11C) Then
$TAR_BASE = $CUR_BASE
$TARID = $TAR_TEMP
ExitLoop
EndIf
Next
EndIf
EndFunc
This is the result:
Code: Select all
tartempptr_addr = memoryReadUIntPtr(proc, charptr_addr, targetid_offset);
printf("tartempptr_addr [%x].\n", tartempptr_addr);
taridtempptr_addr = memoryReadUIntPtr(proc, charptr_addr, targetid_offset);
printf("taridtempptr_addr [%x].\n", taridtempptr_addr);
if(tartemptptr_addr == 0) then
tarptr_addr = 0;
tarbaseptr_addr = 0;
elseif(tartempptr_addr ~= tarptr_addr) then
tarptr_addr = tartempptr_addr;
pointer_offset = {0x8, 0x24, 0x18};
local pointer = memoryReadIntPtr(proc, staticbase_ptr, pointer_offset);
printf("pointer [%x].\n", pointer);
for i = 1, 768 do
local curbaseptr_addr = memoryReadInt(proc, memoryReadInt(proc, pointer + i * 4) + 0x4);
printf("curbaseptr_addr [%x].\n", curbaseptr_addr);
tarptr_addr = memoryReadInt(proc, curbaseptr_addr + 0x11C);
if( tarptr_addr ~= 0 ) then
tarbaseptr_addr = curbaseptr_addr;
taridptr_addr = tartempptr_addr;
coroutine.yield();
end
end
end
HPtar = memoryReadIntPtr(proc, tarbaseptr_addr, TarHP_offset);
MaxHPtar = memoryReadIntPtr(proc, tarbaseptr_addr, TarMaxHP_offset);
Re: Auto IT to Micromacro
Posted: Tue Oct 12, 2010 12:15 am
by Administrator
Specifically, which line is generating that warning?
Re: Auto IT to Micromacro
Posted: Tue Oct 12, 2010 8:16 am
by el_dios85
Code: Select all
local curbaseptr_addr = memoryReadInt(proc, memoryReadInt(proc, pointer + i * 4) + 0x4);
After the looping, that's the line that generate the warning.
Re: Auto IT to Micromacro
Posted: Tue Oct 12, 2010 2:09 pm
by Administrator
First, split it into two lines like so:
Code: Select all
local tmp = memoryReadInt(proc, pointer + i * 4);
local curbaseptr_addr = memoryReadInt(proc, tmp + 0x4);
That way we know specifically which call to memoryReadInt is failing.
Re: Auto IT to Micromacro
Posted: Mon Oct 18, 2010 9:30 am
by el_dios85
I'm sorry Admin, it didn't work. I try many ways and it get warning...
is there any problem with the memread function (Auto IT)
Func memread($adress, $type = 'dword')
Local $struct = DllStructCreate($type)
DllCall($kernel32, 'int', 'ReadProcessMemory', 'int', $mid, 'int', $adress, 'ptr', DllStructGetPtr($struct), 'int', DllStructGetSize($struct), 'int', '')
Return DllStructGetData($struct, 1)
EndFunc
The Auto IT Script is from
http://www.elitepvpers.de/forum/pw-hack ... coded.html
Thanks...