Function at 0x402680
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x138
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
push esi
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
push 0x103
mov dword [eax], ebx
lea eax, [ebp - 0x137]
push ebx
push eax
mov byte [ebp - 0x138], bl
call fcn.00425710
add esp, 0xc
push 0x104
lea eax, [ebp - 0x138]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push ebx
push ebx
push 3
push ebx
push 5
push SysReAllocStringLen
lea eax, [ebp - 0x138]
push eax
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 4], esi
jne 0x4026f5
xor eax, eax
jmp 0x402866
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push ebx
push 0x3c
push esi
call edi
push ebx
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x10]
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
call esi
push ebx
push ebx
push dword [ebp - 0x10]
push dword [ebp - 4]
call edi
push ebx
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 4]
call esi
cmp dword [ebp - 0x20], 0x4550
jne 0x402852
mov eax, dword [ebp - 0x10]
push ebx
add eax, 0x18
push ebx
push eax
push dword [ebp - 4]
mov dword [ebp - 8], eax
mov dword [ebp - 0x14], ebx
call edi
push ebx
lea eax, [ebp - 0xc]
push eax
push 2
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 4]
call esi
cmp word [ebp - 0x14], 0x10b
jne 0x402773
add dword [ebp - 8], 0x80
jmp 0x402787
cmp word [ebp - 0x14], 0x20b
jne 0x402784
add dword [ebp - 8], 0x90
jmp 0x402787
mov dword [ebp - 8], ebx
cmp dword [ebp - 8], ebx
je 0x402852
push ebx
push ebx
push dword [ebp - 8]
push dword [ebp - 4]
call edi
push ebx
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 4]
call esi
push ebx
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x1c]
add eax, ecx
mov dword [ebp - 8], eax
xor eax, eax
cmp ecx, ebx
mov dword [ebp - 0x34], ebx
lea edi, [ebp - 0x30]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov dword [ebp - 0x18], ebx
jne 0x4027e4
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
push ebx
push ebx
add eax, 0xfffffff0
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x18]
push eax
push 0x10
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 4]
call esi
cmp dword [ebp - 0x34], ebx
jne 0x402852
cmp dword [ebp - 0x30], ebx
jne 0x402852
cmp dword [ebp - 0x2c], ebx
jne 0x402852
mov eax, dword [ebp - 0x28]
cmp eax, ebx
je 0x402852
mov edi, dword [ebp + 0xc]
push eax
mov dword [edi], eax
call fcn.0041fa52
pop ecx
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
mov eax, dword [ebp - 8]
sub eax, dword [edi]
push ebx
push ebx
sub eax, 0x10
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x18]
push eax
push dword [edi]
mov eax, dword [ebp + 8]
push dword [eax]
push dword [ebp - 4]
call esi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp + 8]
xor eax, eax
cmp dword [ecx], ebx
pop edi
setne al
pop esi
pop ebx
leave
ret