3
3
4
4
#include " stdafx.h"
5
5
6
- bool AddDllToBlacklist (const wchar_t * dll_name) { return true ; }
6
+ void __stdcall LoadAPI (LPVOID* destination, LPCSTR apiName)
7
+ {
8
+ if (*destination)
9
+ return ;
10
+
11
+ char path[MAX_PATH];
12
+ // wchar_t windows[MAX_PATH];
13
+ // GetSystemDirectoryW(windows, MAX_PATH);
14
+ // wsprintf(path, L"%s\\netutils.dll", windows);
15
+ wsprintf (path, " .\\ chrome_elf.dll.bak" );
16
+ HMODULE hModule = GetModuleHandle (path);
17
+ if (!hModule && !(hModule = LoadLibrary (path)))
18
+ return ;
19
+ *destination = GetProcAddress (hModule, apiName);
20
+ }
21
+
22
+ #define API_EXPORT_ORIG (N ) \
23
+ static LPVOID _##N = NULL ; \
24
+ char S_##N[] = " " # N; \
25
+ extern " C" __declspec(dllexport) __declspec(naked) void N ## () \
26
+ { \
27
+ __asm pushad \
28
+ __asm push offset S_##N \
29
+ __asm push offset _##N \
30
+ __asm call LoadAPI \
31
+ __asm popad \
32
+ __asm jmp [_##N] \
33
+ } \
34
+
35
+
36
+ API_EXPORT_ORIG (ClearReportsBetween_ExportThunk)
37
+ API_EXPORT_ORIG (CrashForException_ExportThunk)
38
+ API_EXPORT_ORIG (DisableHook)
39
+ API_EXPORT_ORIG (DrainLog)
40
+ API_EXPORT_ORIG (DumpHungProcessWithPtype_ExportThunk)
41
+ API_EXPORT_ORIG (DumpProcessWithoutCrash)
42
+ API_EXPORT_ORIG (GetApplyHookResult)
43
+ API_EXPORT_ORIG (GetBlockedModulesCount)
44
+ API_EXPORT_ORIG (GetCrashReports_ExportThunk)
45
+ API_EXPORT_ORIG (GetCrashpadDatabasePath_ExportThunk)
46
+ API_EXPORT_ORIG (GetHandleVerifier)
47
+ API_EXPORT_ORIG (GetInstallDetailsPayload)
48
+ API_EXPORT_ORIG (GetUniqueBlockedModulesCount)
49
+ API_EXPORT_ORIG (GetUserDataDirectoryThunk)
50
+ API_EXPORT_ORIG (InjectDumpForHungInput_ExportThunk)
51
+ API_EXPORT_ORIG (IsBrowserProcess)
52
+ API_EXPORT_ORIG (IsCrashReportingEnabledImpl)
53
+ API_EXPORT_ORIG (IsThirdPartyInitialized)
54
+ API_EXPORT_ORIG (RegisterLogNotification)
55
+ API_EXPORT_ORIG (RequestSingleCrashUpload_ExportThunk)
56
+ API_EXPORT_ORIG (SetCrashKeyValueImpl)
57
+ API_EXPORT_ORIG (SetMetricsClientId)
58
+ API_EXPORT_ORIG (SetUploadConsent_ExportThunk)
59
+ API_EXPORT_ORIG (SignalChromeElf)
60
+ API_EXPORT_ORIG (SignalInitializeCrashReporting)
61
+
62
+ #define API_COPY (M, N ) \
63
+ _##N = GetProcAddress(M, #N);
64
+
65
+
66
+ /*
67
+ //bool AddDllToBlacklist (const wchar_t* dll_name) { return true; }
7
68
void ClearReportsBetween_ExportThunk (time_t begin, time_t end) {}
8
69
9
70
int CrashForException_ExportThunk (EXCEPTION_POINTERS* info) {
10
- return EXCEPTION_CONTINUE_SEARCH ;
71
+ return UnhandledExceptionFilter (info) ;
11
72
}
73
+
74
+
12
75
void DisableHook () {}
13
76
14
- UINT32 DrainLog (UINT8* buffer,
15
- UINT32 buffer_size,
16
- UINT32* log_remaining) {
77
+ uint32_t DrainLog (uint8_t* buffer,
78
+ uint32_t buffer_size,
79
+ uint32_t* log_remaining) {
80
+ return 0;
17
81
18
- return 0 ;
19
82
}
20
83
21
84
bool DumpHungProcessWithPtype_ExportThunk (HANDLE process_handle,
@@ -25,8 +88,9 @@ bool DumpHungProcessWithPtype_ExportThunk (HANDLE process_handle,
25
88
26
89
void DumpProcessWithoutCrash (void* task_port) {}
27
90
28
- INT32 GetApplyHookResult () { return 0 ; }
29
- UINT32 GetBlockedModulesCount () { return 0 ; }
91
+ int32_t GetApplyHookResult () { return 0; }
92
+
93
+ uint32_t GetBlockedModulesCount () { return 0; }
30
94
31
95
size_t GetCrashReports_ExportThunk (void* reports,
32
96
size_t reports_size) {
@@ -36,36 +100,49 @@ size_t GetCrashReports_ExportThunk (void* reports,
36
100
const wchar_t* GetCrashpadDatabasePath_ExportThunk () {
37
101
return nullptr;
38
102
}
39
- void * GetHandleVerifier () {
103
+
104
+ void* GetHandleVerifier () { return NULL; };
105
+
106
+ const void* GetInstallDetailsPayload () {
40
107
return nullptr;
41
108
}
42
- UINT32 GetInstallDetailsPayload () { return 0 ; }
43
- UINT32 GetUniqueBlockedModulesCount () { return 0 ; }
109
+
110
+ uint32_t GetUniqueBlockedModulesCount () {
111
+ return 0;
112
+ }
113
+
44
114
bool GetUserDataDirectoryThunk (wchar_t* user_data_dir,
45
115
size_t user_data_dir_length,
46
116
wchar_t* invalid_user_data_dir,
47
117
size_t invalid_user_data_dir_length) {
48
118
return true;
49
119
}
120
+
50
121
HANDLE InjectDumpForHungInput_ExportThunk (HANDLE process) {
51
122
return nullptr;
52
123
}
53
- bool IsBlacklistInitialized () {
54
- return false ;
124
+
125
+ bool IsBrowserProcess () {
126
+ return true;
55
127
}
56
- bool IsCrashReportingEnabledImpl () {
128
+
129
+ bool IsCrashReportingEnabledImpl (const void* local_state) {
57
130
return false;
58
131
}
59
132
bool IsThirdPartyInitialized () {
60
133
return false;
61
134
}
135
+
62
136
bool RegisterLogNotification (HANDLE event_handle) {
63
137
return false;
64
138
}
65
139
void RequestSingleCrashUpload_ExportThunk (const char* local_id) {}
66
- void SetCrashKeyValueImpl () {}
140
+ void SetCrashKeyValueImpl (const char*, const char* ) {}
67
141
void SetMetricsClientId (const char* client_id) {}
142
+
68
143
void SetUploadConsent_ExportThunk (bool consent) {}
69
144
void SignalChromeElf () {}
70
145
void SignalInitializeCrashReporting () {}
71
- void SuccessfullyBlocked (const wchar_t ** blocked_dlls, int * size) {}
146
+ //void SuccessfullyBlocked (const wchar_t** blocked_dlls, int* size) {}
147
+
148
+ */
0 commit comments