Function at 0x40f170
Capabilities:
Get common file path
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1024
call fcn.0040ace0
mov eax, dword [0x41a004]
xor eax, ebp
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
imul eax, eax, 0x78
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.004010f0
add esp, 0xc
push 0x800
lea edx, [ebp - 0x1018]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x416bd8
lea eax, [ebp - 0x1018]
push eax
call fcn.0040116a
add esp, 8
lea ecx, [ebp - 0x1018]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40f855
push str.LdrGetProcedureAddress
mov edx, dword [ebp + 8]
push edx
call fcn.004011c0
add esp, 8
push str.NtDeviceIoControlFile
mov eax, dword [ebp + 8]
add eax, 0x78
push eax
call fcn.004011c0
add esp, 8
push str.NtQueryDirectoryFile
mov ecx, dword [ebp + 8]
add ecx, 0xf0
push ecx
call fcn.004011c0
add esp, 8
push str.NtCreateFile
mov edx, dword [ebp + 8]
add edx, 0x168
push edx
call fcn.004011c0
add esp, 8
push str.NtDeleteFile
mov eax, dword [ebp + 8]
add eax, 0x1e0
push eax
call fcn.004011c0
add esp, 8
push str.NtCreateProcess
mov ecx, dword [ebp + 8]
add ecx, 0x258
push ecx
call fcn.004011c0
add esp, 8
push str.NtCreateProcessEx
mov edx, dword [ebp + 8]
add edx, 0x2d0
push edx
call fcn.004011c0
add esp, 8
push str.NtOpenFile
mov eax, dword [ebp + 8]
add eax, 0x348
push eax
call fcn.004011c0
add esp, 8
push str.NtSetInformationProcess
mov ecx, dword [ebp + 8]
add ecx, 0x438
push ecx
call fcn.004011c0
add esp, 8
push str.NtUnloadDriver
mov edx, dword [ebp + 8]
add edx, 0x4b0
push edx
call fcn.004011c0
add esp, 8
push str.NtWriteVirtualMemory
mov eax, dword [ebp + 8]
add eax, 0x528
push eax
call fcn.004011c0
add esp, 8
push str.LdrLoadDll
mov ecx, dword [ebp + 8]
add ecx, 0x5a0
push ecx
call fcn.004011c0
add esp, 8
push str.LdrUnloadDll
mov edx, dword [ebp + 8]
add edx, 0x618
push edx
call fcn.004011c0
add esp, 8
push 0x416ce4
mov eax, dword [ebp + 8]
add eax, 0x690
push eax
call fcn.004011c0
add esp, 8
push str.NtOpenProcessToken
mov ecx, dword [ebp + 8]
add ecx, 0x708
push ecx
call fcn.004011c0
add esp, 8
push str.NtTerminateThread
mov edx, dword [ebp + 8]
add edx, 0x780
push edx
call fcn.004011c0
add esp, 8
push str.NtQueryObject
mov eax, dword [ebp + 8]
add eax, 0x7f8
push eax
call fcn.004011c0
add esp, 8
push str.NtQueryInformationThread
mov ecx, dword [ebp + 8]
add ecx, 0x870
push ecx
call fcn.004011c0
add esp, 8
push str.NtQueryInformationProcess
mov edx, dword [ebp + 8]
add edx, 0x8e8
push edx
call fcn.004011c0
add esp, 8
push str.NtQuerySystemInformation
mov eax, dword [ebp + 8]
add eax, 0x960
push eax
call fcn.004011c0
add esp, 8
push str.NtOpenProcess
mov ecx, dword [ebp + 8]
add ecx, 0x9d8
push ecx
call fcn.004011c0
add esp, 8
push str.NtTerminateProcess
mov edx, dword [ebp + 8]
add edx, 0xa50
push edx
call fcn.004011c0
add esp, 8
push str.NtReadFile
mov eax, dword [ebp + 8]
add eax, 0xac8
push eax
call fcn.004011c0
add esp, 8
push str.NtQueryInformationFile
mov ecx, dword [ebp + 8]
add ecx, 0xb40
push ecx
call fcn.004011c0
add esp, 8
push str.NtReadVirtualMemory
mov edx, dword [ebp + 8]
add edx, 0xbb8
push edx
call fcn.004011c0
add esp, 8
push str.NtCreateKey
mov eax, dword [ebp + 8]
add eax, 0xc30
push eax
call fcn.004011c0
add esp, 8
push str.NtAdjustPrivilegesToken
mov ecx, dword [ebp + 8]
add ecx, 0xca8
push ecx
call fcn.004011c0
add esp, 8
push str.NtDeleteKey
mov edx, dword [ebp + 8]
add edx, 0xe10
push edx
call fcn.004011c0
add esp, 8
push str.NtDeleteValueKey
mov eax, dword [ebp + 8]
add eax, 0xe88
push eax
call fcn.004011c0
add esp, 8
push str.NtDuplicateObject
mov ecx, dword [ebp + 8]
add ecx, 0xf00
push ecx
call fcn.004011c0
add esp, 8
push str.NtDuplicateToken
mov edx, dword [ebp + 8]
add edx, 0xf78
push edx
call fcn.004011c0
add esp, 8
push str.NtEnumerateKey
mov eax, dword [ebp + 8]
add eax, 0xff0
push eax
call fcn.004011c0
add esp, 8
push 0x416e60
mov ecx, dword [ebp + 8]
add ecx, 0x1068
push ecx
call fcn.004011c0
add esp, 8
push str.NtEnumerateValueKey
mov edx, dword [ebp + 8]
add edx, 0x10e0
push edx
call fcn.004011c0
add esp, 8
push str.NtOpenKey
mov eax, dword [ebp + 8]
add eax, 0x1158
push eax
call fcn.004011c0
add esp, 8
push str.NtOpenThread
mov ecx, dword [ebp + 8]
add ecx, 0x11d0
push ecx
call fcn.004011c0
add esp, 8
push str.NtQueryKey
mov edx, dword [ebp + 8]
add edx, 0x1248
push edx
call fcn.004011c0
add esp, 8
push str.NtQueryValueKey
mov eax, dword [ebp + 8]
add eax, 0x12c0
push eax
call fcn.004011c0
add esp, 8
push str.NtQueryMultipleValueKey
mov ecx, dword [ebp + 8]
add ecx, 0x1338
push ecx
call fcn.004011c0
add esp, 8
push str.NtRenameKey
mov edx, dword [ebp + 8]
add edx, 0x13b0
push edx
call fcn.004011c0
add esp, 8
push str.NtReplaceKey
mov eax, dword [ebp + 8]
add eax, 0x1428
push eax
call fcn.004011c0
add esp, 8
push str.NtRestoreKey
mov ecx, dword [ebp + 8]
add ecx, 0x14a0
push ecx
call fcn.004011c0
add esp, 8
push str.NtSetValueKey
mov edx, dword [ebp + 8]
add edx, 0x1518
push edx
call fcn.004011c0
add esp, 8
push str.NtUnloadKey
mov eax, dword [ebp + 8]
add eax, 0x1590
push eax
call fcn.004011c0
add esp, 8
push str.NtLoadKey
mov ecx, dword [ebp + 8]
add ecx, 0x1608
push ecx
call fcn.004011c0
add esp, 8
push str.NtClose
mov edx, dword [ebp + 8]
add edx, 0x1680
push edx
call fcn.004011c0
add esp, 8
push str.NtWriteFile
mov eax, dword [ebp + 8]
add eax, 0x16f8
push eax
call fcn.004011c0
add esp, 8
push str.NtSaveKey
mov ecx, dword [ebp + 8]
add ecx, 0x1770
push ecx
call fcn.004011c0
add esp, 8
push str.NtSaveKeyEx
mov edx, dword [ebp + 8]
add edx, 0x17e8
push edx
call fcn.004011c0
add esp, 8
push str.NtSetInformationKey
mov eax, dword [ebp + 8]
add eax, 0x1860
push eax
call fcn.004011c0
add esp, 8
push str.NtSetInformationObject
mov ecx, dword [ebp + 8]
add ecx, 0x18d8
push ecx
call fcn.004011c0
add esp, 8
push str.NtSetInformationThread
mov edx, dword [ebp + 8]
add edx, 0x1950
push edx
call fcn.004011c0
add esp, 8
push str.NtSetInformationToken
mov eax, dword [ebp + 8]
add eax, 0x19c8
push eax
call fcn.004011c0
add esp, 8
push str.NtSetSecurityObject
mov ecx, dword [ebp + 8]
add ecx, 0x1a40
push ecx
call fcn.004011c0
add esp, 8
push str.NtVdmControl
mov edx, dword [ebp + 8]
add edx, 0x1ab8
push edx
call fcn.004011c0
add esp, 8
push str.RtlDosPathNameToNtPathName_U
mov eax, dword [ebp + 8]
add eax, 0x1b30
push eax
call fcn.004011c0
add esp, 8
push 0
push 0
push 3
push 0
push 1
push 0x80000000
lea ecx, [ebp - 0x1018]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1020], eax
cmp dword [ebp - 0x1020], 0xffffffff
je 0x40f84b
push 0
mov edx, dword [ebp - 0x1020]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
push 0
mov eax, dword [ebp - 8]
push eax
push 0
push 0x1000002
push 0
mov ecx, dword [ebp - 0x1020]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0x101c], eax
cmp dword [ebp - 0x101c], 0
je 0x40f83e
mov edx, dword [ebp - 8]
push edx
push 0
push 0
push 4
mov eax, dword [ebp - 0x101c]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x40f831
mov dword [ebp - 0x1024], 0
jmp 0x40f778
mov ecx, dword [ebp - 0x1024]
add ecx, 1
mov dword [ebp - 0x1024], ecx
mov edx, dword [ebp - 0x1024]
cmp edx, dword [ebp + 0xc]
jge 0x40f827
mov eax, dword [ebp - 0x1024]
imul eax, eax, 0x78
add eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0x1024]
imul edx, edx, 0x78
mov ecx, dword [ebp + 8]
mov dword [ecx + edx + 0x74], eax
mov edx, dword [ebp - 0x1024]
imul edx, edx, 0x78
mov eax, dword [ebp + 8]
cmp dword [eax + edx + 0x74], 0
je 0x40f822
mov ecx, dword [ebp - 0x1024]
imul ecx, ecx, 0x78
mov edx, dword [ebp + 8]
mov eax, dword [edx + ecx + 0x74]
sub eax, dword [ebp - 0xc]
add eax, dword [ebp - 4]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 4]
jb 0x40f80e
mov edx, dword [ebp - 4]
add edx, dword [ebp - 8]
cmp dword [ebp - 0x10], edx
jae 0x40f80e
push 0x10
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x1024]
imul ecx, ecx, 0x78
mov edx, dword [ebp + 8]
lea eax, [edx + ecx + 0x64]
push eax
call fcn.004012c0
add esp, 0xc
jmp 0x40f822
mov ecx, dword [ebp - 0x1024]
imul ecx, ecx, 0x78
mov edx, dword [ebp + 8]
mov dword [edx + ecx + 0x74], 0
jmp 0x40f769
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x101c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x1020]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004010d5
mov esp, ebp
pop ebp
ret