Skip to content

Commit 56f9c1a

Browse files
committed
Added demo: pop_calc
1 parent 71fcb25 commit 56f9c1a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

demos/pop_calc.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <Windows.h>
2+
#include "peb_lookup.h"
3+
4+
int main()
5+
{
6+
LPVOID base = get_module_by_name((const LPWSTR)L"kernel32.dll");
7+
if (!base) {
8+
return 1;
9+
}
10+
auto _WinExec = reinterpret_cast<decltype(&WinExec)>(get_func_by_name((HMODULE)base, (LPSTR)"WinExec"));
11+
if (!_WinExec) return 4;
12+
13+
_WinExec("calc.exe", SW_SHOWNORMAL);
14+
return 0;
15+
}

0 commit comments

Comments
 (0)