Skip to content

Instantly share code, notes, and snippets.

@nguyendown
Last active June 3, 2020 07:51
Show Gist options
  • Save nguyendown/51533ae3d35007b18a155c0de8ff16a0 to your computer and use it in GitHub Desktop.
Save nguyendown/51533ae3d35007b18a155c0de8ff16a0 to your computer and use it in GitHub Desktop.
; ml /coff woke.asm /link /subsystem:console
.386
.model flat, stdcall
option casemap :none
include \masm32\include\kernel32.inc
include \masm32\include\windows.inc
includelib \masm32\lib\kernel32.lib
.code
start:
mov eax, 2
call SetThreadExecutionState
mov eax, -1
call Sleep
end start
// cl a.c /link /subsystem:windows /dynamicbase "kernel32.lib" "user32.lib"
#include <windows.h>
void WinMainCRTStartup() {
SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS);
Sleep(INFINITE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment