Created
February 24, 2022 18:55
-
-
Save OlivierLaflamme/4d5bea0adb395d6b34c598884b5fef08 to your computer and use it in GitHub Desktop.
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
| #include <windows.h> | |
| #include <stdio.h> | |
| #define MIN_COUNT 10 | |
| CHAR current[256]; | |
| int main() { | |
| DWORD passed = 0; | |
| memset(current, 0x00, 256); | |
| while(passed < MIN_COUNT) { | |
| HWND hwnd = GetForegroundWindow(); | |
| CHAR *title = (CHAR*)GlobalAlloc(GPTR, 256); | |
| GetWindowTextA(hwnd, title, 256); | |
| if(strcmp(title, current) == 0) { | |
| passed++; | |
| } | |
| GlobalFree(title); | |
| } | |
| // You passed the user interaction check at this point code execute malicious code | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment