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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47df1d
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
mov eax, dword [0x4b5200]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x20], ebx
mov eax, dword [ebx]
mov edi, dword [ebp + 8]
cmp eax, 0xffffffff
je 0x40a5b2
test eax, eax
je 0x40a5b2
mov eax, dword [edi]
mov dword [ebp - 0x14], 0
test eax, eax
je 0x40a39c
push eax
call fcn.0046b303
add esp, 4
mov dword [edi], 0
mov dword [edi + 4], 0
mov byte [edi + 8], 1
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x40a3c3
test eax, eax
je 0x40a3c3
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
jmp 0x40a3c5
xor eax, eax
lea esi, [eax + 2]
mov dword [ebp - 0x24], eax
xorps xmm0, xmm0
push esi
movlpd qword [ebp - 0x1c], xmm0
call fcn.0046b90c
add esp, 4
mov dword [ebp - 0x28], eax
mov ebx, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], esi
mov eax, dword [ebp - 0x24]
xor edx, edx
mov esi, dword [ebp - 0x20]
mov ecx, eax
shr ecx, 1
mov dword [ebp - 4], 0
push edx
mov dword [ebp - 0x24], ecx
mov word [ebx + ecx*2], dx
lea ecx, [ebp - 0x14]
push ecx
push eax
push ebx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40a41b
xor esi, esi
jmp 0x40a59e
mov eax, dword [ebp - 0x14]
mov byte [ebx + eax], 0
mov eax, dword [ebp - 0x14]
mov byte [ebx + eax + 1], 0
mov eax, dword [esi + 4]
test al, 0x20
je 0x40a459
mov eax, dword [edi]
mov dword [ebp - 0x28], 0
test eax, eax
je 0x40a447
push eax
call fcn.0046b303
add esp, 4
mov dword [edi], ebx
mov dword [edi + 4], 0
mov byte [edi + 8], 1
jmp 0x40a581
test al, 0x40
je 0x40a46d
push dword [ebp - 0x24]
mov ecx, edi
push ebx
call fcn.004030e0
jmp 0x40a581
mov cl, byte [ebx]
xor esi, esi
test eax, 0x180
je 0x40a4f7
test cl, cl
je 0x40a487
nop dword [eax]
inc esi
cmp byte [ebx + esi], 0
jne 0x40a480
mov eax, dword [edi]
xor ecx, ecx
mov dword [ebp - 0x20], eax
mov edx, 2
lea eax, [esi + 2]
mov dword [edi + 4], 0
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046b90c
mov dword [edi], eax
lea ecx, [esi + 1]
xor edx, edx
add esp, 4
mov word [eax + ecx*2], dx
mov eax, dword [edi]
mov word [eax], dx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40a4d2
push eax
call fcn.0046b303
add esp, 4
lea ecx, [esi + 1]
mov eax, dword [edi]
test eax, eax
je 0x40a581
test esi, esi
jne 0x40a4ea
xor ecx, ecx
mov word [eax], cx
jmp 0x40a581
push ecx
push eax
push esi
push ebx
push 0
push 0xfde9
jmp 0x40a56b
test cl, cl
je 0x40a507
nop dword [eax + eax]
inc esi
cmp byte [esi + ebx], 0
jne 0x40a500
mov eax, dword [edi]
xor ecx, ecx
mov dword [ebp - 0x20], eax
mov edx, 2
lea eax, [esi + 2]
mov dword [edi + 4], 0
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046b90c
mov dword [edi], eax
lea ecx, [esi + 1]
xor edx, edx
add esp, 4
mov word [eax + ecx*2], dx
mov eax, dword [edi]
mov word [eax], dx
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40a552
push eax
call fcn.0046b303
add esp, 4
lea ecx, [esi + 1]
mov eax, dword [edi]
test eax, eax
je 0x40a581
test esi, esi
jne 0x40a563
xor ecx, ecx
mov word [eax], cx
jmp 0x40a581
push ecx
push eax
push esi
push ebx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [edi]
xor edx, edx
test eax, eax
mov word [ecx + eax*2], dx
setg al
mov byte [edi + 8], al
mov esi, dword [edi + 4]
test esi, esi
jne 0x40a59e
mov eax, dword [edi]
test eax, eax
je 0x40a59b
cmp word [eax], si
je 0x40a59b
inc esi
cmp word [eax + esi*2], 0
jne 0x40a593
mov dword [edi + 4], esi
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40a5ae
push eax
call fcn.0046b303
add esp, 4
mov eax, esi
jmp 0x40a5b4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0046b2f5
mov esp, ebp
pop ebp
ret 8