mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
2.0.488
2.0.488
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user