Function at 0x10004fbc
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 0x100051a3
cmp esi, dword [edi + 0x20]
ja 0x100051a3
movzx ecx, word [edi + 0x14]
lea eax, [esi - 1]
mov dword [ebp - 4], ecx
imul eax, ecx
cmp esi, 1
jne 0x10004ff4
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 0x10005197
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 0x10005057
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 0x1000507e
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 0x10005173
test ax, ax
jbe 0x10005173
mov al, byte [ebx]
and al, 8
cmp al, 8
jne 0x1000513a
add ecx, ebx
cmp esi, 1
mov dword [ebp - 0x14], ecx
jne 0x100050c3
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 0x100050e2
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 0x10005173
movzx eax, word [edi + 0x14]
sub eax, dword [ebp - 0x20]
push esi
mov ecx, edi
push eax
push dword [ebp - 0x14]
call fcn.100051ab
test al, al
je 0x10005121
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 0x10005173
inc dword [ebp - 0xc]
mov esi, dword [ebp + 8]
jmp 0x1000506c
cmp esi, 1
lea eax, [ecx + ebx]
jne 0x10005145
sub eax, 0x64
push dword [eax]
call dword [sym.imp.WS2_32.dll_ntohl]
cmp eax, dword [edi + 0x20]
ja 0x10005121
mov esi, dword [ebp + 0xc]
push 0
push dword [ebp - 0x18]
mov ecx, edi
push esi
push eax
call fcn.10004fbc
mov eax, dword [esi]
test eax, eax
je 0x10005121
add eax, 0x15
mov dword [ebp + 0xc], eax
mov eax, dword [eax]
jmp 0x10005165
mov eax, dword [ebp - 0x10]
cmp eax, dword [edi + 0x20]
ja 0x10005197
mov esi, dword [ebp + 0xc]
push 0
push dword [ebp + 0x10]
mov ecx, edi
push esi
push eax
call fcn.10004fbc
mov eax, dword [esi]
test eax, eax
je 0x10005197
mov eax, dword [eax + 0x15]
jmp 0x1000518e
push ebx
call fcn.1000758e
pop ecx
mov al, 1
pop ebx
jmp 0x100051a5
xor al, al
pop edi
pop esi
leave
ret 0x10