C++ Compiler Errors

closed account (iEwfjE8b)
I'm trying to compile https://www.exploit-db.com/exploits/37098/ to test on my WinXP VM but i'm getting the following compiler errors. Any ideas on how i can resolve these? Thanks!

root@kali:~/.wine/drive_c/MinGW/bin# wine g++ ex.cpp -o ex.exe
ex.h:9:20: error: typedef 'NTSTATUS' is initialized (use decltype instead)
typedef NTSTATUS ( WINAPI *_ZwAllocateVirtualMemory ) (
^
ex.h:9:20: error: expected primary-expression before '__attribute__'
typedef NTSTATUS ( WINAPI *_ZwAllocateVirtualMemory ) (
^
ex.h:18:20: error: typedef 'NTSTATUS' is initialized (use decltype instead)
typedef NTSTATUS ( WINAPI *_PsLookupProcessByProcessId ) (
^
ex.h:18:20: error: expected primary-expression before '__attribute__'
typedef NTSTATUS ( WINAPI *_PsLookupProcessByProcessId ) (
^
In file included from ex.cpp:14:0:
ex.h:24:5: warning: '__stdcall__' attribute only applies to function types [-Wattributes]
_Inout_ PVOID Process
^
ex.h:24:5: error: typedef '_PsReferencePrimaryToken' is initialized (use decltype instead)
ex.h:24:5: error: '_Inout_' was not declared in this scope
ex.h:32:20: error: typedef 'NTSTATUS' is initialized (use decltype instead)
typedef NTSTATUS ( WINAPI *_ZwQuerySystemInformation ) (
^
ex.h:32:20: error: expected primary-expression before '__attribute__'
typedef NTSTATUS ( WINAPI *_ZwQuerySystemInformation ) (
^
ex.cpp:16:1: error: '_ZwAllocateVirtualMemory' does not name a type
_ZwAllocateVirtualMemory ZwAllocateVirtualMemory;
^
ex.cpp:17:1: error: '_PsLookupProcessByProcessId' does not name a type
_PsLookupProcessByProcessId PsLookupProcessByProcessId;
^
ex.cpp:18:1: error: '_PsReferencePrimaryToken' does not name a type
_PsReferencePrimaryToken PsReferencePrimaryToken;
^
ex.cpp: In function 'DWORD_PTR pti()':
ex.cpp:29:47: error: '__readfsdword' was not declared in this scope
LPBYTE p = ( LPBYTE ) __readfsdword( 0x18 );
^
ex.cpp: In function 'BOOL Init()':
ex.cpp:67:5: error: '__try' was not declared in this scope
__try {
^
ex.cpp:67:11: error: expected ';' before '{' token
__try {
^
ex.cpp:286:1: error: expected '}' at end of input
}
^
closed account (iEwfjE8b)
Issue solved (not by myself) by using the Visual Studio Developer Command Line and compiling with the command "cl ex.cpp /link kernel32.lib shell32.lib user32.lib"
Topic archived. No new replies allowed.