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 


How to write GetSystemTime in x64 using ASM

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials
View previous topic :: View next topic  
Author Message
yui0900826
Cheater
Reputation: 0

Joined: 09 Aug 2011
Posts: 35
Location: HongKong

PostPosted: Fri Mar 17, 2023 1:21 am    Post subject: How to write GetSystemTime in x64 using ASM Reply with quote

Thank you~~~
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Mar 17, 2023 2:13 am    Post subject: Reply with quote

call GetSystemTime
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
yui0900826
Cheater
Reputation: 0

Joined: 09 Aug 2011
Posts: 35
Location: HongKong

PostPosted: Fri Mar 17, 2023 2:22 am    Post subject: Reply with quote

Dark Byte wrote:
call GetSystemTime


I don't know how to write in the Assembler Crying or Very sad Crying or Very sad
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Fri Mar 17, 2023 11:47 am    Post subject: Reply with quote

Code:
globalalloc(foo,4096)

label(lpSystemTime)
foo:
  sub rsp,28
  mov rcx,lpSystemTime
  call GetSystemTime
  add rsp,28
  ret

foo+800:
lpSystemTime:
  resw 8

createthread(foo)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Mar 17, 2023 1:29 pm    Post subject: Reply with quote

(assuming 64 bit)

Code:

alloc(systemtime,16)
registersymbol(systemtime)

{$c}
extern void* systemtime;
int stopped=0;
int delay=50;
void dostuff()
{
  while (!stopped)
  {
    GetSystemTime(&systemtime);
    Sleep(delay);
  }
}
{$asm}
createthread(dostuff)


the address "systemtime" will constantly be updated

you can stop it by doing a writeInteger("stopped",1)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> Auto Assembler tutorials 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