Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 06:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Game hacking] Hook move function

Discussion on [Game hacking] Hook move function within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2019
Posts: 6
Received Thanks: 0
[Game hacking] Hook move function

Hello everyone!
I need to hook the move function of my character in Nostale and use it in c#/c++, can someone help me to do this?
Celid is offline  
Old 09/25/2019, 10:55   #2
 
elite*gold: 0
Join Date: Sep 2019
Posts: 6
Received Thanks: 0
Can someone help me?

I've wrote the asm but when I execute it, the game crashes.

Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		mov eax, myPosition
		mov edx, newPosition
		call walkAddress
        }
}
Celid is offline  
Old 09/25/2019, 18:26   #3



 
IceTrailer's Avatar
 
elite*gold: 150
Join Date: Sep 2010
Posts: 2,070
Received Thanks: 821
Quote:
Originally Posted by Celid View Post
Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		mov eax, myPosition
		mov edx, newPosition
		call walkAddress
        }
}
Looks like you use dynamic addresses and no static address. Dynamic addresses vary everytime you run Nostale and allocate new memory.
You have to deduce which address writes to your dynamic address (you have to find the new one) and use then the pointer.
IceTrailer is offline  
Old 09/26/2019, 01:16   #4
 
DarkyZShadow's Avatar
 
elite*gold: 0
Join Date: Nov 2015
Posts: 211
Received Thanks: 141
Quote:
Originally Posted by Celid View Post
Can someone help me?

I've wrote the asm but when I execute it, the game crashes.

Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		mov eax, myPosition
		mov edx, newPosition
		call walkAddress
        }
}
Remember that declaring your function with "naked" removes the prolog and epilog from it (cf ).
So you have to add the "ret" instruction at the end of your function else your program will continue to execute undefined instructions after the call to "walkAddress".

You can try something like that :
Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		mov eax, myPosition
		mov edx, newPosition
		call walkAddress
		ret
        }
}
DarkyZShadow is offline  
Old 09/26/2019, 20:47   #5
 
elite*gold: 0
Join Date: Sep 2019
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by IceTrailer View Post
Looks like you use dynamic addresses and no static address. Dynamic addresses vary everytime you run Nostale and allocate new memory.
You have to deduce which address writes to your dynamic address (you have to find the new one) and use then the pointer.
Hello IceTrailer and thank you for your reply,
I don't understand what do you mean, the address I found is a static address.

Quote:
Originally Posted by DarkyZShadow View Post
Remember that declaring your function with "naked" removes the prolog and epilog from it (cf ).
So you have to add the "ret" instruction at the end of your function else your program will continue to execute undefined instructions after the call to "walkAddress".

You can try something like that :
Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		mov eax, myPosition
		mov edx, newPosition
		call walkAddress
		ret
        }
}
Hello DarkyZShadow and thank you for your reply,
I've added ret at the end but it doesn't work.
I've tryed also to set all the registers as they normally are before calling the function but steel it doesn't works.
Celid is offline  
Old 09/26/2019, 22:54   #6
 
DarkyZShadow's Avatar
 
elite*gold: 0
Join Date: Nov 2015
Posts: 211
Received Thanks: 141
Quote:
Originally Posted by Celid View Post
Hello DarkyZ and thank you for your reply,
I've added ret at the end but it doesn't work.
I've tryed also to set all the registers as they normally are before calling the function but steel it doesn't works.
How did you do that ? Using PUSHAD/POPFD instructions ? Also, try to save flags (PUSHFD/POPFD).

Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		; Save registers & flags
		pushad
		pushfd

		mov eax, myPosition
		mov edx, newPosition
		call walkAddress

		; Restore flags & registers: don't forget to reverse the order
		popfd
		popad

		ret
        }
}
If it doesn't work, you probably have a problem when you call the "walk" function (bad address, bad parameters, ...)
DarkyZShadow is offline  
Old 09/28/2019, 20:54   #7
 
elite*gold: 0
Join Date: Sep 2019
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by DarkyZShadow View Post
How did you do that ? Using PUSHAD/POPFD instructions ? Also, try to save flags (PUSHFD/POPFD).

Code:
unsigned newPosition = 0x000A000A;
DWORD walkAddress = 0x00490A40;

void __declspec(naked) ourFunct() {
	__asm {
		; Save registers & flags
		pushad
		pushfd

		mov eax, myPosition
		mov edx, newPosition
		call walkAddress

		; Restore flags & registers: don't forget to reverse the order
		popfd
		popad

		ret
        }
}
If it doesn't work, you probably have a problem when you call the "walk" function (bad address, bad parameters, ...)
I've the move function:
Code:
NostaleClientX.exe+145309 - 6A 01                 - push 01
NostaleClientX.exe+14530B - 33 C9                 - xor ecx,ecx
NostaleClientX.exe+14530D - 8B 55 FC              - mov edx,[ebp-04]
NostaleClientX.exe+145310 - A1 88B78600           - mov eax,[NostaleClientX.exe+46B788] { (0E2AADD0) }
NostaleClientX.exe+145315 - E8 2653FFFF           - call NostaleClientX.exe+13A640
Do you know how can I call It in c++ or in c# when I need to move my char?
For now I've edit the move coords whit memory write (code cave) and when I click my char moves in the right coords.
Now I want to call my function without click in the game.
Celid is offline  
Reply


Similar Threads Similar Threads
std::function of a function returning an std::function
11/11/2013 - C/C++ - 19 Replies
Nun muss ich nach langer Zeit auch mal wieder einen Thread erstellen, weil mir Google nicht mehr weiterhelfen kann. Ich verzweifle an Folgendem Vorhaben: #include <Windows.h> #include <string> #include <iostream> using namespace std;



All times are GMT +1. The time now is 06:07.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.