Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 15:02

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

Advertisement



[ASM][c++] problem with asm address

Discussion on [ASM][c++] problem with asm address within the Nostale forum part of the MMORPGs category.

Closed Thread
 
Old   #1
 
forsatus's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 479
Received Thanks: 234
[ASM][c++] problem with asm address

Hi, i got a problem with the variable DWORD when i use asm

Code:
DWORD dwSendFunction = PathernSendFunc();
	DWORD tmp = PathernNetwork();

	__asm
	{
		MOV EAX, DWORD PTR DS : [tmp]
		MOV EAX, DWORD PTR DS : [EAX]
		MOV EDX, szPacket
		CALL dwSendFunction
	}
The pathern return the good value, but nostale crash.
I also trie to put value like this :

Code:
DWORD dwSendFunction = 0x00518AC4;
	DWORD tmp = 0x0069630C;

	__asm
	{
		MOV EAX, DWORD PTR DS : [tmp]
		MOV EAX, DWORD PTR DS : [EAX]
		MOV EDX, szPacket
		CALL dwSendFunction
	}
And same, nostale crash it work only when i use it

Code:
#define tmp 0x0069630C
#define dwSendFunction 0x00518AC4
Thanks in advance
forsatus is offline  
Old 12/30/2016, 00:34   #2
 
elite*gold: 0
Join Date: Nov 2016
Posts: 27
Received Thanks: 8
Quote:
Originally Posted by forsatus View Post
Hi, i got a problem with the variable DWORD when i use asm

DWORD dwSendFunction = PathernSendFunc();
DWORD tmp = PathernNetwork();


__asm
{
MOV EAX, DWORD PTR DS : [tmp]
MOV EAX, DWORD PTR DS : [EAX]

MOV EDX, szPacket
CALL dwSendFunction
}

...

Thanks in advance
it's logical because you are referencing here not of the values themselves.
xopy is offline  
Old 12/30/2016, 02:14   #3
 
forsatus's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 479
Received Thanks: 234
Quote:
Originally Posted by xopy View Post
it's logical because you are referencing here not of the values themselves.
i don't understand what you mean
forsatus is offline  
Old 12/30/2016, 02:29   #4


 
Jeoni's Avatar
 
elite*gold: 966
Join Date: Apr 2010
Posts: 1,105
Received Thanks: 681
With
Code:
DWORD tmp = PathernNetwork();
there is a part of memory somewhere that holds 4 byte (some address).
If you now execute
Code:
MOV EAX, DWORD PTR DS : [tmp]
you access that part of the memory and read it. So the content (value) of tmp is put into eax. With
Code:
MOV EAX, DWORD PTR DS : [EAX]
you're dereferencing and read the content located at the address specified by eax (which is the value of tmp). So on this part what you now did translated to C pseudocode is
Code:
eax = *(DWORD*)tmp
or
Code:
eax = *(DWORD*)PathernNetwork()
.

Now let's take a look why it works with defines. Defines does not translate to variables, so are not actually located somewhere in the memory. Instead it's like a synonym for the thing defined (addresses in this case). So with
Code:
MOV EAX, DWORD PTR DS : [tmp]
you're not accessing a variable first but directly dereferencing the "target" address. With the second dereferencation with
Code:
MOV EAX, DWORD PTR DS : [EAX]
you'd get something like this in pseudocode:
Code:
eax = **(DWORD**)tmp
(note that tmp is the define now not a variable) or
Code:
eax = **(DWORD**)0x0069630C
.

I guess you see the difference? One dereferencation. That's easy to fix, the solution is trivial and I hope you don't need spoonfeeding after this detailed explanation?
With best regards
Jeoni
Jeoni is offline  
Thanks
1 User
Old 12/30/2016, 03:21   #5
 
forsatus's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 479
Received Thanks: 234
Ok, it's a stupid error xD
Thanks to help me to see the error, know i understand how to work the DR

#closerequest
forsatus is offline  
Closed Thread


Similar Threads Similar Threads
Base Address Problem :/
03/24/2014 - S4 League - 8 Replies
Also ich wollte letztens die Base Addresse von HP und Ammo herausfinden aber wenn ich dann bei CE "Find out what writes..." klicke dann stürzt S4 ab Könnt ihr mir helfen wär wirklich nett :)
[Problem]IS using my address IP metin2 !
08/21/2013 - Metin2 Private Server - 12 Replies
Welcome. * I have a little problem because when I configured everything right I can not connect to the FTP . It gives me a strange error which I have not. Here it is: http://pics.tinypic.pl/i/00433/04z8v8xjns3p.png Willkommen.
Problem [Address]
08/29/2011 - S4 League - 2 Replies
Deutsch:Ich hab ein Problem die Values der address ändern sich jedes mal wenn ich S4 neu starte.Das heißt wenn ich ein inf. ammo Hack schreiben wollte würde es nicht funktionieren weil sie die address der Munition jedes mal verändert. Habt ihr eine Lösung dafür gefunden? English:I have a problem,the values of the address change everytime when I start S4 again. Thats mean when i want to write a inf. ammo hack it not work because the address of the ammo change each time. Have you found a...
whats going on with the address problem on kts registration?
10/14/2010 - Rappelz - 3 Replies
hello elitepvp, I am very close to making a kts account but i have some address problem with registration. i saw on some forums here that there were others with the same problem. can anyone refer me to a official kts registration guide website so i can figure this out thnks elitepvp :)
Mem Address Problem
03/29/2010 - CO2 Programming - 23 Replies
hi, I am having this problem,when i find the memory address for my server name, Example : I find the memory address for Pisces,then when i add it to my bot and login to that server and hook my char with the bot,it shows me numbers in the server name box instead of Pisces,I even tried it with the base address pointer but still no use,can any one help me,if any helps me +K, Thank you



All times are GMT +1. The time now is 15:02.


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.