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

Disassembly:
push ecx
push ebx
push ebp
push esi
push edi
push 4
push 0x1000
push 0x21c
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
je 0x402919
mov ebp, dword [esp + 0x18]
or ecx, 0xffffffff
mov edi, ebp
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebx + 0x104]
mov eax, ecx
mov esi, edi
mov edi, ebx
push ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov edx, dword [0x40a1e8]
mov eax, dword [esp + 0x20]
not ecx
dec ecx
mov dword [ecx + ebx + 0x101], edx
mov dword [ebx + 0x20c], eax
mov dword [ebx + 0x210], 0
call fcn.00403040
add esp, 4
test eax, eax
je 0x40297b
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x40290b
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x10]
push 0
lea esi, [ebx + 0x214]
push ecx
push 4
push esi
push edi
call ebp
cmp dword [esp + 0x10], 4
jb 0x40290b
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x10], eax
mov edx, dword [esi]
lea ecx, [edx*8]
sub ecx, edx
shl ecx, 2
lea edx, [ecx + 4]
cmp eax, edx
jae 0x402921
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
push 4
push 0x1000
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
lea ecx, [esp + 0x10]
push 0
push ecx
mov ecx, dword [esi]
mov dword [ebx + 0x218], eax
lea edx, [ecx*8]
sub edx, ecx
shl edx, 2
push edx
push eax
push edi
call ebp
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x402978
mov ecx, dword [esi]
mov eax, dword [ebx + 0x218]
lea edx, [ecx*8]
sub edx, ecx
shl edx, 2
push edx
push eax
push eax
call fcn.00403100
add esp, 0xc
push edi
jmp 0x4029bb
push 0
push 0x80
push 2
push 0
lea esi, [ebx + 0x214]
push 0
lea eax, [ebx + 0x104]
push 0x40000000
push eax
mov dword [esi], 0
mov dword [ebx + 0x218], 0
mov dword [ebx + 0x210], 1
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0x80
push 3
push 0
push 0
lea eax, [ebx + 0x104]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x10], eax
mov esi, dword [esi]
xor eax, eax
mov dword [ebx + 0x208], edi
test esi, esi
jbe 0x402a1a
mov ecx, dword [ebx + 0x218]
mov edx, dword [esp + 0x10]
mov edi, dword [ecx + 0x18]
mov ebp, dword [ecx]
add edi, ebp
cmp edx, edi
jb 0x402a39
inc eax
add ecx, 0x1c
cmp eax, esi
jb 0x402a07
mov eax, dword [ebx + 0x218]
push 0x403080
push 0x1c
push esi
push eax
call fcn.004039fc
add esp, 0x10
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
push ebx
mov dword [ebx + 0x210], 0
call fcn.00402a60
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret