-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdllmain.h
31 lines (27 loc) · 1.13 KB
/
dllmain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Copyright (c) Anthony Beaumont
This source code is licensed under the MIT License
found in the LICENSE file in the root directory of this source tree.
*/
#include <Windows.h>
#include <Psapi.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iostream>
#include "vendor/Detour/detours.h"
#if defined(_X86_)
#pragma comment(lib, "vendor/Detour/detours.x86.lib")
#elif defined(_AMD64_)
#pragma comment(lib, "vendor/Detour/detours.x64.lib")
#endif
typedef int (WSAAPI *send_t)(SOCKET s, const char *buf, int len, int flags);
typedef struct hostent* (WSAAPI *gethostbyname_t)(const char *name);
typedef HINSTANCE(WINAPI* ShellExecuteW_t)(HWND, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, INT);
HINSTANCE WINAPI detourShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
int WSAAPI detourSend(SOCKET s, const char *buf, int len, int flags);
struct hostent* WSAAPI detourGetHostByName(const char *name);
bool ModifyPublicKey();
void enableConsole();
bool setDetours();
DWORD WINAPI Main(LPVOID lpReserved);
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved);