forked from scareing/UAC_wenpon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TokenSteal.h
69 lines (57 loc) · 1.14 KB
/
TokenSteal.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <iostream>
#include <Windows.h>
#include <winternl.h>
#include <psapi.h>
#include <tlhelp32.h>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <DbgHelp.h>
#include <comdef.h>
void Error(
_In_ DWORD lastError
);
DWORD FindPid(
_In_ std::wstring imageName
);
BOOL SetPrivilege(
_In_ HANDLE hToken, // access token handle
_In_ LPCTSTR lpszPrivilege, // name of privilege to enable/disable
_In_ BOOL bEnablePrivilege // to enable or disable privilege
);
bool UnhookDll(
_In_ std::string dllPath
);
typedef BOOL(WINAPI* pMiniDumpWriteDump)
(
HANDLE hProcess,
DWORD ProcessId,
HANDLE hFile,
MINIDUMP_TYPE DumpType,
PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
PMINIDUMP_CALLBACK_INFORMATION CallbackParam
);
namespace RAII
{
class Handle
{
public:
Handle(HANDLE inputHandle);
~Handle();
HANDLE GetHandle();
private:
HANDLE _internalHandle;
};
class Hmodule
{
public:
Hmodule(HMODULE inputHmodule);
~Hmodule();
HMODULE GetHmodule();
private:
HMODULE _internalHmodule;
};
};
int TokenSteal(char* arg, char* arg2);