Function at 0x4012d0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4110f8
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x417200]
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 eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
push 0x414a4c
push eax
mov edi, edx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x40], ecx
call fcn.00405667
mov esi, eax
add esp, 8
mov dword [ebp - 0x48], esi
test esi, esi
jne 0x401367
test ebx, ebx
je 0x401360
lea edx, [ebp - 0x3c]
push edx
call fcn.004018c0
add esp, 4
mov ecx, ebx
mov dword [ebp - 4], esi
call fcn.00403d20
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x3c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x401360
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x40150d
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x401375
mov ecx, dword [eax]
mov dword [ebp - 0x3c], ecx
jmp 0x40137c
mov dword [ebp - 0x3c], 0
mov ecx, dword [edi]
xor eax, eax
mov dword [ebp - 0x36], eax
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x16], eax
mov word [ebp - 0x12], ax
xor edx, edx
lea eax, [ecx - 0x10]
mov word [ebp - 0x38], dx
mov ebx, dword [eax]
cmp dword [eax + 4], edx
je 0x4013fc
cmp dword [eax + 0xc], 0
lea edx, [eax + 0xc]
jge 0x4013d8
cmp dword [ecx - 8], 0
jge 0x4013c8
push 0x80070057
call fcn.00401100
mov dword [ecx - 0xc], 0
mov eax, dword [edi]
xor ecx, ecx
mov word [eax], cx
jmp 0x4013fc
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4013ee
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [ebx]
mov eax, dword [edx + 0xc]
mov ecx, ebx
call eax
add eax, 0x10
mov dword [edi], eax
push 2
push 0
push esi
call fcn.00405708
push esi
call fcn.00405918
push 0
push 0
push esi
mov ebx, eax
call fcn.00405708
add esp, 0x1c
xor esi, esi
test ebx, ebx
je 0x4014d9
push ebx
call fcn.004053a5
mov ecx, dword [ebp - 0x48]
push ecx
push 1
mov esi, eax
push ebx
push esi
mov dword [ebp - 0x44], esi
call fcn.00405bc7
add esp, 0x14
push 0
push 0
push ebx
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
jns 0x401463
push 0x80070057
call fcn.00401100
mov eax, dword [edi]
mov edx, 1
sub edx, dword [eax - 4]
mov eax, dword [eax - 8]
sub eax, esi
or edx, eax
jge 0x40147f
mov eax, esi
mov ecx, edi
call fcn.00403b30
mov ecx, dword [edi]
mov edx, dword [ebp - 0x44]
push esi
push ecx
push ebx
push edx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, esi
cmp esi, 0xffffffff
jne 0x4014af
mov eax, dword [edi]
mov ecx, dword [eax - 8]
test eax, eax
je 0x4014b7
push ecx
push eax
call fcn.00406591
add esp, 8
test eax, eax
js 0x4013be
mov ecx, dword [edi]
cmp eax, dword [ecx - 8]
jg 0x4013be
mov dword [ecx - 0xc], eax
mov ecx, dword [edi]
xor edx, edx
mov word [ecx + eax*2], dx
mov eax, dword [ebp - 0x44]
push eax
call fcn.004053b0
add esp, 4
mov edi, dword [ebp - 0x4c]
test edi, edi
je 0x4014f3
push esi
push ebx
lea ecx, [ebp - 0x38]
push ecx
push str._s_d_bytes_to__d_wide_chars
call fcn.00403580
add esp, 0x10
mov edx, dword [ebp - 0x48]
push edx
call fcn.00405c51
mov eax, dword [ebp - 0x40]
add esp, 4
test eax, eax
je 0x40150b
mov ecx, dword [ebp - 0x3c]
mov dword [eax], ecx
mov al, 1
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.004051d1
mov esp, ebp
pop ebp
ret