Function at 0x10059f1
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
xor esi, esi
push edi
push dword [0x1009ee8]
mov dword [ebp - 4], esi
push esi
mov dword [ebp - 8], esi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x34], 0x800
mov dword [ebp - 0x30], esi
mov dword [ebp - 0xc], esi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push esi
push 0x1009620
mov dword [ebp - 0x10], eax
mov dword [0x1009430], esi
call sub.msvcrt.dll__setjmp3
test eax, eax
pop ecx
pop ecx
jne 0x1005c8a
call fcn.010055cd
test eax, eax
jne 0x1005c8a
cmp dword [ebp + 0x10], esi
je 0x1005a96
push dword [ebp + 0x10]
call fcn.01004ba0
mov edi, eax
cmp edi, esi
je 0x1005c8a
push edi
push dword [ebp + 8]
push 0x1001580
push 1
call fcn.01005499
add esp, 0x10
push edi
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp ebx, 1
jmp 0x1005aab
push dword [ebp + 8]
push 0x1001338
push 1
call fcn.01005499
add esp, 0xc
cmp eax, 1
jne 0x1005c8a
push 0x10012a0
mov dword [ebp - 0xc], 1
call fcn.01005044
cmp eax, 0xffffffff
mov dword [ebp - 0x20], eax
je 0x1005c8a
push 0x1001304
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll__mbscmp]
test eax, eax
pop ecx
pop ecx
jne 0x1005aed
mov ebx, dword [sym.imp.msvcrt.dll__iob]
mov dword [ebp - 4], ebx
jmp 0x1005b4c
push 0x100157c
push dword [ebp + 0xc]
call dword [sym.imp.msvcrt.dll_fopen]
mov ebx, eax
cmp ebx, esi
pop ecx
pop ecx
mov dword [ebp - 4], ebx
jne 0x1005b1b
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
push dword [ebp + 0xc]
call sub.MSWSOCK.dll_s_perror
jmp 0x1005c8d
mov edi, dword [sym.imp.msvcrt.dll_fclose]
lea eax, [ebp - 0x58]
push eax
push dword [ebx + 0x10]
mov dword [ebp - 8], edi
call dword [sym.imp.msvcrt.dll__fstat]
test eax, eax
pop ecx
pop ecx
jl 0x1005c73
mov eax, dword [ebp - 0x52]
and ax, 0xf000
cmp ax, 0x8000
jne 0x1005c73
mov eax, dword [ebp - 8]
mov dword [0x1009428], ebx
mov dword [0x100942c], eax
mov dword [ebp - 0x18], esi
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], esi
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.msvcrt.dll_clock]
mov dword [ebp - 0x24], eax
mov eax, dword [0x1009ee4]
cmp eax, 1
je 0x1005b90
cmp eax, 2
jle 0x1005c8d
cmp eax, 4
jg 0x1005c8d
mov edi, dword [sym.imp.msvcrt.dll_putchar]
jmp 0x1005c0d
push dword [0x1009ee8]
push dword [ebp - 0x10]
push dword [ebp - 0x1c]
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, esi
mov dword [ebp - 0x14], eax
jle 0x1005c15
push esi
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x20]
call fcn.010067c8
cmp eax, esi
mov dword [ebp - 0x18], eax
jl 0x1005c15
mov eax, dword [ebp - 0x14]
cdq
add dword [ebp - 0x2c], eax
adc dword [ebp - 0x28], edx
jmp 0x1005c05
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0x30]
jl 0x1005c0d
jg 0x1005be6
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x34]
jb 0x1005c0d
add dword [ebp - 0x34], 0x800
push 0x23
adc dword [ebp - 0x30], esi
call edi
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_fflush]
pop ecx
pop ecx
cmp dword [0x1009f80], esi
jne 0x1005bd4
cmp dword [0x1009430], esi
je 0x1005b98
cmp dword [0x1009430], esi
jne 0x1005c8d
cmp dword [0x1009f80], esi
je 0x1005c46
cmp dword [ebp - 0x28], esi
jl 0x1005c46
jg 0x1005c31
cmp dword [ebp - 0x2c], esi
jbe 0x1005c46
push 0xa
call edi
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call dword [sym.imp.msvcrt.dll_fflush]
pop ecx
pop ecx
cmp dword [ebp - 0x14], esi
jge 0x1005c5b
call dword [sym.imp.msvcrt.dll__errno]
push dword [eax]
push dword [ebp + 0xc]
call sub.MSWSOCK.dll_s_perror
cmp dword [ebp - 0x18], esi
jge 0x1005c8d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2763
call fcn.01006573
jmp 0x1005c8d
push dword [ebp + 0xc]
push 0x2762
push 2
call fcn.010064fd
push ebx
call edi
add esp, 0x10
jmp 0x1005c8d
mov ebx, dword [ebp - 4]
call dword [sym.imp.msvcrt.dll_clock]
cmp dword [0x1009430], esi
mov edi, eax
je 0x1005cc3
push 0x1001574
call fcn.0100538b
cmp eax, 4
pop ecx
jne 0x1005cb4
push esi
push esi
call fcn.01004ea6
push esi
push 0x1009430
mov dword [ebp - 0xc], esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
cmp dword [ebp - 8], esi
je 0x1005ccd
push ebx
call dword [ebp - 8]
pop ecx
mov eax, dword [0x1008384]
cmp eax, 0xffffffff
je 0x1005ce5
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [0x1008384], 0xffffffff
cmp dword [ebp - 0xc], esi
mov dword [0x1009428], esi
mov dword [0x100942c], esi
je 0x1005cfe
push 1
push esi
call fcn.01004ea6
cmp dword [ebp - 0x28], esi
jl 0x1005d23
jg 0x1005d0a
cmp dword [ebp - 0x2c], esi
jbe 0x1005d23
cmp dword [0x100a3b0], esi
je 0x1005d23
push edi
push dword [ebp - 0x24]
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push 1
call fcn.01004cf4
push dword [ebp - 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret 0xc