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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, ecx
mov dword [0x45771c], 0
mov dword [ebp - 0xc], edx
mov dword [ebp - 4], 0
mov dword [ebp - 0x10], 0xf0ff
mov dword [ebp - 8], 0
mov dword [ebx], 8
push edi
test esi, esi
je 0x403ee5
cmp word [esi], 0
je 0x403ee5
push 0
push 0x2000080
push 3
push 0
push 7
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x403b20
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x45771c], eax
cmp eax, 0x20
jne 0x403ec9
push 0
push 0x2000080
push 3
push 0
push 1
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x403b20
push 0
push 0x2000080
push 3
push 0
push 2
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x403ec5
lea eax, [ebp - 0x18]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x403b3f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x45771c], eax
jmp 0x403ec5
cmp dword [ebp - 0x14], 0
mov esi, dword [ebp - 0x18]
jl 0x403b54
jg 0x403b4f
cmp esi, 0xffffffe0
jbe 0x403b54
mov esi, 0xffffffe0
push 0
lea eax, [ebp - 4]
push eax
push 4
lea eax, [ebp - 8]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403ec5
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x403ec5
cmp ecx, 2
jae 0x403bd5
mov dword [ebx], 0
xor eax, eax
cmp eax, esi
je 0x403ec5
push 0
mov ecx, esi
sub ecx, eax
test eax, eax
push 0
push eax
cmove ecx, esi
push edi
mov dword [ebp + 0x10], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x10]
add eax, 0x16
push eax
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x403cac
mov dword [0x45771c], 8
jmp 0x403ec5
mov al, byte [ebp - 8]
cmp al, 0xff
jne 0x403c14
cmp byte [ebp - 7], 0xfe
jne 0x403b85
mov eax, esi
and eax, 1
add esi, eax
cmp ecx, 4
jne 0x403c04
cmp byte [ebp - 6], 0
jne 0x403c04
cmp byte [ebp - 5], 0
jne 0x403c04
mov eax, ecx
mov dword [ebx], 5
jmp 0x403b87
mov eax, 2
mov dword [ebx], 3
jmp 0x403b87
cmp al, 0xfe
jne 0x403c39
cmp byte [ebp - 7], 0xff
jne 0x403b85
mov eax, esi
mov dword [ebx], 4
and eax, 1
add esi, eax
mov eax, 2
jmp 0x403b87
cmp ecx, 2
jbe 0x403b85
cmp al, 0xef
jne 0x403c6a
cmp byte [ebp - 7], 0xbb
jne 0x403b85
cmp byte [ebp - 6], 0xbf
jne 0x403b85
mov eax, 3
mov dword [ebx], 2
jmp 0x403b87
cmp ecx, 4
jne 0x403b85
test al, al
jne 0x403b85
cmp byte [ebp - 7], al
jne 0x403b85
cmp byte [ebp - 6], 0xfe
jne 0x403b85
cmp byte [ebp - 5], 0xff
jne 0x403b85
mov eax, esi
mov dword [ebx], 6
and eax, 1
add esi, eax
mov eax, ecx
jmp 0x403b87
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp + 0x10]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403eb6
cmp dword [ebp - 4], 0
je 0x403eb6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
lea edx, [esi - 2]
mov dword [eax], esi
mov eax, dword [ebx]
add eax, 0xfffffffd
cmp eax, 3
ja case.default.0x403cec
jmp dword [eax*4 + 0x403f00]
mov ebx, dword [ebp - 4]
test bl, 1
je 0x403d03
mov byte [esi + ebx], 0
mov ebx, dword [ebp - 4]
inc ebx
mov eax, dword [ebp - 0xc]
shr ebx, 1
xor ecx, ecx
mov eax, dword [eax]
mov word [eax + ebx*2], cx
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 4]
test bl, 1
je 0x403d33
mov byte [esi + ebx], 0
mov eax, dword [ebp - 4]
dec eax
mov dword [ebp - 4], eax
mov byte [esi + eax], 0
mov ebx, dword [ebp - 4]
shr ebx, 1
mov esi, ebx
je 0x403e98
nop dword [eax]
mov ax, word [edx + 2]
lea edx, [edx + 2]
movzx ecx, byte [edx + 1]
shl ax, 8
or cx, ax
mov word [edx], cx
sub esi, 1
jne 0x403d40
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov eax, dword [eax]
mov word [eax + ebx*2], cx
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 4]
test bl, 3
je 0x403d8e
mov byte [esi + ebx], 0
mov eax, 4
mov ebx, dword [ebp - 4]
mov ecx, ebx
and ecx, 3
sub eax, ecx
add ebx, eax
mov dword [ebp - 4], ebx
shr ebx, 2
lea ecx, [edx - 2]
mov esi, ebx
test ebx, ebx
je 0x403db3
nop word [eax + eax]
mov ax, word [ecx + 4]
lea ecx, [ecx + 4]
mov word [edx + 2], ax
lea edx, [edx + 2]
sub esi, 1
jne 0x403da0
mov esi, dword [ebp - 0xc]
lea eax, [ebx*2 + 0x16]
push eax
push dword [esi]
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
test eax, eax
je 0x403e98
mov dword [esi], eax
xor ecx, ecx
mov eax, esi
mov eax, dword [eax]
mov word [eax + ebx*2], cx
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 4]
mov eax, ebx
and eax, 3
je 0x403e09
sub ebx, eax
mov dword [ebp - 4], ebx
mov byte [esi + ebx], 0
mov eax, dword [ebp - 4]
mov byte [esi + eax + 1], 0
mov ebx, dword [ebp - 4]
shr ebx, 2
lea esi, [edx - 2]
mov edi, ebx
test ebx, ebx
je 0x403db3
mov ecx, dword [esi + 4]
lea esi, [esi + 4]
mov eax, ecx
lea edx, [edx + 2]
shr eax, 8
and eax, 0xff00
shr ecx, 0x18
or eax, ecx
mov word [edx], ax
sub edi, 1
jne 0x403e15
jmp 0x403db3
push 0
push 0
push dword [ebp - 4]
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
test ebx, ebx
je 0x403eac
lea ecx, [ebx*2 + 0x16]
push ecx
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, eax
mov eax, dword [ebp - 0xc]
mov dword [eax], ecx
test ecx, ecx
je 0x403eac
push ebx
push ecx
push dword [ebp - 4]
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push esi
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov eax, dword [eax]
mov word [eax + ebx*2], cx
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [0x45771c], 8
push esi
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x403ed0
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x45771c]
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x57
mov dword [0x45771c], 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret