2.0.488
This commit is contained in:
vxunderground
2022-12-17 16:45:33 -06:00
parent abfecdda83
commit 1e198d4dd8
11 changed files with 340 additions and 3 deletions
@@ -0,0 +1,44 @@
#include "Win32Helper.h"
ULONG ConvertCharacterStringToIntegerUsingNtdllA(_In_ PCHAR InString)
{
RTLCHARTOINTEGER RtlCharToInteger = NULL;
HMODULE hModule = NULL;
ULONG ConvertedString = ERROR_SUCCESS;
hModule = GetModuleHandleEx2W(L"ntdll.dll");
if (hModule == NULL)
return 0;
RtlCharToInteger = (RTLCHARTOINTEGER)GetProcAddressA((DWORD64)hModule, "RtlCharToInteger");
if (!RtlCharToInteger)
return 0;
if (RtlCharToInteger(InString, 10, &ConvertedString) != STATUS_SUCCESS)
return 0;
return ConvertedString;
}
ULONG ConvertCharacterStringToIntegerUsingNtdllW(_In_ PWCHAR InString)
{
RTLCHARTOINTEGER RtlCharToInteger = NULL;
HMODULE hModule = NULL;
ULONG ConvertedString = ERROR_SUCCESS;
CHAR pBuffer[MAX_PATH] = { 0 };
hModule = GetModuleHandleEx2W(L"ntdll.dll");
if (hModule == NULL)
return 0;
RtlCharToInteger = (RTLCHARTOINTEGER)GetProcAddressA((DWORD64)hModule, "RtlCharToInteger");
if (!RtlCharToInteger)
return 0;
WCharStringToCharString(pBuffer, InString, StringLengthW((PWCHAR)InString));
if (RtlCharToInteger(pBuffer, 10, &ConvertedString) != STATUS_SUCCESS)
return 0;
return ConvertedString;
}