Created
April 22, 2022 22:58
-
-
Save dd86k/2817f264ac4851bde8b0132accf6e7cd to your computer and use it in GitHub Desktop.
A simple GetCommandLineW-x86 implementation. Works from Windows XP to 11 thanks to the instroduction of TLS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wchar* GetCommandLineWFast() { | |
version (X86_64) asm { | |
mov RAX,GS:[0x60]; | |
mov RAX,[RAX+0x20]; | |
mov RAX,[RAX+0x78]; | |
} else version (X86) asm { | |
mov EAX,FS:[0x30]; | |
mov EAX,[EAX+0x10]; | |
mov EAX,[EAX+0x44]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment