[Help] Movement menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Movement

    Ok I got all the pieces I need to be able to follow something but I don't know the math behind doing it.


    I was reading Movement « Shynd’s WoW Modification Journal and he has some nice tips in there but my problem is for what ever reason its not very accurate and if WoW window has focus my program stops doing the corrections and sometimes it will run past the person other times it will spin around in a circle around him until I give my program focus.

    I am using postmessage() to send the commands

    Here is the code i got so far. I am just learnig how to interact with WoW right now so the code might be a little messy...

    Code:
    		while(true){
    			Sleep(60);
    
    			dwObjMgr = GetObjManager(dwPid);
    
    			if(!dwObjMgr) { printf("Waiting to attach..."); continue; }
    
    			ReadProcessMemory( hProcess, (LPVOID)(dwObjMgr + 0xC0), (LPVOID)&PlayerGUID, 8, &dwReadBytes );
    			dwPlayerObj = GetObjectByGUID(hProcess,dwObjMgr,PlayerGUID);
    
    			ReadProcessMemory(hProcess,(LPVOID)(dwPlayerObj + 0x120), (LPVOID)&temp,4,&dwReadBytes);
    			ReadProcessMemory(hProcess,(LPVOID)(temp + 0x28), (LPVOID)&TargetGUID,8,&dwReadBytes);
    			dwTargetObj = GetObjectByGUID(hProcess,dwObjMgr,TargetGUID);
    
    			ReadProcessMemory( hProcess, (LPVOID)(dwObjMgr + 0xAC), (LPVOID)&dwCurObj, 4, &dwReadBytes );
    
    			dwNextObj = dwCurObj;
    
    			memset(&pPS,0,sizeof(Unit_Info));
    			memset(&tTarget,0,sizeof(Mob_Info));
    			ReadProcessMemory( hProcess, (LPVOID)(dwPlayerObj),	(LPVOID)&pPS, sizeof(Unit_Info), &dwReadBytes );
    			ReadProcessMemory( hProcess, (LPVOID)(dwTargetObj),	(LPVOID)&tTarget, sizeof(Mob_Info), &dwReadBytes );
    
    					//if we've found our target id, walk to it!
    					if (dwTargetObj)
    					{
    						float dist = (float)GetDistance(pPS.x,pPS.y,tTarget.x,tTarget.y);
    						float rotate = (float)atan2((tTarget.y - pPS.y),(tTarget.x - pPS.x));
    						
    						if(rotate < 0) 
    							rotate +=(float)(PI * 2);
    
    						//printf("Distance: %f\nFacing: %f\n",dis,rotate);
    
    						
    						if(pPS.h < ( rotate + turnaccuracy) && pPS.h > ( rotate - turnaccuracy )) {
    											
    							if (isTurning)
    							{
    								isTurning = false;
    								ArrowKeyUp(hWoW, turnkey);
    							}
    
    							//if we're close to the target
    							if (dist < walkaccuracy)
    							{
    								//if we're walking, stop walking
    								if (isWalking)
    								{
    									ArrowKeyUp(hWoW, UP);
    									isWalking = false;
    								}
    				
    							}
    
    							//we're not close, so we're walking
    							isWalking = true;
    							//hold down the up button
    							ArrowKeyDown(hWoW, UP);
    					
    						} else {
    					
    
    							//if we're already turning, no need to turn again
    							//if (isTurning)		//no need to have this enabled
    							//	break;				//while debugging
    
    							//we're turning
    							isTurning = true;
    
    							//variable definition
    							double r, l;
    
    							//if our current facing angle, in radians, is greater than
    							//the angle which we desire to face
    							if (pPS.h > rotate)
    							{
    								//we'd have to turn past North if we're turning left
    								l = ((2 * PI) - pPS.h) + rotate;
    								//we don't have to turn past North if we're turning right
    								r = pPS.h - rotate;
    							}
    							else
    							{
    								//we don't have to turn past North if we're turning left
    								l = rotate - pPS.h;
    								//we have to turn past North if we're turning right
    								r = pPS.h + ((2 * PI) - rotate);
    							}
    
    							//let's please turn in the direction where we have to spend
    							//the least amount of time turning
    							if (l < r)
    								turnkey = LEFT;
    							else
    								turnkey = RIGHT;
    
    							//hold down the arrow key in the direction we've determined
    							//we should be turning
    							ArrowKeyDown(hWoW, turnkey);
    						}
    					}
    
    
    
    			//printf("Player Obj: 0x%X\n",dwPlayerObj);
    			//printf("Target Obj: 0x%X\n",dwTargetObj);
    			//printf("Target GUID: 0x%X\n\n",TargetGUID);
    			//printf("Player Info:\nX: %f, Y: %f, Z: %f - Facing: %f\nHealth: %d of %d\nRage: %d of %d\n\n",pPS.x,pPS.y,pPS.z,pPS.h,pPS.HP,pPS.max_health,pPS.rage,pPS.max_rage);
    			//printf("TargetInfo:\nX: %f, Y: %f, Z: %f - Facing: %f\nHealth: %d of %d\n\n\n",tTarget.x,tTarget.y,tTarget.z,tTarget.h,tTarget.HP,tTarget.max_health);
    			//Sleep(1000);
    			//system("cls");
    			
    			
    
    		}

    [Help] Movement
  2. #2
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by cenron View Post
    Ok I got all the pieces I need to be able to follow something but I don't know the math behind doing it.


    I was reading Movement « Shynd’s WoW Modification Journal and he has some nice tips in there but my problem is for what ever reason its not very accurate and if WoW window has focus my program stops doing the corrections and sometimes it will run past the person other times it will spin around in a circle around him until I give my program focus.

    I am using postmessage() to send the commands

    Here is the code i got so far. I am just learnig how to interact with WoW right now so the code might be a little messy...

    Code:
    		while(true){
    			Sleep(60);
    
    			dwObjMgr = GetObjManager(dwPid);
    
    			if(!dwObjMgr) { printf("Waiting to attach..."); continue; }
    
    			ReadProcessMemory( hProcess, (LPVOID)(dwObjMgr + 0xC0), (LPVOID)&PlayerGUID, 8, &dwReadBytes );
    			dwPlayerObj = GetObjectByGUID(hProcess,dwObjMgr,PlayerGUID);
    
    			ReadProcessMemory(hProcess,(LPVOID)(dwPlayerObj + 0x120), (LPVOID)&temp,4,&dwReadBytes);
    			ReadProcessMemory(hProcess,(LPVOID)(temp + 0x28), (LPVOID)&TargetGUID,8,&dwReadBytes);
    			dwTargetObj = GetObjectByGUID(hProcess,dwObjMgr,TargetGUID);
    
    			ReadProcessMemory( hProcess, (LPVOID)(dwObjMgr + 0xAC), (LPVOID)&dwCurObj, 4, &dwReadBytes );
    
    			dwNextObj = dwCurObj;
    
    			memset(&pPS,0,sizeof(Unit_Info));
    			memset(&tTarget,0,sizeof(Mob_Info));
    			ReadProcessMemory( hProcess, (LPVOID)(dwPlayerObj),	(LPVOID)&pPS, sizeof(Unit_Info), &dwReadBytes );
    			ReadProcessMemory( hProcess, (LPVOID)(dwTargetObj),	(LPVOID)&tTarget, sizeof(Mob_Info), &dwReadBytes );
    
    					//if we've found our target id, walk to it!
    					if (dwTargetObj)
    					{
    						float dist = (float)GetDistance(pPS.x,pPS.y,tTarget.x,tTarget.y);
    						float rotate = (float)atan2((tTarget.y - pPS.y),(tTarget.x - pPS.x));
    						
    						if(rotate < 0) 
    							rotate +=(float)(PI * 2);
    
    						//printf("Distance: %fnFacing: %fn",dis,rotate);
    
    						
    						if(pPS.h < ( rotate + turnaccuracy) && pPS.h > ( rotate - turnaccuracy )) {
    											
    							if (isTurning)
    							{
    								isTurning = false;
    								ArrowKeyUp(hWoW, turnkey);
    							}
    
    							//if we're close to the target
    							if (dist < walkaccuracy)
    							{
    								//if we're walking, stop walking
    								if (isWalking)
    								{
    									ArrowKeyUp(hWoW, UP);
    									isWalking = false;
    								}
    				
    							}
    
    							//we're not close, so we're walking
    							isWalking = true;
    							//hold down the up button
    							ArrowKeyDown(hWoW, UP);
    					
    						} else {
    					
    
    							//if we're already turning, no need to turn again
    							//if (isTurning)		//no need to have this enabled
    							//	break;				//while debugging
    
    							//we're turning
    							isTurning = true;
    
    							//variable definition
    							double r, l;
    
    							//if our current facing angle, in radians, is greater than
    							//the angle which we desire to face
    							if (pPS.h > rotate)
    							{
    								//we'd have to turn past North if we're turning left
    								l = ((2 * PI) - pPS.h) + rotate;
    								//we don't have to turn past North if we're turning right
    								r = pPS.h - rotate;
    							}
    							else
    							{
    								//we don't have to turn past North if we're turning left
    								l = rotate - pPS.h;
    								//we have to turn past North if we're turning right
    								r = pPS.h + ((2 * PI) - rotate);
    							}
    
    							//let's please turn in the direction where we have to spend
    							//the least amount of time turning
    							if (l < r)
    								turnkey = LEFT;
    							else
    								turnkey = RIGHT;
    
    							//hold down the arrow key in the direction we've determined
    							//we should be turning
    							ArrowKeyDown(hWoW, turnkey);
    						}
    					}
    
    
    
    			//printf("Player Obj: 0x%Xn",dwPlayerObj);
    			//printf("Target Obj: 0x%Xn",dwTargetObj);
    			//printf("Target GUID: 0x%Xnn",TargetGUID);
    			//printf("Player Info:nX: %f, Y: %f, Z: %f - Facing: %fnHealth: %d of %dnRage: %d of %dnn",pPS.x,pPS.y,pPS.z,pPS.h,pPS.HP,pPS.max_health,pPS.rage,pPS.max_rage);
    			//printf("TargetInfo:nX: %f, Y: %f, Z: %f - Facing: %fnHealth: %d of %dnnn",tTarget.x,tTarget.y,tTarget.z,tTarget.h,tTarget.HP,tTarget.max_health);
    			//Sleep(1000);
    			//system("cls");
    			
    			
    
    		}
    actually u can overwrite the Facing value and ure char will turn 100% accurateley instantley altho u have to be standing still for it to work otherwise u can use wow's cInputControl to make ure char move altho i dun rly know how to call it.
    btw i released my fishbot if u wanna try it

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Christ that's ugly. I'd use CInputControl if I were you. I posted a thread with information on it.

  4. #4
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Christ that's ugly. I'd use CInputControl if I were you. I posted a thread with information on it.
    I KNOW! I am so embarrassed lol. I have been coding forever and this is a totally new concept to me so Ill try to tighten up my code more as I understand the concept more.

    Thats a cool idea on the CInputControl but correct me if I am wrong but aren't you over writing memory in WoW? Would that be EZ to detect? I really don't want my bot to be that aggressive. The other part of it is. I have no idea how to implement that into an out of process program, I relatively new to this whole memory modification thing.

    Is there a way to do this without having to over write the memory addresses?

    EDIT: I tried moving the char 0.136f and I kept getting dc'ed even at 0.1f i got kicked.
    Last edited by cenron; 10-07-2008 at 01:03 AM.

  5. #5
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try make a Wrapper for ReadProcessMemory/WriteProcessMemory with different return types etc. and ure code would be alot "cleaner" maybe some other classes for getting pointers to ObjectManager etc...

    good luck

  6. #6
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No you're not overwriting memory, you're just "hijacking" a class and calling its functions.

    Either way, as long as you don't overwrite any of the offsets on the page I linked below you'll be fine.
    Warden - WoW.Dev Wiki

    Warden doesn't do a stack trace so you're safe to call functions.

    To implement into an out-of-process program, you want to inject code to call the functions then create a thread for it.

    PS. You're not using it for nudge hacks like my thread is explaining, you want to use it to move. Check the SetFlags or w/e it's called function and pass it the forward/back values instead.

  7. #7
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    No you're not overwriting memory, you're just "hijacking" a class and calling its functions.

    Either way, as long as you don't overwrite any of the offsets on the page I linked below you'll be fine.
    Warden - WoW.Dev Wiki

    Warden doesn't do a stack trace so you're safe to call functions.

    To implement into an out-of-process program, you want to inject code to call the functions then create a thread for it.

    PS. You're not using it for nudge hacks like my thread is explaining, you want to use it to move. Check the SetFlags or w/e it's called function and pass it the forward/back values instead.
    When you say inject code and make a thread are you talking about

    Code:
    VirtualAllocEx(blah...);
    Then write the info to the allocated area then

    Code:
    CreateRemoteThread();
    Is that what you mean? I use to do that all the time back in the day. Is that really still not detected? I read somewhere that WOW hook CreateRemoteThread();

  8. #8
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read that a long time ago, too, but it isn't true. Besides, if you want to avoid using CreateRemoteThread, you can OpenThread, SuspendThread, GetThreadContext, change ctx.Eip, SetThreadContext, and ResumeThread... though that's an awful lot of trouble to get around something that isn't detected or even checked in the first place.

  9. #9
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Shynd View Post
    I read that a long time ago, too, but it isn't true. Besides, if you want to avoid using CreateRemoteThread, you can OpenThread, SuspendThread, GetThreadContext, change ctx.Eip, SetThreadContext, and ResumeThread... though that's an awful lot of trouble to get around something that isn't detected or even checked in the first place.
    hi got a question about CreateRemoteThread, ive tried just spawning one into wow first wrote 3 push, 0 to a codecave but it just chrashes wow the thread is really bad it continues even after the 3 pushes and therefore chrashes wow :weepy:

    Code:
    //allocate memory for codecave
    uint cc = Memory.AllocateMemory(hProcess, 0x1000);
    
    //Opcodes in raw hex to inject
    bInject[] = {0x6A, 0x00,  //push, 0
                        0x6A, 0x00,  //push, 0
                        0x6A, 0x00   //push, 0
                        };
    
    //Write the opcodes to the codeCave
    Memory.WriteMemory(hProcess, cc, bInject);
    
    //create the thread
    IntPtr hThread = Memory.CreateRemoteThread(hProcess, cc, 0);
    
    Memory.WaitForSingleObject(hThread);
    
    //close handle
    Memory.CloseHandle(hThread);

  10. #10
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not being checked, you won't get banned, go nuts.

  11. #11
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nesox View Post
    hi got a question about CreateRemoteThread, ive tried just spawning one into wow first wrote 3 push, 0 to a codecave but it just chrashes wow the thread is really bad it continues even after the 3 pushes and therefore chrashes wow :weepy:

    Code:
    //allocate memory for codecave
    uint cc = Memory.AllocateMemory(hProcess, 0x1000);
    
    //Opcodes in raw hex to inject
    bInject[] = {0x6A, 0x00,  //push, 0
                        0x6A, 0x00,  //push, 0
                        0x6A, 0x00   //push, 0
                        };
    
    //Write the opcodes to the codeCave
    Memory.WriteMemory(hProcess, cc, bInject);
    
    //create the thread
    IntPtr hThread = Memory.CreateRemoteThread(hProcess, cc, 0);
    
    Memory.WaitForSingleObject(hThread);
    
    //close handle
    Memory.CloseHandle(hThread);
    I think what you have to do is find the main thread for WoW then

    Code:
    OpenThread();
    Then
    Code:
    CreateRemoteThread()
    Into that. I could be wrong but its worth a try.

  12. #12
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, that's not it. The reason it crashes is that you need to append a RETN (0xC3) after your two pushes. Maybe even SUB ESP, 8 \ RETN. Threads that you create need to return after execution is finished (or be terminated, of course).

  13. #13
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok so here is another question. How do you get the return value of a function, like GetObjectByGUID, once you have done this type of injection?

  14. #14
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's a few different ways. You can either go all-out and write and inject a DLL that sends information back and forth between processes--sockets, named pipes, shared memory, Windows messages--or, if you're only going to be needing the return value every so often, as with GetNumLootItems or something, you can put what you want to be returned into the EAX register, RETN, and then call kernel32.GetExitCodeThread(hThread);.

    For instance, say you inject code that does something like:
    Code:
    CALL wow.GetNumLootItems ;return value will be in EAX
    RETN
    and execute it using CreateRemoteThread. Your code might look like:
    Code:
    //do whatever injection up here somewhere
    HANDLE hThread = CreateRemoteThread(..whatever);
    WaitForSingleObject(hThread, INFINITE);
    DWORD dwNumLootItems = GetExitCodeThread(hThread);
    CloseHandle(hThread);
    Now dwNumLootItems holds the exit code, or value of EAX upon RETN, of your injected thread. Make sense?

  15. #15
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Shynd View Post
    There's a few different ways. You can either go all-out and write and inject a DLL that sends information back and forth between processes--sockets, named pipes, shared memory, Windows messages--or, if you're only going to be needing the return value every so often, as with GetNumLootItems or something, you can put what you want to be returned into the EAX register, RETN, and then call kernel32.GetExitCodeThread(hThread);.

    For instance, say you inject code that does something like:
    Code:
    CALL wow.GetNumLootItems ;return value will be in EAX
    RETN
    and execute it using CreateRemoteThread. Your code might look like:
    Code:
    //do whatever injection up here somewhere
    HANDLE hThread = CreateRemoteThread(..whatever);
    WaitForSingleObject(hThread, INFINITE);
    DWORD dwNumLootItems = GetExitCodeThread(hThread);
    CloseHandle(hThread);
    Now dwNumLootItems holds the exit code, or value of EAX upon RETN, of your injected thread. Make sense?
    yea, i get it now ill fool around some with it try get some stuff work thx.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 01-20-2011, 02:38 PM
  2. Help with modelediting the combat "movement"
    By Extreem0455 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 01-26-2010, 05:31 PM
  3. Movement speed - HELP !
    By fronky in forum World of Warcraft Model Editing
    Replies: 1
    Last Post: 02-26-2009, 07:21 PM
  4. need help with movement
    By lanman92 in forum WoW Memory Editing
    Replies: 14
    Last Post: 08-01-2008, 02:44 AM
  5. bot help
    By xwhitedeathx in forum World of Warcraft General
    Replies: 3
    Last Post: 05-01-2006, 03:50 AM
All times are GMT -5. The time now is 08:44 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search