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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x70
mov eax, dword [0x499020]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x4c], eax
xor eax, eax
push ebx
xor ebx, ebx
push esi
push edi
mov ecx, dword [ebp + 0xc]
lea edi, [ebp - 0x38]
mov dword [ebp - 0x3c], ebx
stosd dword es:[edi], eax
mov esi, dword [ebp + 8]
lea edi, [ebp - 0x30]
mov byte [ebp - 0x14], bl
mov dword [ebp - 0x34], ebx
stosd dword es:[edi], eax
lea edi, [ebp - 0x13]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [ebp - 0x1c], bl
lea edi, [ebp - 0x1b]
stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x2c], ebx
stosb byte es:[edi], al
cmp ecx, ebx
je 0x40a1ed
cmp esi, ebx
je 0x40a1ed
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocStringLen
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x20], esi
cmp esi, 0xffffffff
je 0x40a1ed
lea eax, [ebp - 0x30]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
push eax
push dword [ebp - 0x30]
mov dword [ebp - 0x34], eax
push 2
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov edi, eax
cmp edi, ebx
jne 0x40a1fe
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045c0da
leave
ret
push dword [ebp - 0x34]
push ebx
push ebx
push 4
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
jne 0x40a220
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
push dword [ebp - 0x20]
call esi
jmp 0x40a1ed
mov ecx, dword [eax + 0x3c]
lea ecx, [ecx + eax + 4]
mov edx, 0x14c
lea esi, [ecx + 0x14]
cmp word [ecx], dx
je 0x40a248
mov edx, 0x20b
cmp word [esi], dx
jne 0x40a25c
movzx edx, word [ecx + 0x10]
lea edx, [edx + ecx + 0x14]
jmp 0x40a258
mov edx, 0x10b
cmp word [esi], dx
jne 0x40a25c
movzx edx, word [ecx + 0x10]
add edx, esi
cmp edx, ebx
jne 0x40a265
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x40a210
movzx ecx, word [ecx + 2]
imul ecx, ecx, 0x28
lea ecx, [edx + ecx - 0x28]
mov edx, dword [ecx + 0x14]
add edx, dword [ecx + 0x10]
push eax
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x38]
jg 0x40a2a2
jl 0x40a219
mov eax, dword [ebp - 0x34]
cmp eax, dword [ebp - 0x3c]
jbe 0x40a219
mov edi, 0xa0000
push edi
call fcn.0043da44
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40a219
push ebx
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 0x3c]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40a319
mov eax, dword [ebp - 0x14]
or eax, dword [ebp - 0x10]
jne 0x40a2f4
mov eax, dword [ebp - 0xc]
or eax, dword [ebp - 8]
jne 0x40a2f4
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x28]
call fcn.00405340
add esp, 0xc
push dword [ebp - 0x24]
push dword [ebp - 0x28]
push dword [ebp - 0x40]
call fcn.00409f3f
push dword [ebp - 0x24]
mov dword [ebp - 0x40], eax
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
call fcn.0040a023
add esp, 0x18
mov dword [ebp - 0x2c], eax
push ebx
lea eax, [ebp - 0x24]
push eax
push edi
push dword [ebp - 0x28]
push dword [ebp - 0x20]
call esi
cmp dword [ebp - 0x24], ebx
jne 0x40a2d2
cmp dword [ebp - 0x44], ebx
je 0x40a342
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x44]
call fcn.0045d240
add esp, 0xc
mov eax, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x40]
push dword [ebp - 0x28]
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], eax
call fcn.0043da39
pop ecx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x48]
mov dword [eax], esi
push 8
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x4c]
call fcn.0045d240
xor eax, eax
add esp, 0xc
inc eax
jmp 0x40a1ef