Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual studio 2019 build was fixed #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions mimikatz/modules/kuhl_m_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
#include "kuhl_m_ts.h"

#include <inttypes.h>

const KUHL_M_C kuhl_m_c_ts[] = {
{kuhl_m_ts_multirdp, L"multirdp", L"[experimental] patch Terminal Server service to allow multiples users"},
{kuhl_m_ts_sessions, L"sessions", NULL},
Expand Down Expand Up @@ -477,15 +479,15 @@ void kuhl_m_ts_mstsc_MemoryAnalysis_property(PKULL_M_MEMORY_HANDLE hMemory, PVOI
switch(pProperties[i].dwType)
{
case 1:
kprintf(L"[ dword ] %u (0x%08x)", (DWORD) pProperties[i].pvData, (DWORD) pProperties[i].pvData);
kprintf(L"[ dword ] %u (0x%08x)", (DWORD)(uintptr_t) pProperties[i].pvData, (DWORD)(uintptr_t)pProperties[i].pvData);
break;

case 2:
kprintf(L"[ word? ] %u (0x%04x)", (WORD) pProperties[i].pvData, (WORD) pProperties[i].pvData);
kprintf(L"[ word? ] %u (0x%04x)", (WORD)(uintptr_t) pProperties[i].pvData, (WORD) pProperties[i].pvData);
break;

case 3:
kprintf(L"[ bool ] %s", ((BOOL) pProperties[i].pvData) ? L"TRUE" : L"FALSE");
kprintf(L"[ bool ] %s", ((BOOL)(uintptr_t) pProperties[i].pvData) ? L"TRUE" : L"FALSE");
break;

case 4:
Expand All @@ -501,26 +503,26 @@ void kuhl_m_ts_mstsc_MemoryAnalysis_property(PKULL_M_MEMORY_HANDLE hMemory, PVOI

case 6:
kprintf(L"[protect] ");
if(pProperties[i].pvData && (DWORD) pProperties[i].unkp2)
if(pProperties[i].pvData && (DWORD)(uintptr_t)pProperties[i].unkp2)
{
aDataBuffer.address = (PBYTE) LocalAlloc(LPTR, (DWORD) pProperties[i].unkp2);
aDataBuffer.address = (PBYTE) LocalAlloc(LPTR, (DWORD)(uintptr_t) pProperties[i].unkp2);

if(aDataBuffer.address)
{
aProcess.address = pProperties[i].pvData;
if(kull_m_memory_copy(&aDataBuffer, &aProcess, (DWORD) pProperties[i].unkp2))
if(kull_m_memory_copy(&aDataBuffer, &aProcess, (DWORD)(uintptr_t) pProperties[i].unkp2))
{
if(pProperties[i].dwFlags & 0x800)
{
if(kull_m_crypto_remote_CryptUnprotectMemory(aProcess.hMemory, aDataBuffer.address, (DWORD) pProperties[i].unkp2, CRYPTPROTECTMEMORY_SAME_PROCESS))
if(kull_m_crypto_remote_CryptUnprotectMemory(aProcess.hMemory, aDataBuffer.address, (DWORD)(uintptr_t) pProperties[i].unkp2, CRYPTPROTECTMEMORY_SAME_PROCESS))
{
kprintf(L"\'%.*s\'", *(PDWORD) aDataBuffer.address / sizeof(wchar_t), ((PBYTE) aDataBuffer.address) + sizeof(DWORD));
}
else PRINT_ERROR(L"CryptUnprotectMemory");
}
else
{
kull_m_string_wprintf_hex(aDataBuffer.address, (DWORD) pProperties[i].unkp2, 0);
kull_m_string_wprintf_hex(aDataBuffer.address, (DWORD)(uintptr_t) pProperties[i].unkp2, 0);
}
}
LocalFree(aDataBuffer.address);
Expand Down
3 changes: 3 additions & 0 deletions modules/rpc/kull_m_rpc_ms-rprn.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#define PRINTER_CHANGE_ADD_JOB 0x00000100
#define PRINTER_CHANGE_ALL 0x7777FFFF
*/
#ifdef PRINTER_NOTIFY_CATEGORY_ALL
# undef PRINTER_NOTIFY_CATEGORY_ALL
#endif // PRINTER_NOTIFY_CATEGORY_ALL
#define PRINTER_NOTIFY_CATEGORY_ALL 0x00010000
#define APD_INSTALL_WARNED_DRIVER 0x00008000

Expand Down