Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find the current date in intel x86 Assembly?

Tags:

x86

assembly

I need to find the find the current date in binary for Intel x86 Assembly on Windows. I'm allowed to use Windows procedures.

like image 513
chustar Avatar asked Dec 13 '22 01:12

chustar


2 Answers

If you're allowed to use Win32 functions, then the answer to this would be the same as the answer to "How can I find the current date in C on Windows?" For this, look up the GetSystemTime and SystemTimeToFileTime functions (hey neat, there's even a GetSystemTimeAsFileTime function now! (since Windows 2000)).

like image 65
Greg Hewgill Avatar answered Jan 17 '23 23:01

Greg Hewgill


Not sure if this is technically "Windows" (and indeed only works in Windows' emulated DOS environment aka NTVDM, as confirmed by Greg Hewgill), but you could use INT $21, with $2A in AH, as this DOS function will return the date. See this link for more info

like image 23
mjv Avatar answered Jan 17 '23 23:01

mjv