well you should learn something about debugging and asm first.
using code injections to build up codecaves will make ur life a lot easier. tracing back dynamic stuff is just a waste of time.
you could simply step in the last pointer and get the adress directly with codecaves.
well you should learn something about debugging and asm first.
using code injections to build up codecaves will make ur life a lot easier. tracing back dynamic stuff is just a waste of time.
you could simply step in the last pointer and get the adress directly with codecaves.
heya lolkop, I've been reading your posts here and there and find lots of useful infos. Thanks a lot
hope you could post example in autoit codes on how to auto target mob that can be attacked using normal attack (for an Archer or other physical class)
now that we know how the client builds up the list of all npcs, we can do the same in our tool.
we could even let the script show us the offsets we need.
if we set a breakpoint on the variable line, we'll get the range we have to make $x loop through (should be 0-768 normaly). (loops should allways be done with "for ... next" in autoit)
well now that we've got a list of all npc_bases, we will have to figure out some offsets for that base. guess type, id, position, name, level and maybe some more would be helpfull for filtering/selecting the mobs.
now that u've got a list of all available mobs and special infos, you could calculate the distance between player and mobs, and selected the closest one. (you can even filter them, by name or filter out mag resistant (for wizzards) mobs or whatever you like to do with those infos =))
if you need a basic list of special info types i've found so far, you could check my open source
well the most important part is still missing. now i've got those mob ids, but how can i use them to select the mob?
to do that i've used the selection function from the client.
thats the code in the PWI client. may be a little diferent in your client, but i've allready posted a tool above which gets the base and select_call adress.
to use it we will simply allocate some memory in the element client, for our tool, add the select function to it and run it. after that we'll delete the code from the client, to make some space for more functions we could use. (we could also leave the select function in the client, so we wouldn't have to rebuild it all the time, but it would be harder to handle multiclients that way)
so here's the function i'm using:
Code:
Func SelectMob($id)
Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode
; --- save the position of the allocated memory ---
$pRemoteMem = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $mid, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
; --- build up the asm code ---
; 0046061D A1 6C3E9F00 MOV EAX,DWORD PTR DS:[9F3E6C]
; 00460622 57 PUSH EDI <---- EDI Contains Mob-ID
; 00460623 8B48 20 MOV ECX,DWORD PTR DS:[EAX+20]
; 00460626 81C1 EC000000 ADD ECX,0EC
; 0046062C E8 8F961800 CALL elementc.005E9CC0
$OPcode &= '60' ; pushad
$OPcode &= 'A1'&_hex($base) ; mov eax, [base]
$OPcode &= '68'&_hex($id) ; push mob-id
$OPcode &= '8B4820' ; mov ecx, [eax+0x20]
$OPcode &= '81C1'&_hex(0xEC) ; add ecx, 0xEC
$OPcode &= 'E8'&_hex($select_call-$pRemoteMem[0]-5-StringLen($OPcode)/2) ; call select_call
$OPcode &= '61' ; popad
$OPcode &= 'C3' ; retn
; --- enter the asm code to to a dllstruct, which can be used with WriteProcessMemory ---
$vBuffer = DllStructCreate('byte[' & StringLen($OPcode) / 2 & ']')
For $loop = 1 To DllStructGetSize($vBuffer)
DllStructSetData($vBuffer, 1, Dec(StringMid($OPcode, ($loop - 1) * 2 + 1, 2)), $loop)
Next
; --- now letz write the code from our dllstruct ---
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $mid, 'int', $pRemoteMem[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
; --- now we run the asm code we've just written ---
$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $mid, 'int', 0, 'int', 0, 'int', $pRemoteMem[0], 'ptr', 0, 'int', 0, 'int', 0)
; --- wait till the thread did his job ---
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
; --- close everything we've opened ---
DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
DllCall($kernel32, 'ptr', 'VirtualFreeEx', 'hwnd', $mid, 'int', $pRemoteMem[0], 'int', 0, 'int', 0x8000)
Return True
EndFunc
now that we're able to list, filter and select mobs, we need to kill the selected mobs.
to do that, we can use simple keypressing, or find the skill function in the client.
thank you very much for sharing, lolkop. I'm still new at programming though and might get stuck later when doing it (I usually do
), please don't get bored if I ask further about it later
-edit-
I just tried your stats.au3, but it didn't show the correct char infos for PW Indo.
Do I need to change all offsets in stats.au3 to match those for PW Indo, or can I just change $base and $exp_base and the rests will automatically follow ?
and get this in return, MobBase = ClientBase + 0x1C + 0x08 + 0x24 + 0x18 + x*4 + 0x04
so I guess the pointers for mobs are the same for PWI and Indo, I'm still new in autoit and I rly need a working source code to begin with, because the last targetting method was so simple by just passing mob id to target offset, which doesn't work anymore.
here is the full code I ran, I just want to simply try the selectmob function to select a given char ID, hoping that my char will then properly target that specified npc id. It's basically only contains your SelectMob and MemOpen function, and run selectmob to make my char target another char with this ID -> 0x18AE50. I also have adjusted the value for $base, $select_call and $pick_call to the correct values for my client version.
Code:
Func SelectMob($id)
Local $pRemoteThread, $vBuffer, $loop, $result, $OPcode
; --- save the position of the allocated memory ---
$pRemoteMem = DllCall($kernel32, 'int', 'VirtualAllocEx', 'int', $mid, 'ptr', 0, 'int', 0x46, 'int', 0x1000, 'int', 0x40)
; --- build up the asm code ---
; 0046061D A1 6C3E9F00 MOV EAX,DWORD PTR DS:[9F3E6C]
; 00460622 57 PUSH EDI <---- EDI Contains Mob-ID
; 00460623 8B48 20 MOV ECX,DWORD PTR DS:[EAX+20]
; 00460626 81C1 EC000000 ADD ECX,0EC
; 0046062C E8 8F961800 CALL elementc.005E9CC0
$OPcode &= '60' ; pushad
$OPcode &= 'A1'&_hex($base) ; mov eax, [base]
$OPcode &= '68'&_hex($id) ; push mob-id
$OPcode &= '8B4820' ; mov ecx, [eax+0x20]
$OPcode &= '81C1'&_hex(0xEC) ; add ecx, 0xEC
$OPcode &= 'E8'&_hex($select_call-$pRemoteMem[0]-5-StringLen($OPcode)/2) ; call select_call
$OPcode &= '61' ; popad
$OPcode &= 'C3' ; retn
; --- enter the asm code to to a dllstruct, which can be used with WriteProcessMemory ---
$vBuffer = DllStructCreate('byte[' & StringLen($OPcode) / 2 & ']')
For $loop = 1 To DllStructGetSize($vBuffer)
DllStructSetData($vBuffer, 1, Dec(StringMid($OPcode, ($loop - 1) * 2 + 1, 2)), $loop)
Next
; --- now letz write the code from our dllstruct ---
DllCall($kernel32, 'int', 'WriteProcessMemory', 'int', $mid, 'int', $pRemoteMem[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
; --- now we run the asm code we've just written ---
$hRemoteThread = DllCall($kernel32, 'int', 'CreateRemoteThread', 'int', $mid, 'int', 0, 'int', 0, 'int', $pRemoteMem[0], 'ptr', 0, 'int', 0, 'int', 0)
; --- wait till the thread did his job ---
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
; --- close everything we've opened ---
DllCall($kernel32, 'int', 'CloseHandle', 'int', $hRemoteThread[0])
DllCall($kernel32, 'ptr', 'VirtualFreeEx', 'hwnd', $mid, 'int', $pRemoteMem[0], 'int', 0, 'int', 0x8000)
Return True
EndFunc
Func memopen($pid)
Local $mid = DllCall($kernel32, 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $pid)
Return $mid[0]
EndFunc
#include <array.au3>
Global $kernel32 = DllOpen('kernel32.dll')
Global Const $base = 0x98ADDC, $select_call = 0x5B7B70, $pick_call = 0x5B7B00
Global $pid = ProcessExists('elementclient.exe')
Global $mid = memopen($pid)
$id= 0x18AE50
SelectMob($id)
[TUT] Vacking w/o loosing mobs + mobs speed hack [WINHEX] 01/25/2011 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 208 Replies You will need Win Hex to edit thouse numbers.
I used Styx as the mob to edit.
PART OF VACK + SPPED HACK FOR MOBS.
Original:
2251,Styx,1,19,82,35749,0,486,695,10,50,2,6,0,0,0 ,0,0,0,55,0,0,0,02.5,4.8,1,1,styx,ÀÛ¼ºÁß,0,0,0,526 0,441,595,30800,1,1,3,90,90
[FRAGE] Mobs in einer Map platzieren ohne Mobs? 04/05/2010 - Metin2 Private Server - 2 Replies Hey, ich möchte Mobs in der Map platzieren wo man hinkommt wenn man "/go gmmap" eingibt...
Aber ich weiß nicht wie... Gibt es ein Tutorial dafür`?
[SUCHE]Einen Client mit den 13 neuen Mobs und Zombie Mobs 03/13/2010 - Metin2 Private Server - 23 Replies Also Leute,
ich suche jemanden der so nett ist und mir
einen Client zu verfügung stellt bzw. macht auf dem
die neuen Mobs sichtbar sind .
THX
Show hp in players and mobs 10/12/2005 - Lineage 2 - 0 Replies any one have a patch for show hp ,mp lvl, in mobs and players pls post where....
ty :ops: