Auto IT to Micromacro

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Auto IT to Micromacro

#1 Post by el_dios85 » Mon Oct 11, 2010 12:57 am

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

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Auto IT to Micromacro

#2 Post by el_dios85 » Mon Oct 11, 2010 3:43 am

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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Auto IT to Micromacro

#3 Post by Administrator » Mon Oct 11, 2010 12:11 pm

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

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Auto IT to Micromacro

#4 Post by el_dios85 » Mon Oct 11, 2010 7:36 pm

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);

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Auto IT to Micromacro

#5 Post by Administrator » Tue Oct 12, 2010 12:15 am

Specifically, which line is generating that warning?

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Auto IT to Micromacro

#6 Post by el_dios85 » Tue Oct 12, 2010 8:16 am

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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Auto IT to Micromacro

#7 Post by Administrator » Tue Oct 12, 2010 2:09 pm

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.

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Auto IT to Micromacro

#8 Post by el_dios85 » Mon Oct 18, 2010 9:30 am

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests