Function at 0x40eb80
Capabilities:
Read file on windows

Disassembly:
push esi
push edi
push ebx
push ebp
sub esp, 0x3c
xor edx, edx
mov ecx, eax
mov dword [esp + 0x30], edx
mov ebp, edx
mov esi, ecx
mov eax, esi
lea edx, [esp + 0x20]
call fcn.00413fc0
movzx edx, byte [esp + 0x20]
mov byte [esi + 0x2ad], dl
mov byte [esi + 0x2ac], dl
test edx, edx
je 0x40ed8b
lea ebx, [edx - 5]
cmp ebx, 0xa
ja 0x40ec02
cmp ebx, 2
ja 0x40ebda
mov ebx, 7
mov ecx, 0xf
cmp edx, 5
cmove ecx, ebx
mov dword [esp + 0x2c], ecx
jmp 0x40ebe9
mov ebx, 1
lea ecx, [edx + 0x15]
shl ebx, cl
dec ebx
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x2c]
mov byte [esi + 0x6c], bl
mov byte [esi + 0x6d], bl
mov byte [esi + 0x6f], bl
mov byte [esi + 0x74], bl
mov byte [esi + 0x75], bl
mov byte [esi + 0x76], bl
mov byte [esi + 0x77], bl
mov ecx, dword [esi + 0x94]
mov dword [esp + 0x34], ecx
cmp edx, 0x3f
je 0x40ecfd
mov ebx, dword [esi + 0x2d4]
mov eax, dword [esi + 0x2b8]
mov edx, dword [esp + 0x28]
cmp dword [ebx], 0
je 0x4361ee
mov ebx, dword [ebx + 4]
cmp eax, dword [ebx + 0x18]
jne 0x40eca9
mov edi, dword [ebx + 0x14]
mov dword [edi], 1
mov dword [edi + 4], edx
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [edi + 8]
test edi, edi
jl 0x4361d2
mov eax, esi
mov edx, dword [esp + 0x24]
call fcn.0040eda0
test eax, eax
jl 0x40ed98
mov ecx, dword [esi + 0x94]
mov edx, ecx
sub edx, dword [esp + 0x34]
je 0x40ec8d
add dword [esp + 0x30], edx
adc ebp, 0
sub ecx, dword [esi + 0x64]
jns 0x40eca1
mov edx, dword [esi + 0x2d4]
cmp dword [edx], 0
jne 0x40eb93
jmp 0x4361dc
mov dword [esi + 0x94], ecx
jmp 0x40ec8d
test edx, edx
je 0x4361c1
mov edi, dword [ebx + 0x14]
mov dword [edi], 1
mov dword [edi + 4], edx
push dword [ebx]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [edi + 8]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
test edi, edi
jle 0x40ec58
push edx
push dword [ebx + 0x18]
push eax
call fcn.00421410
add esp, 0xc
jmp 0x40ec58
mov ebx, dword [esp + 0x28]
test ebx, ebx
je 0x436190
mov dword [esp + 0x10], ebp
mov ebp, ecx
and ebp, 0xffffff
mov edi, ebp
neg edi
shr ecx, 0x18
add edi, 0x1000000
cmp edi, ebx
cmovae edi, ebx
mov eax, dword [esi + ecx*4 + 0xa4]
add ebp, eax
mov eax, ebp
mov edx, edi
mov ecx, dword [esi + 0x2d4]
call fcn.0040dd20
mov edx, eax
test edx, edx
jl 0x4361c8
cmp edx, edi
jne 0x436204
mov eax, ebp
mov ecx, dword [esi + 0x2d4]
mov dword [esp + 0x14], edx
call fcn.00413d50
mov edx, dword [esp + 0x14]
test eax, eax
jl 0x40ed98
mov ecx, dword [esi + 0x94]
add dword [esi + 0x2c0], edx
add ecx, edx
mov dword [esi + 0x94], ecx
sub ebx, edx
jne 0x40ed0d
mov ebp, dword [esp + 0x10]
jmp 0x40ec79
mov dword [esp + 0x2c], 0
jmp 0x40ebe9
add esp, 0x3c
pop ebp
pop ebx
pop edi
pop esi
ret
mov ecx, esi
mov eax, ebp
mov ecx, dword [ecx + 0x2d4]
mov edx, dword [esp + 0x30]
cmp dword [ecx], 0
jne 0x4361b7
add esp, 8
push eax
push edx
mov dword [0x433740], 0
call fcn.0041bcc0
xor eax, eax
add esp, 0x3c
pop ebp
pop ebx
pop edi
pop esi
ret
xor edi, edi
jmp 0x40ec58
mov eax, edx
add esp, 0x3c
pop ebp
pop ebx
pop edi
pop esi
ret
mov eax, edi
add esp, 0x3c
pop ebp
pop ebx
pop edi
pop esi
ret
push dword [ebx + 8]
push edx
push 1
push eax
call fcn.00425916
mov edi, eax
add esp, 0x10
jmp 0x40ec58
xor eax, eax
dec eax
add esp, 0x3c
pop ebp
pop ebx
pop edi
pop esi
ret