Skip to content

Commit

Permalink
add new imports for 1.1.14104.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taviso committed Aug 28, 2017
1 parent 85a4916 commit 0847ba8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions peloader/winapi/Files.c
Expand Up @@ -271,6 +271,12 @@ static BOOL WINAPI VerQueryValueW(PVOID pBlock, PWCHAR lpSubBlock, PVOID *lplpB
return FALSE;
}

static DWORD WINAPI QueryDosDevice(PVOID lpDeviceName, PVOID lpTargetPath, DWORD ucchMax)
{
DebugLog("");
return 0;
}


DECLARE_CRT_EXPORT("VerQueryValueW", VerQueryValueW);
DECLARE_CRT_EXPORT("GetFileVersionInfoExW", GetFileVersionInfoExW);
Expand All @@ -292,3 +298,4 @@ DECLARE_CRT_EXPORT("DeviceIoControl", DeviceIoControl);
DECLARE_CRT_EXPORT("NtQueryVolumeInformationFile", NtQueryVolumeInformationFile);
DECLARE_CRT_EXPORT("GetFullPathNameW", GetFullPathNameW);
DECLARE_CRT_EXPORT("SetEndOfFile", SetEndOfFile);
DECLARE_CRT_EXPORT("QueryDosDeviceW", QueryDosDevice);
6 changes: 5 additions & 1 deletion peloader/winapi/LoadLibrary.c
Expand Up @@ -37,7 +37,7 @@ static PVOID WINAPI GetProcAddress(HANDLE hModule, PCHAR lpProcName)
{
ENTRY key = { lpProcName }, *item;

assert(hModule == (HANDLE) NULL || hModule == (HANDLE) 'LOAD' || hModule == (HANDLE) 'MPEN' || hModule == (HANDLE) 'VERS');
assert(hModule == (HANDLE) NULL || hModule == (HANDLE) 'LOAD' || hModule == (HANDLE) 'MPEN' || hModule == (HANDLE) 'VERS' || hModule == (HANDLE) 'KERN');

if (hsearch_r(key, FIND, &item, &crtexports)) {
return item->data;
Expand All @@ -64,6 +64,10 @@ static HANDLE WINAPI GetModuleHandleW(PVOID lpModuleName)

if (lpModuleName && memcmp(lpModuleName, L"KERNEL32.DLL", sizeof(L"KERNEL32.DLL")) == 0)
return (HANDLE) 'KERN';

if (lpModuleName && memcmp(lpModuleName, L"kernel32.dll", sizeof(L"kernel32.dll")) == 0)
return (HANDLE) 'KERN';

if (lpModuleName && memcmp(lpModuleName, L"version.dll", sizeof(L"version.dll")) == 0)
return (HANDLE) 'VERS';
return (HANDLE) NULL;
Expand Down
7 changes: 7 additions & 0 deletions peloader/winapi/ProcessThreads.c
Expand Up @@ -166,6 +166,12 @@ static BOOL WINAPI SetThreadToken(PHANDLE Thread, HANDLE Token)
return FALSE;
}

static BOOL WINAPI ProcessIdToSessionId(DWORD dwProcessId, DWORD *pSessionId)
{
DebugLog("");
return FALSE;
}

DECLARE_CRT_EXPORT("RtlNtStatusToDosError", RtlNtStatusToDosError);
DECLARE_CRT_EXPORT("GetThreadTimes", GetThreadTimes);
DECLARE_CRT_EXPORT("GetCurrentThread", GetCurrentThread);
Expand All @@ -186,3 +192,4 @@ DECLARE_CRT_EXPORT("SetThreadpoolTimer", SetThreadpoolTimer);
DECLARE_CRT_EXPORT("WaitForThreadpoolTimerCallbacks", WaitForThreadpoolTimerCallbacks);
DECLARE_CRT_EXPORT("GetCurrentThreadId", GetCurrentThreadId);
DECLARE_CRT_EXPORT("GetCurrentProcessId", GetCurrentProcessId);
DECLARE_CRT_EXPORT("ProcessIdToSessionId", ProcessIdToSessionId);
6 changes: 6 additions & 0 deletions peloader/winapi/SystemTime.c
Expand Up @@ -58,9 +58,15 @@ STATIC DWORD WINAPI GetTickCount(VOID)
return 0;
}

STATIC BOOL WINAPI QueryPerformanceFrequency(PVOID lpFrequency)
{
return FALSE;
}

DECLARE_CRT_EXPORT("GetSystemTime", GetSystemTime);
DECLARE_CRT_EXPORT("SystemTimeToFileTime", SystemTimeToFileTime);
DECLARE_CRT_EXPORT("GetSystemTimePreciseAsFileTime", GetSystemTimePreciseAsFileTime);
DECLARE_CRT_EXPORT("GetSystemTimeAsFileTime", GetSystemTimeAsFileTime);
DECLARE_CRT_EXPORT("QueryPerformanceCounter", QueryPerformanceCounter);
DECLARE_CRT_EXPORT("QueryPerformanceFrequency", QueryPerformanceFrequency);
DECLARE_CRT_EXPORT("GetTickCount", GetTickCount);

0 comments on commit 0847ba8

Please sign in to comment.