Global $GAME_TITLE = "Perfect World"
Global $GAME_PID = WinGetProcess($GAME_TITLE)
Global $GAME_PROCESS = _MemoryOpen($GAME_PID)
Global $ADDRESS_BASE = 0xD22C74
Global $ADDRESS_SENDPACKET = 0x782FD0
Global $ADDRESS_AUTOPATH = 0x455940
Global $ADDRESS_ACTION1 = 0x49FF80
Global $ADDRESS_ACTION2 = 0x4A6320
Global $ADDRESS_ACTION3 = 0x4A0590
Global $ADDRESS_GATHER = 0x495C40
Global $ADDRESS_CASTSKILL = 0x48DF40
Func InjectCode($OPcode)
;Declare local variables
;Open process for given processId
$processHandle = $GAME_PROCESS[1]
;Allocate memory for the OpCode and retrieve address for this
$functionAddress = DllCall('kernel32.dll', 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', 100, 'int', 0x1000, 'int', 0x40)
;Construct the OpCode for calling the function
;Put the OpCode into a struct for later memory writing
$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
;Write the OpCode to previously allocated memory
DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Create a remote thread in order to run the OpCode
$hRemoteThread = DllCall('kernel32.dll', 'int', 'CreateRemoteThread', 'int', $processHandle, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
;Wait for the remote thread to finish
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
;Close the handle to the previously created remote thread
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $hRemoteThread[0])
;Free the previously allocated memory
DllCall('kernel32.dll', 'ptr', 'VirtualFreeEx', 'hwnd', $processHandle, 'int', $functionAddress[0], 'int', 0, 'int', 0x8000)
Return True
EndFunc
Wow awesome snippets, I hope you guys still around when Eclipse hits PWIndo.
Looking at all those, I bet everything's changed now huh with this Eclipse patch, Wanmei wasn't joking about the engine overhaul then ? The gfx still looks pretty much the same though.
Is it gonna be that way now, using opcodes not memorywrite anymore ? or it's just easier that way. If using memorywrite like the old actionstruct, we can check the values within the structure to see if the character is idle or done doing something. For example if using GatherItem($ITEM_UNIQUE_ID, $ACTION_TYPE=0) , the character will move to the item and dig it, but what can we use for 'waiting' the action to complete ?
there is simple way to check if u perform an action like digging or moveing or attacking. the checkAction turns to 1 if u perform any action and is 0 if not.
Please take note of the ActionFlag on Interact+Action
As for your checkAction or ActionFlag, just want to inform you these:
When using GatherItem function and your character is far from the resource,
1. The CheckAction/ActionFlag value will be 1 when your character will move towards the resource.
2. The CheckAction/ActionFlag value will be 0 when your character will stop moving as it arrives near the resource.
3. The CheckAction/ActionFlag value will be 1 when your character will start digging the resource.
4. The CheckAction/ActionFlag value will be 0 when your character is done gathering the resource.
This also happens when using CastSkill Function and your character's target is beyond the skill's range.
I suggest to check for checkAction/ActionFlag values twice before calling the said functions again.
#include <NomadMemory.au3>
#include <Array.au3>
Dim $GAME_EXE = "elementclient.exe"
Dim $GAME_PID = ProcessExists($GAME_EXE)
Dim $GAME_PROCESS = _MemoryOpen($GAME_PID)
Dim $ADDRESS_BASE = 0xD22C74
Dim $LIST_DIG[2] = ['Nectar', 'Ageratum']
While 1
AutoFarm()
; Insert some auto pots here
; Insert some memory reducers here
Sleep(250)
WEnd
Func AutoFarm()
For $i = 0 To UBound($LIST_DIG) - 1
DigItem($LIST_DIG[$i])
Next
EndFunc
Func DigItem($STRING)
$ARRAY = ItemsArray()
$index = _ArraySearch($ARRAY, $STRING, 0, 0, 0, 1)
If $index <> -1 Then
$ITEM_SN = $ARRAY[$index][0]
GatherItem($ITEM_SN, 1)
Do
; Insert some traveled distance check or stuck check here
; Insert some auto pots here
; Insert some memory reducers here
Sleep(250)
Until ActionFlag() = 0
Sleep(250)
GatherItem($ITEM_SN, 1)
Do
; Insert some traveled distance check or stuck check here
; Insert some auto pots here
; Insert some memory reducers here
Sleep(250)
Until ActionFlag() = 0
EndIf
EndFunc
Func ActionFlag()
$POINTER_BASE = _MemoryRead(_MemoryRead($ADDRESS_BASE, $GAME_PROCESS) + 0x1C, $GAME_PROCESS)
$POINTER_CHAR = _MemoryRead($POINTER_BASE + 0x28, $GAME_PROCESS)
$POINTER_ACTION = _MemoryRead($POINTER_CHAR + 0x13EC, $GAME_PROCESS)
Return _MemoryRead($POINTER_ACTION + 0x24, $GAME_PROCESS)
EndFunc
Func ItemsArray()
$POINTER_BASE = _MemoryRead(_MemoryRead($ADDRESS_BASE, $GAME_PROCESS) + 0x1C, $GAME_PROCESS)
$SORTEDLIST = _MemoryRead($POINTER_BASE + 0x14, $GAME_PROCESS)
$ITEMBASE = _MemoryRead($SORTEDLIST + 0x24, $GAME_PROCESS)
$ITEMCOUNT = _MemoryRead($ITEMBASE + 0x14, $GAME_PROCESS)
If $ITEMCOUNT = 0 Then Return
$ITEMLIST = _MemoryRead($ITEMBASE + 0x1C, $GAME_PROCESS)
Dim $ARRAY[1][7], $COUNTER=0
For $i = 0 To 768
$ITEM = _MemoryRead(_MemoryRead($ITEMLIST + $i*4, $GAME_PROCESS) + 0x4 , $GAME_PROCESS)
If $ITEM <> 0 Then
ReDim $ARRAY[$COUNTER+1][8]
$ARRAY[$COUNTER][0] = _MemoryRead($ITEM + 0x110, $GAME_PROCESS)
$ARRAY[$COUNTER][1] = _MemoryRead($ITEM + 0x114, $GAME_PROCESS)
$ARRAY[$COUNTER][2] = _MemoryRead(_MemoryRead($ITEM + 0x168, $GAME_PROCESS), $GAME_PROCESS, 'wchar[100]')
$ARRAY[$COUNTER][3] = _MemoryRead($ITEM + 0x150, $GAME_PROCESS)
$ARRAY[$COUNTER][4] = _MemoryRead($ITEM + 0x3C, $GAME_PROCESS, 'float') ;X Coord in Map
$ARRAY[$COUNTER][5] = _MemoryRead($ITEM + 0x44, $GAME_PROCESS, 'float') ;y Coord in Map
$ARRAY[$COUNTER][6] = _MemoryRead($ITEM + 0x40, $GAME_PROCESS, 'float') ;Z Coord or Vertical Altitude
$COUNTER += 1
EndIf
Next
Return $ARRAY
EndFunc
Func InjectCode($OPcode)
;Declare local variables
;Open process for given processId
$processHandle = $GAME_PROCESS[1]
;Allocate memory for the OpCode and retrieve address for this
$functionAddress = DllCall('kernel32.dll', 'int', 'VirtualAllocEx', 'int', $processHandle, 'ptr', 0, 'int', 100, 'int', 0x1000, 'int', 0x40)
;Construct the OpCode for calling the function
;Put the OpCode into a struct for later memory writing
$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
;Write the OpCode to previously allocated memory
DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $processHandle, 'int', $functionAddress[0], 'int', DllStructGetPtr($vBuffer), 'int', DllStructGetSize($vBuffer), 'int', 0)
;Create a remote thread in order to run the OpCode
$hRemoteThread = DllCall('kernel32.dll', 'int', 'CreateRemoteThread', 'int', $processHandle, 'int', 0, 'int', 0, 'int', $functionAddress[0], 'ptr', 0, 'int', 0, 'int', 0)
;Wait for the remote thread to finish
Do
$result = DllCall('kernel32.dll', 'int', 'WaitForSingleObject', 'int', $hRemoteThread[0], 'int', 50)
Until $result[0] <> 258
;Close the handle to the previously created remote thread
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $hRemoteThread[0])
;Free the previously allocated memory
DllCall('kernel32.dll', 'ptr', 'VirtualFreeEx', 'hwnd', $processHandle, 'int', $functionAddress[0], 'int', 0, 'int', 0x8000)
Return True
EndFunc
Func GatherItem($ITEM_UNIQUE_ID, $ACTION_TYPE=0)
;Construct the OpCode for calling the 'GatherItem' function
$OPcode = "60" ;60 PUSHAD
$OPcode &= "B9" & _Hex($ADDRESS_BASE) ;B9 00000000 MOV ECX,#Baseadr
$OPcode &= "8B09" ;8B09 MOV ECX,DWORD PTR DS:[ECX]
$OPcode &= "8B491C" ;8B49 1C MOV ECX,DWORD PTR DS:[ECX+1C]
$OPcode &= "8B4928" ;8B49 28 MOV ECX,DWORD PTR DS:[ECX+28]
$OPcode &= "68" & _Hex($ACTION_TYPE) ;68 00000000 PUSH $ACTION_TYPE 0=Pick 1=Dig
$OPcode &= "68" & _Hex($ITEM_UNIQUE_ID) ;68 00000000 PUSH $ITEM_UNIQUE_ID
$OPcode &= "BB" & _Hex($ADDRESS_GATHER) ;BB 00000000 MOV EBX, $ADDRESS_GATHER
$OPcode &= "FFD3" ;FFD3 CALL EBX
$OPcode &= "61" ;61 POPAD
$OPcode &= "C3" ;C3 RETN
InjectCode($OPcode)
EndFunc
Func _Hex($Value, $size=8, $type="int")
Local $tmp1, $tmp2, $i
If($type = "int") Then
$tmp1 = StringRight("000000000" & Hex($Value), $size)
ElseIf($type = "float") Then
$tmp1 = StringRight("000000000" & _FloatToHex($Value), $size)
EndIf
For $i = 0 To StringLen($tmp1) / 2 - 1
$tmp2 = $tmp2 & StringMid($tmp1, StringLen($tmp1) - 1 - 2 * $i, 2)
Next
Return $tmp2
EndFunc
Func _FloatToHex($floatval)
$sF = DllStructCreate("float")
$sB = DllStructCreate("ptr", DllStructGetPtr($sF))
If $floatval = "" Then Exit
DllStructSetData($sF, 1, $floatval)
$return=DllStructGetData($sB, 1)
Return $return
EndFunc
In my opinion, a better solution to check if your character is digging / channeling / casting, is by tracing their Progress Bar Flags.
(A.K.A. trace the gui struct). Because we can tell if your character would be still moving towards the target after calling the GatherItem / CastSkill functions if Progress Bar Flag is Off while Action Flag is On.
I'm currently Experimenting on this Function. I am trying to make a function that will return the value of EAX or DWORD PTR SS:[ESP+10] in 0x0049FF8E. But like I said, I'm not a software developer/computer programmer so, still stuck with my experiments (A.k.a multiple client crashes ).
Ah I see, good to know that. Cos in the old ActionStructure I usually use 2things in there which have their values changed when doing something, one of them probably what you guys call ActionFlag.
As for the value changed to 0 shortly in between actions I use a delay like 1.5 seconds to sleep it off.
func digdelay()
sleep(500)
$readfmode1 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode1)
$readfmode2 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode2)
if $readfmode1[1]<>0 and $readfmode2[1]<>0 Then
do
$readfmode1 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode1)
$readfmode2 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode2)
checkalive()
if $charstatus="dead" then exitloop
until $readfmode1[1]=0 and $readfmode2[1]=0
sleep(1500)
$readfmode1 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode1)
$readfmode2 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode2)
if $readfmode1[1]<>0 and $readfmode2[1]<>0 Then
do
$readfmode1 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode1)
$readfmode2 = _MEMORYPOINTERREAD($APPBASEADDRESS, $mid2, $fmode2)
checkalive()
if $charstatus="dead" then exitloop
until $readfmode1[1]=0 and $readfmode2[1]=0
EndIf
EndIf
endfunc
Dunno why I check it like twice in the function but once a function works I usually don't bother trimming it, it's a simple stupid way but it works with the annoying 1 0 1 0 behaviour for gathering resource for moving and actually dig it.
I hope big changes like this won't happen often, it's annoying rewriting everything
here a little snipet to check for PMs (chatBase_offset := 0xD28948).
the older chat read functions didnt work for me ()
so sadly $array[$counter][0] = _MemoryRead($pointer + $i * dec("1c") + 0x4, $PROCESS_INFORMATION, "Byte") is not returning the Chat Type anymore unless i do something wrong. to traverse the chat you can now use ChatBasePointer + i*0x24 + 0x8
I am trying to figure out how to convert sending packets from AutoIT to C#. I working off of Interest07 post . I know nothing about AutoIt but I do know some .net and little of C#/C++ variants.
My goal is to figure out how to get the MoveTo or AutoPath to work. I figured I'd start easy with the GatherItem. I tried it several different ways but with no success.
One thing I do know is the "B9" on the second line. If you refer to the link, under the area where it says "//opcode for sending a packet private byte[] sendPacketOpcode = new byte[] ", it shows "B8" on the second line. I tried this both ways.
I tried to make it make the whole packet without using the "//opcode for sending a packet private byte[] sendPacketOpcode = new byte[] " area. Nothing.
About AutoFollow , have anyone look into it ? it's one of the most useful thing for multiclienting, one button pressed and we can have all char follow our main.
AutoFollow is weird, I tried to check if it has a packet for doing that but there's nothing or maybe it's clientside.
Btw Stark777, what method do you use to sniff packets ? I use Interest07's MHS script, I wonder if it's still working with Eclipse patch.
follow has no packet... it will just create a sequence of move packets so dont even try. easy way is just make a loop that reads your mains (x,y) and use the autopath every 1 (or 2) seconds to it.
WTS 4 lvl 50 -Red eclipse 04/27/2013 - Star Wars: The Old Republic Trading - 1 Replies ================High-End Account================
Hi there
I want to sell my High-end SWTOR account wich is based on the server " The Red-eclipse "
I am a Hard-core gamer and always want the best gear for my characters, this is no diferant with this account. I am a well known and respected player on this server ( the char names are in good standing :). How ever i dont have the time to play anymore wich ofcourse breaks my heart but my career comes first.
Here by i am offering my...
Fly For Eclipse !! 07/18/2011 - Flyff Private Server - 5 Replies Kann es sein das der Server oft abkackt?:D
und wenn ja wie lange bleibt er dann off??
Eclipse Flyff 07/12/2011 - Flyff Trading - 2 Replies Hey, hat jemand Interesse an mehrere Imba Eclipse Flyff Chars?
http://www7.pic-upload.de/thumb/01.06.11/y9n1bcfi twcx.png
Hab noch viele Rare Item's wo du locker 500b zusammen bekommst
hab noch mehrere Imba chars.
Interesse? dann schreib hier :>
My Eclipse to your Demon. 04/04/2011 - Flyff Trading - 0 Replies Hi dears..
I'm Trading all my itens and money on Eclipse flyff to itens or money on demon flyff.
On Eclipse,I have Many Solar Weapon's,Cs Sets,Bike,Pets
and so much money.
If you are interested,add me on msn.
[email protected]
:mofo:
C++ in Eclipse 02/01/2010 - C/C++ - 2 Replies Huhu,
kann mir mal bitte jemand helfen. Ich habe im Internet ein Tutorial befolgt um C++/C auf Eclipse zu programmieren. Ich habe alles befolgt wies sein sollte, laut Tutorial. Wenn ich nun build mache, dann kommt folgendes:
Habe die Eclipse CDT und MinGW installiert.
Habe danach auch ein wenig gegoogelt und nichts hilfreiches gefunden. Ich vermute, dass ich irgendwo noch einen Pfad verändern muss, aber ich weiß nicht wo.