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

Disassembly:
sub esp, 0x18
push ebx
mov ebx, ecx
push ebp
push esi
mov eax, dword [ebx + 0x24]
push edi
test eax, eax
je 0x402035
call fcn.00402360
mov eax, dword [esp + 0x30]
test eax, eax
je 0x40204d
mov dword [ebx + 0x28], 1
mov eax, 0xc0000000
xor ecx, ecx
jmp 0x40205e
mov dword [ebx + 0x28], 0
mov eax, 0x80000000
mov ecx, 1
mov edi, dword [esp + 0x2c]
push 0
push 0x80
push 3
push 0
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebx + 0x24], eax
jne 0x402091
pop edi
pop esi
mov dword [ebx + 0x2c], 0x3e8
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 8
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebx + 0x34]
mov eax, ecx
mov esi, edi
mov edi, edx
push 0
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [ebx + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
push 0
push 0
mov dword [esp + 0x20], edi
lea eax, [edi - 8]
push eax
push edx
mov dword [esp + 0x20], eax
call ebp
cmp dword [esp + 0x10], 0xffffffff
jne 0x4020f5
pop edi
pop esi
mov dword [ebx + 0x2c], 0xc8
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 8
mov edx, dword [ebx + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x28]
push 8
push ecx
push edx
call esi
test eax, eax
jne 0x402124
pop edi
pop esi
mov dword [ebx + 0x2c], 0xc8
pop ebp
pop ebx
add esp, 0x18
ret 8
cmp dword [esp + 0x20], 0x29263d27
jne 0x40230c
cmp dword [esp + 0x24], 0x363c2531
jne 0x40230c
mov eax, dword [ebx + 0x24]
add edi, 0xfffffff4
push 0
push 0
push edi
push eax
mov dword [esp + 0x40], edi
call ebp
mov edx, dword [ebx + 0x24]
lea ecx, [esp + 0x30]
push 0
lea edi, [ebx + 4]
push ecx
push 4
push edi
push edx
call esi
test eax, eax
jne 0x40217a
pop edi
pop esi
mov dword [ebx + 0x2c], 0xc8
pop ebp
pop ebx
add esp, 0x18
ret 8
mov eax, dword [edi]
mov ecx, dword [ebx + 0x24]
push 0
push 0
push eax
push ecx
call ebp
cmp dword [esp + 0x30], 0xffffffff
jne 0x4021a1
pop edi
pop esi
mov dword [ebx + 0x2c], 0xc8
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 8
mov ecx, dword [ebx + 0x24]
lea edx, [esp + 0x30]
push 0
push edx
lea eax, [esp + 0x1c]
push 4
push eax
push ecx
call esi
test eax, eax
jne 0x4021cc
pop edi
pop esi
mov dword [ebx + 0x2c], 0xc8
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 8
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x402308
mov dword [esp + 0x2c], 0
push 0x10
call fcn.00402987
xor ebp, ebp
add esp, 4
cmp eax, ebp
je 0x4021fd
mov dword [eax], ebp
mov dword [eax + 4], ebp
mov dword [eax + 8], ebp
mov dword [eax + 0xc], ebp
mov ebp, eax
mov eax, dword [ebx + 0x24]
lea edx, [esp + 0x30]
push 0
push edx
push 4
push ebp
push eax
call esi
test eax, eax
je 0x4021b9
mov eax, dword [ebp]
test eax, eax
jbe 0x402245
cmp eax, 0x1f4
jae 0x402245
push eax
call fcn.00402987
mov edx, dword [ebp]
add esp, 4
lea ecx, [esp + 0x30]
mov dword [ebp + 4], eax
push 0
push ecx
push edx
push eax
mov eax, dword [ebx + 0x24]
push eax
call esi
test eax, eax
je 0x4021b9
mov eax, dword [ebx + 0x24]
lea ecx, [esp + 0x30]
push 0
push ecx
lea edx, [ebp + 8]
push 4
push edx
push eax
call esi
test eax, eax
je 0x4021b9
mov eax, dword [ebx + 0x24]
lea ecx, [esp + 0x30]
push 0
push ecx
lea edx, [ebp + 0xc]
push 4
push edx
push eax
call esi
test eax, eax
je 0x4021b9
test ebp, ebp
je 0x4022f3
mov eax, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10]
lea ecx, [eax + 1]
cmp edx, ecx
jne 0x4022e3
mov edx, dword [ebx + 0x1c]
add edx, eax
lea eax, [edx*4 + 4]
push eax
call fcn.00402987
mov ecx, dword [ebx + 0x14]
mov esi, dword [ebx + 0xc]
mov edi, eax
mov dword [esp + 0x20], eax
lea ecx, [ecx*4 + 4]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 0xc]
push eax
call fcn.0040297c
mov edx, dword [ebx + 0x1c]
mov eax, dword [ebx + 0x14]
mov ecx, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 8
add eax, edx
mov dword [ebx + 0xc], ecx
mov dword [ebx + 0x14], eax
mov eax, dword [ebx + 0x10]
mov ecx, dword [ebx + 0xc]
mov dword [ecx + eax*4], ebp
mov eax, dword [ebx + 0x10]
inc eax
mov dword [ebx + 0x10], eax
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
inc eax
cmp eax, ecx
mov dword [esp + 0x2c], eax
jb 0x4021e0
mov edi, dword [esp + 0x18]
mov eax, dword [ebx + 0x10]
test eax, eax
jle 0x402346
test eax, eax
jle 0x402330
mov edx, dword [ebx + 0xc]
pop edi
pop esi
pop ebp
mov eax, dword [edx]
mov eax, dword [eax + 8]
mov dword [ebx], eax
mov eax, 1
pop ebx
add esp, 0x18
ret 8
xor eax, eax
pop edi
pop esi
pop ebp
mov eax, dword [eax + 8]
mov dword [ebx], eax
mov eax, 1
pop ebx
add esp, 0x18
ret 8
mov dword [ebx], edi
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x18
ret 8