Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question] getting address value every X seconds

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Oct 11, 2008 10:57 am    Post subject: [Question] getting address value every X seconds Reply with quote

i want to get my Attack Counter's value every few seconds or milliseconds (MapleStory),
so i wrote the following code to transfer it to variable
Code:

DWORD *dwAtkCount = (DWORD*)0x00000000; // a random address that represent the attacks counter
__declspec(naked) void UA()
{
   __asm
   {
      push eax
      mov eax,[dwAtkCounter]
      mov [dwCount],eax
      pop eax
   }
}

after that's done i use a thread to get the value into dwCount
and my question is it possible to transfer the value like that?
(can't check it cuz i have no ms on that computer and i won't be home for couple of days).

_________________
Stylo
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Oct 11, 2008 11:12 am    Post subject: Reply with quote

Wouldn't it be easier to hook the attack function and everytime you attack get the attack counter's value?
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Oct 11, 2008 11:16 am    Post subject: Reply with quote

possibly, but i don't know much about hooking, so i asked if that would do the job too Confused
_________________
Stylo
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Sat Oct 11, 2008 11:40 am    Post subject: Reply with quote

Code:

unsigned ptr = *(DWORD*)0x94A805; //ptr
ptr+=4; //offset
char attcount = *(char*)ptr;


The address and offset its not correct ofc.

_________________
Gone
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Oct 11, 2008 11:50 am    Post subject: Reply with quote

i said that this is just a random address that i wrote for example because i don't know the real address of the attacks
just asked if the following code will do the job that i want, and if it doesn't how can i change it so it will o:

_________________
Stylo
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sat Oct 11, 2008 12:21 pm    Post subject: Reply with quote

wtf are you doing? Why hook hop?

This is for a dll only

Code:
int value = *((DWORD*)Base) + Offset;

_________________
Back to top
View user's profile Send private message Send e-mail
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Sat Oct 11, 2008 12:50 pm    Post subject: Reply with quote

kitterz wrote:
wtf are you doing? Why hook hop?

This is for a dll only

Code:
int value = *((DWORD*)Base) + Offset;

He is not using hook hop? He just used an asm function.

_________________
Gone
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Oct 11, 2008 12:51 pm    Post subject: Reply with quote

okay so i guess that the code will be like that now:
Code:

int dwAtkCounte = *((DWORD*)Base) + Offset;
__declspec(naked) void UA()
{
   __asm
   {
      push eax
      mov eax,[dwAtkCounter]
      mov [dwCount],eax
      pop eax
   }
}

still, the inline asm will do the job i want it to do ?
will dwCount store the number of attacks?

_________________
Stylo


Last edited by Stylo on Sat Oct 11, 2008 12:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sat Oct 11, 2008 12:51 pm    Post subject: Reply with quote

GMZorita wrote:
kitterz wrote:
wtf are you doing? Why hook hop?

This is for a dll only

Code:
int value = *((DWORD*)Base) + Offset;

He is not using hook hop? He just used an asm function.


oops you are right. I just looked at it and it looked like hook hop. Did not read it Embarassed

my bad Very Happy

_________________
Back to top
View user's profile Send private message Send e-mail
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Oct 11, 2008 2:07 pm    Post subject: Reply with quote

Just loop with a Sleep of the seconds you want.

He CAN use a function that uses inline asm if he wishes, it will still work.

DWORD dwAtkCount = *((DWORD*)Base)+Offset;

or

mov eax, dword ptr [Base]
mov eax, dword ptr [eax+Offset]
mov dword ptr [dwAtkCount], eax

_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Oct 11, 2008 2:33 pm    Post subject: Reply with quote

Great :], thank you very much.
_________________
Stylo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites