Function at 0x402aa3
Capabilities:
Get file size
Get system information on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x148
mov eax, dword [ebp + 0x18]
push ebx
xor ebx, ebx
mov dword [eax], ebx
mov dword [ebp - 0x10], 1
cmp dword [ebp + 0xc], ebx
jne 0x402ac7
xor eax, eax
jmp 0x402d16
push esi
push edi
lea eax, [ebp - 0x44]
push eax
call dword [sym.imp.KERNEL32.DLL_GetSystemInfo]
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x28]
ja 0x402cfd
mov edi, dword [ebp + 8]
add edi, 0x99
mov esi, 0x104
lea eax, [ebp - 0x148]
push esi
cmp dword [edi], ebx
je 0x402b4e
push ebx
push eax
call sub.ntdll.dll_memset
add esp, 0xc
cmp edi, ebx
je 0x402b93
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402b11
sub eax, edx
je 0x402b93
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402b21
sub eax, edx
cmp eax, esi
jb 0x402b35
mov eax, 0x103
jmp 0x402b43
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402b3a
sub eax, edx
push eax
push edi
lea eax, [ebp - 0x148]
push eax
jmp 0x402b8b
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
push esi
push ebx
push edi
call sub.ntdll.dll_memset
lea eax, [ebp - 0x148]
add esp, 0xc
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x402b6c
sub eax, ecx
cmp eax, ebx
je 0x402b93
cmp eax, esi
jb 0x402b82
mov eax, 0x103
push eax
lea eax, [ebp - 0x148]
push eax
push edi
call sub.ntdll.dll_memcpy
add esp, 0xc
push ebx
push 0x10000000
push 3
push ebx
push 1
push 0x80000000
lea eax, [ebp - 0x148]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov esi, eax
mov dword [ebp - 8], esi
cmp esi, 0xffffffff
je 0x402cfd
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xc]
push eax
push esi
call fcn.0040279e
add esp, 0x14
test eax, eax
jne 0x402be7
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x402cfd
push ebx
push esi
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x402bdb
push ebx
push eax
push ebx
push 2
push ebx
push esi
call dword [sym.imp.KERNEL32.DLL_CreateFileMappingA]
mov dword [ebp - 4], eax
cmp eax, ebx
je 0x402bdb
mov edi, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x28]
mov ecx, edi
sub ecx, dword [ebp - 0xc]
xor edx, edx
sub ecx, dword [ebp + 0xc]
mov eax, ecx
div ebx
mov edx, dword [ebp + 0x14]
lea esi, [eax + 1]
imul esi, ebx
sub esi, ecx
cmp esi, dword [edx]
jae 0x402c37
mov dword [ebp - 0x10], 2
add esi, ebx
add ecx, esi
cmp ecx, dword [ebp - 0x18]
jbe 0x402c55
cmp dword [ebp - 0x10], 2
jne 0x402ced
sub esi, ebx
mov ecx, edx
mov dword [ebp - 0x10], 1
mov dword [ecx], esi
mov ecx, ebx
imul eax, ebx
imul ecx, dword [ebp - 0x10]
push ecx
push eax
push 0
push 4
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_MapViewOfFile]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x402ced
mov ebx, dword [ebp + 0x14]
mov eax, dword [ebx]
test eax, eax
je 0x402c90
inc eax
push eax
push 8
call dword [sym.imp.KERNEL32.DLL_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.DLL_HeapAlloc]
jmp 0x402c92
xor eax, eax
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
test eax, eax
jne 0x402ca6
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_UnmapViewOfFile]
jmp 0x402ced
mov ecx, dword [ebp - 0x28]
imul ecx, dword [ebp - 0x10]
push dword [ebx]
sub ecx, esi
add ecx, dword [ebp - 0xc]
push ecx
push eax
call sub.ntdll.dll_memcpy
add esp, 0xc
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_UnmapViewOfFile]
push dword [ebp - 0x1c]
mov eax, dword [ebp + 0x18]
push dword [ebp - 0x20]
sub edi, dword [ebp + 0xc]
push dword [ebp - 0x14]
push dword [ebx]
push dword [eax]
push edi
push dword [ebp - 4]
push dword [ebp + 0xc]
call fcn.004029c2
add esp, 0x20
test eax, eax
jne 0x402d01
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 8]
call esi
xor eax, eax
jmp 0x402d14
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.DLL_CloseHandle]
call esi
push dword [ebp - 8]
call esi
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret