Function at 0x405180
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x431110
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x44
push ebx
push esi
xor ebx, ebx
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
mov eax, dword [ebp + 0xc]
push 0xffffffffffffffff
mov dword [ebp - 4], ebx
push eax
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 1
call fcn.004038a0
cmp dword [eax + 4], ebx
mov byte [ebp - 4], 2
jbe 0x4051cb
mov eax, dword [eax]
jmp 0x4051d0
mov eax, 0x4323a8
push ebx
push eax
lea ecx, [ebp - 0x20]
call fcn.00401ee0
push ebx
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 1
mov dword [ebp - 0x28], ebx
call fcn.00402970
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], ebx
call fcn.004021e0
xor ecx, ecx
cmp eax, eax
mov dword [ebp - 0x28], eax
jne 0x405202
cmp ecx, edx
je 0x40522b
push ebx
lea ecx, [ebp - 0x14]
push ecx
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x14], str.Overflow
call fcn.0041aa68
push 0x43ac58
lea edx, [ebp - 0x38]
push edx
mov dword [ebp - 0x38], 0x432380
call fcn.0041ab1c
xor esi, esi
mov dword [ebp - 0x14], esi
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
add ecx, 0x44
mov byte [ebp - 4], 4
call fcn.00403980
mov edi, dword [eax]
cmp edi, ebx
je 0x405258
lea ecx, [edi + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov esi, edi
mov dword [ebp - 0x14], esi
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x405283
mov edi, eax
add eax, 0x1c
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x405283
cmp edi, ebx
je 0x405283
mov ecx, edi
call fcn.00402a40
push edi
call fcn.0041ab17
add esp, 4
cmp esi, ebx
je 0x405398
jmp 0x405290
cmp esi, ebx
je 0x40529e
lea edx, [esi + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov edi, dword [esi + 0x18]
lea ebx, [esi + 0x1c]
push ebx
mov byte [ebp - 4], 5
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x4052c6
mov ecx, esi
call fcn.00402a40
push esi
call fcn.0041ab17
add esp, 4
test edi, edi
je 0x4052d4
lea eax, [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, dword [ebp + 0x10]
push ecx
mov ecx, esi
call fcn.00407590
test al, al
je 0x405337
mov eax, dword [ebp + 8]
mov ecx, dword [esi + 0x14]
add eax, 0x44
test ecx, ecx
jne 0x4052f4
mov ecx, eax
jmp 0x4052f7
add ecx, 0x18
mov edx, dword [esi + 0x18]
mov dword [ecx], edx
mov ecx, dword [esi + 0x18]
test ecx, ecx
jne 0x405308
lea ecx, [eax + 4]
jmp 0x40530b
add ecx, 0x14
mov edx, dword [esi + 0x14]
mov dword [ecx], edx
xor ecx, ecx
mov dword [esi + 0x14], ecx
mov dword [esi + 0x18], ecx
add dword [eax + 8], 0xffffffff
push ebx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x405337
mov ecx, esi
call fcn.00402a40
push esi
call fcn.0041ab17
add esp, 4
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
call ebx
test eax, eax
jne 0x405354
mov ecx, esi
call fcn.00402a40
push esi
call fcn.0041ab17
add esp, 4
xor esi, esi
test edi, edi
mov dword [ebp - 0x14], esi
je 0x40536c
lea eax, [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov esi, edi
mov dword [ebp - 0x14], esi
test edi, edi
mov byte [ebp - 4], 4
je 0x40538e
lea ecx, [edi + 0x1c]
push ecx
call ebx
test eax, eax
jne 0x40538e
mov ecx, edi
call fcn.00402a40
push edi
call fcn.0041ab17
add esp, 4
xor ebx, ebx
test esi, esi
jne 0x405290
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x18]
push edx
add ecx, 0x44
call fcn.00403a20
cmp esi, ebx
mov edi, dword [eax]
je 0x4053d0
lea eax, [esi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x4053cb
mov ecx, esi
call fcn.00402a40
push esi
call fcn.0041ab17
add esp, 4
xor esi, esi
mov dword [ebp - 0x14], esi
cmp edi, ebx
je 0x4053e3
lea ecx, [edi + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov esi, edi
mov dword [ebp - 0x14], esi
mov eax, dword [ebp - 0x18]
cmp eax, ebx
je 0x40540e
mov edi, eax
add eax, 0x1c
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x40540e
cmp edi, ebx
je 0x40540e
mov ecx, edi
call fcn.00402a40
push edi
call fcn.0041ab17
add esp, 4
mov edi, dword [esi]
test edi, edi
mov edx, dword [ebp + 0x10]
mov ebx, dword [edx]
mov byte [ebp - 4], 6
je 0x40543b
add dword [edi], 0xffffffff
jne 0x40543b
mov eax, dword [edi + 4]
push eax
call fcn.0041b9c6
push edi
mov dword [edi + 4], 0
call fcn.0041ab17
add esp, 8
test ebx, ebx
mov dword [esi], ebx
je 0x405444
add dword [ebx], 1
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 4]
mov ebx, dword [ebp - 0x28]
mov dword [esi + 4], ecx
lea edi, [esi + 0xc]
push ebx
mov ecx, edi
call fcn.00401d10
mov eax, dword [edi]
mov edi, dword [ebp - 0x20]
push edi
push ebx
push 1
push eax
call fcn.0041b0f0
add esp, 0x10
cmp eax, ebx
je 0x405494
push 0
lea edx, [ebp - 0x18]
push edx
lea ecx, [ebp - 0x44]
mov dword [ebp - 0x18], str.read_error
call fcn.0041aa68
push 0x43ab4c
lea eax, [ebp - 0x44]
push eax
call fcn.0041ab1c
lea ecx, [esi + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x4054b2
mov ecx, esi
call fcn.00402a40
push esi
call fcn.0041ab17
add esp, 4
test edi, edi
je 0x4054bf
push edi
call fcn.0041add8
add esp, 4
mov esi, dword [ebp - 0x1c]
test esi, esi
je 0x4054d5
push esi
call fcn.0041ad61
push esi
call fcn.0041abab
add esp, 8
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret