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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4560e6
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x471050]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
mov ebx, ecx
push 0x1c
call fcn.0042cf1f
mov esi, eax
add esp, 4
mov dword [esp + 0x28], esi
xor edi, edi
mov dword [esp + 0x40], edi
cmp esi, edi
je 0x4059df
xor eax, eax
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], edi
mov word [esi + 4], ax
mov eax, ebx
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4059c0
sub eax, edx
sar eax, 1
push eax
mov eax, ebx
call fcn.00402de0
mov ebx, esi
mov dword [esp + 0x14], ebx
jmp 0x4059e5
mov dword [esp + 0x14], edi
mov ebx, edi
mov dword [esp + 0x40], 0xffffffff
mov edx, dword [ebx + 0x18]
cmp edx, 8
jb 0x4059fa
mov esi, dword [ebx + 4]
jmp 0x4059fd
lea esi, [ebx + 4]
cmp esi, edi
je 0x405a24
lea eax, [ebx + 4]
cmp edx, 8
jb 0x405a0d
mov ecx, dword [eax]
jmp 0x405a0f
mov ecx, eax
cmp ecx, esi
ja 0x405a24
cmp edx, 8
jb 0x405a1a
mov eax, dword [eax]
mov ecx, dword [ebx + 0x14]
lea edx, [eax + ecx*2]
cmp esi, edx
jbe 0x405a29
call fcn.0042ccd4
mov dword [esp + 0x30], esi
lea ecx, [ecx]
mov edx, dword [ebx + 0x18]
lea esi, [ebx + 4]
cmp edx, 8
jb 0x405a3f
mov edi, dword [esi]
jmp 0x405a41
mov edi, esi
mov eax, dword [ebx + 0x14]
add eax, eax
add edi, eax
je 0x405a6a
cmp edx, 8
jb 0x405a53
mov ecx, dword [esi]
jmp 0x405a55
mov ecx, esi
cmp ecx, edi
ja 0x405a6a
cmp edx, 8
jb 0x405a62
mov ecx, dword [esi]
jmp 0x405a64
mov ecx, esi
add ecx, eax
cmp edi, ecx
jbe 0x405a6f
call fcn.0042ccd4
mov ecx, dword [esp + 0x30]
cmp ecx, edi
je 0x405afd
cmp ebx, 0xfffffffc
je 0x405a9f
cmp dword [ebx + 0x18], 8
jb 0x405a8a
mov eax, dword [esi]
jmp 0x405a8c
mov eax, esi
mov edx, dword [ebx + 0x14]
lea eax, [eax + edx*2]
cmp ecx, eax
jb 0x405a9f
call fcn.0042ccd4
mov ecx, dword [esp + 0x30]
cmp word [ecx], 0x2f
jne 0x405ad1
cmp ebx, 0xfffffffc
je 0x405ac9
cmp dword [ebx + 0x18], 8
jb 0x405ab4
mov eax, dword [esi]
jmp 0x405ab6
mov eax, esi
mov edx, dword [ebx + 0x14]
lea eax, [eax + edx*2]
cmp ecx, eax
jb 0x405ac9
call fcn.0042ccd4
mov ecx, dword [esp + 0x30]
mov edx, 0x5c
mov word [ecx], dx
cmp ebx, 0xfffffffc
je 0x405af1
cmp dword [ebx + 0x18], 8
jb 0x405ade
mov esi, dword [esi]
mov eax, dword [ebx + 0x14]
lea edx, [esi + eax*2]
cmp ecx, edx
jb 0x405af1
call fcn.0042ccd4
mov ecx, dword [esp + 0x30]
add ecx, 2
mov dword [esp + 0x30], ecx
jmp 0x405a30
mov eax, dword [ebx + 0x14]
lea edi, [eax - 1]
cmp edi, eax
jbe 0x405b0c
call fcn.0042ccd4
cmp dword [ebx + 0x18], 8
jb 0x405b14
mov esi, dword [esi]
cmp word [esi + edi*2], 0x5c
je 0x405b29
push 1
mov eax, 0x45cc38
mov ecx, ebx
call fcn.004068d0
push 0x1c
call fcn.0042cf1f
mov esi, eax
add esp, 4
mov dword [esp + 0x28], esi
xor eax, eax
mov dword [esp + 0x40], 1
cmp esi, eax
je 0x405b7f
mov edx, dword [ebp + 8]
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], 7
mov word [esi + 4], ax
mov eax, edx
lea edi, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405b60
sub eax, edi
sar eax, 1
push eax
mov eax, edx
call fcn.00402de0
mov edi, esi
mov dword [esp + 0x1c], edi
jmp 0x405b85
mov dword [esp + 0x1c], eax
mov edi, eax
mov dword [esp + 0x40], 0xffffffff
cmp dword [edi + 0x18], 8
jb 0x405b98
mov eax, dword [edi + 4]
jmp 0x405b9b
lea eax, [edi + 4]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0x24], esi
cmp esi, 0xffffffff
je 0x405d04
lea ecx, [esp + 0x28]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
test edi, edi
je 0x405c6f
cmp dword [esp + 0x28], 0
jne 0x405c6f
lea esi, [edi + 1]
and esi, 0xfffffffe
push esi
call fcn.0042c9de
add esp, 4
push esi
push 0
push eax
mov dword [esp + 0x24], eax
call fcn.0042e870
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x30]
add esp, 0xc
push 0
lea edx, [esp + 0x30]
push edx
push edi
push eax
push ecx
mov dword [esp + 0x34], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x405c5e
mov eax, dword [esp + 0x18]
xor ebx, ebx
cmp edi, 3
jbe 0x405c81
mov edx, 0xfeff
cmp word [eax], dx
jne 0x405c81
shr esi, 1
add eax, 2
dec esi
mov ecx, dword [esp + 0x14]
push ecx
push esi
push eax
call fcn.00406da0
add esp, 0xc
test ebx, ebx
je 0x405c5a
push ebx
call fcn.0042d587
add esp, 4
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push edx
call fcn.0042d587
mov esi, dword [esp + 0x28]
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x1c]
push 0
jmp 0x405d14
push 0
push 0
push edi
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
jle 0x405cdd
xor ecx, ecx
lea eax, [esi + 0x200]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0042c9de
add esp, 4
push esi
mov ebx, eax
mov eax, dword [esp + 0x1c]
push ebx
push edi
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x405cf9
push ebx
call fcn.0042d587
add esp, 4
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push ecx
push esi
push edx
call fcn.00406fa0
add esp, 0xc
jmp 0x405c5a
mov eax, ebx
test ebx, ebx
je 0x405ce1
jmp 0x405c3e
push 1
mov ecx, edi
call fcn.00405570
add esp, 4
push 1
mov ecx, ebx
call fcn.00405570
add esp, 4
cmp dword [ebx + 0x18], 8
jb 0x405d2e
mov eax, dword [ebx + 4]
push eax
call fcn.0042ce2b
add esp, 4
xor ecx, ecx
mov dword [ebx + 0x18], 7
mov dword [ebx + 0x14], 0
push ebx
mov word [ebx + 4], cx
call fcn.0042ce2b
add esp, 4
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret