Function at 0x10003e63
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push esi
mov esi, dword [ebp + 8]
push edi
cmp esi, 1
mov edi, ecx
jb 0x1000404a
cmp esi, dword [edi + 0x20]
ja 0x1000404a
movzx ecx, word [edi + 0x14]
lea eax, [esi - 1]
mov dword [ebp - 4], ecx
imul eax, ecx
cmp esi, 1
jne 0x10003e9b
add eax, 0x64
sub dword [ebp - 4], 0x64
push ebx
push 0
push eax
push dword [edi]
call dword [sym.imp.MSVCRT.dll_fseek]
push dword [ebp - 4]
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
push dword [edi]
mov ebx, eax
push dword [ebp - 4]
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x20
cmp eax, dword [ebp - 4]
jne 0x1000403e
mov cl, byte [ebx]
and dword [ebp - 0x10], 0
and cl, 8
lea eax, [ebx + 8]
cmp cl, 8
mov dword [ebp - 8], eax
je 0x10003efe
push 4
push eax
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push dword [ebp - 0x10]
call dword [sym.imp.WS2_32.dll_ntohl]
add dword [ebp - 8], 4
mov dword [ebp - 0x10], eax
mov ax, word [ebx + 3]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
and dword [ebp - 0xc], 0
movzx eax, ax
mov dword [ebp - 0x1c], eax
mov al, byte [ebp + 0x10]
mov byte [ebp - 0x18], al
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0xc], eax
jl 0x10003f25
mov byte [ebp - 0x18], 1
mov eax, dword [ebp - 8]
mov ax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, word [edi + 0x14]
movzx ecx, ax
sub edx, 4
mov dword [ebp - 0x20], ecx
cmp ecx, edx
jg 0x1000401a
test ax, ax
jbe 0x1000401a
mov al, byte [ebx]
and al, 8
cmp al, 8
jne 0x10003fe1
add ecx, ebx
cmp esi, 1
mov dword [ebp - 0x14], ecx
jne 0x10003f6a
sub dword [ebp - 0x14], 0x64
push 0x19
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
xor esi, esi
pop ecx
cmp eax, esi
je 0x10003f89
mov cl, byte [ebp + 0xf]
mov dword [eax + 9], esi
mov dword [eax + 0xd], esi
mov dword [eax + 0x11], esi
mov byte [eax + 5], cl
mov esi, eax
mov al, byte [ebp - 0x18]
and dword [esi + 0x15], 0
mov byte [esi], al
mov eax, dword [ebp + 8]
mov dword [esi + 1], eax
lea eax, [esi + 0x15]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0xc], eax
jge 0x1000401a
movzx eax, word [edi + 0x14]
sub eax, dword [ebp - 0x20]
push esi
mov ecx, edi
push eax
push dword [ebp - 0x14]
call fcn.10004052
test al, al
je 0x10003fc8
mov eax, dword [ebp + 0xc]
mov dword [eax], esi
mov eax, dword [ebp - 0x24]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 4]
add dword [ebp - 8], 2
add eax, ebx
cmp dword [ebp - 8], eax
jae 0x1000401a
inc dword [ebp - 0xc]
mov esi, dword [ebp + 8]
jmp 0x10003f13
cmp esi, 1
lea eax, [ecx + ebx]
jne 0x10003fec
sub eax, 0x64
push dword [eax]
call dword [sym.imp.WS2_32.dll_ntohl]
cmp eax, dword [edi + 0x20]
ja 0x10003fc8
mov esi, dword [ebp + 0xc]
push 0
push dword [ebp - 0x18]
mov ecx, edi
push esi
push eax
call fcn.10003e63
mov eax, dword [esi]
test eax, eax
je 0x10003fc8
add eax, 0x15
mov dword [ebp + 0xc], eax
mov eax, dword [eax]
jmp 0x1000400c
mov eax, dword [ebp - 0x10]
cmp eax, dword [edi + 0x20]
ja 0x1000403e
mov esi, dword [ebp + 0xc]
push 0
push dword [ebp + 0x10]
mov ecx, edi
push esi
push eax
call fcn.10003e63
mov eax, dword [esi]
test eax, eax
je 0x1000403e
mov eax, dword [eax + 0x15]
jmp 0x10004035
push ebx
call fcn.100060b7
pop ecx
mov al, 1
pop ebx
jmp 0x1000404c
xor al, al
pop edi
pop esi
leave
ret 0x10