Function at 0x491311
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
and dword [esp + 0x10], 0
push ebx
push esi
mov esi, edx
mov dword [esp + 0x14], ecx
push edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 0x20], esi
lea eax, [esi + 2]
mov dword [esp + 0x10], eax
test edi, edi
je 0x491683
mov ecx, dword [edi + 0x3c4]
call fcn.004883f7
mov ebx, eax
mov dword [esp + 0x30], ebx
test ebx, ebx
je 0x49167c
cmp dword [ebx + 0x54], 0
je 0x49167c
cmp dword [ebp + 8], 2
jge 0x49136e
mov eax, esi
jmp 0x491686
mov eax, dword [ebx]
mov ecx, dword [esp + 0x18]
mov esi, dword [eax]
mov eax, dword [esp + 0x20]
movzx eax, word [ecx + eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
movzx eax, cx
shr eax, 0xf
mov dword [esp + 0x24], eax
mov eax, ecx
movzx edx, cl
mov dword [esp + 0x2c], ecx
mov ecx, edx
shr eax, 8
and ecx, 0x7f
and eax, 0xffffff0f
mov dword [esp + 0x28], edx
mov dword [esp + 0x34], eax
mov dword [esp + 0x14], ecx
cmp ecx, 0x7e
jne 0x4913ef
cmp dword [ebp + 8], 4
mov eax, dword [esp + 0x20]
jl 0x491686
mov ecx, dword [esp + 0x18]
movzx eax, word [ecx + eax + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
add eax, 2
mov edx, dword [esp + 0x28]
mov dword [esp + 0x10], eax
jmp 0x49143c
cmp ecx, 0x7f
jne 0x491438
cmp dword [ebp + 8], 0xa
mov eax, dword [esp + 0x20]
jl 0x491686
mov ecx, dword [esp + 0x18]
push dword [ecx + eax + 6]
push dword [ecx + eax + 2]
call fcn.004845fe
pop ecx
pop ecx
mov ecx, eax
mov dword [esp + 0x14], ecx
test edx, edx
jne 0x49167c
cmp ecx, 0x7fffffff
ja 0x49167c
mov eax, dword [esp + 0x10]
add eax, 8
jmp 0x4913e5
mov eax, dword [esp + 0x10]
shr edx, 5
and edx, 4
add edx, ecx
add edx, eax
cmp dword [ebp + 8], edx
jge 0x491454
mov eax, dword [esp + 0x20]
jmp 0x491686
mov edx, dword [esp + 0x18]
test byte [esp + 0x2c], 0x80
mov dword [esp + 0x2c], 0
lea edi, [eax + edx]
cmove edi, dword [esp + 0x2c]
mov dword [esp + 0x28], edi
test edi, edi
mov edi, dword [ebp + 0xc]
je 0x4914c4
and dword [esp + 0x2c], 0
add eax, 4
mov dword [esp + 0x10], eax
test ecx, ecx
jle 0x4914c4
mov edi, dword [esp + 0x14]
add eax, edx
mov ecx, dword [esp + 0x2c]
mov ebx, eax
mov edx, dword [esp + 0x28]
mov dword [esp + 0x20], eax
mov eax, ecx
and eax, reloc.WS2_32.dll_closesocket
jns 0x4914aa
dec eax
or eax, 0xfffffffc
inc eax
mov al, byte [eax + edx]
xor byte [ebx + ecx], al
inc ecx
cmp ecx, edi
jl 0x49149c
mov edi, dword [ebp + 0xc]
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x34]
cmp al, 8
jae 0x491620
cmp dword [esi + 0x18], 0
jne 0x4914ea
movzx eax, al
mov dword [esi + 8], eax
mov eax, dword [esp + 0x24]
and dword [esp + 0x1c], 0
add eax, 0xa
jmp 0x49150c
test al, al
je 0x4914f4
movzx eax, al
mov dword [esi + 8], eax
mov eax, dword [esp + 0x24]
test eax, eax
je 0x491537
xor eax, eax
cmp dword [esi + 0x10], eax
jne 0x491537
cmp byte [esi + 0x1c], al
jne 0x491537
mov dword [esp + 0x1c], eax
push dword [ebp + 0x10]
push dword [ebx + 0x38]
push dword [ebx + 0x34]
push eax
push ecx
lea eax, [esp + 0x30]
push eax
mov eax, dword [esp + 0x28]
add eax, edx
push eax
push dword [edi + 0x3a0]
push 0
push edi
call dword [ebx + 0x54]
add esp, 0x28
jmp 0x491672
mov eax, dword [esi + 0x10]
add eax, ecx
cmp eax, dword [esi + 0x14]
jl 0x491587
mov eax, dword [esi + 0x14]
cmp eax, dword [esi + 0x18]
jne 0x4915ef
push dword [ebp + 0x10]
mov byte [esi + 0x1c], 1
lea eax, [esp + 0x20]
and dword [esp + 0x20], 0
push dword [ebx + 0x38]
push dword [ebx + 0x34]
push 0xa
push dword [esi + 0x10]
push eax
push dword [esi + 0xc]
push dword [edi + 0x3a0]
push 0
push edi
call dword [ebx + 0x54]
add esp, 0x28
and dword [esi + 0x10], 0
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push ecx
mov ecx, dword [esi + 0xc]
add eax, edx
mov edx, dword [esi + 0x14]
sub edx, dword [esi + 0x10]
add ecx, dword [esi + 0x10]
push eax
call section..text
mov eax, dword [esp + 0x1c]
add dword [esi + 0x10], eax
cmp dword [esp + 0x2c], 0
pop ecx
pop ecx
je 0x491672
push dword [ebp + 0x10]
xor ecx, ecx
push dword [ebx + 0x38]
cmp byte [esi + 0x1c], cl
push dword [ebx + 0x34]
push 0xb
pop eax
cmove eax, ecx
push eax
push dword [esi + 0x10]
lea eax, [esp + 0x30]
push eax
push dword [esi + 0xc]
push dword [edi + 0x3a0]
push ecx
push edi
call dword [ebx + 0x54]
add esp, 0x28
mov byte [esi + 0x1c], 0
and dword [esi + 0x10], 0
jmp 0x491672
add eax, eax
cmp eax, dword [esi + 0x18]
push 0x59c
cmovg eax, dword [esi + 0x18]
push 0x741e14
push 1
push eax
push dword [esi + 0xc]
mov dword [esi + 0x14], eax
call fcn.005ed970
add esp, 0x14
mov dword [esi + 0xc], eax
test eax, eax
jne 0x49157f
jmp 0x49168d
movzx eax, al
sub eax, 8
je 0x49166b
sub eax, 1
je 0x491643
sub eax, 1
jne 0x491672
mov eax, dword [esi + 0x28]
test eax, eax
je 0x491672
push dword [esi + 0x2c]
push edi
call eax
pop ecx
pop ecx
jmp 0x491672
mov eax, dword [esi + 0x24]
test eax, eax
je 0x491656
push dword [esi + 0x2c]
push edi
call eax
pop ecx
pop ecx
test eax, eax
jne 0x491672
push ecx
push ecx
push 0
push 0
push 0xa
pop edx
mov ecx, edi
call fcn.004910da
add esp, 0x10
jmp 0x491672
mov ecx, edi
call fcn.00492f55
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
jmp 0x491686
mov ecx, edi
call fcn.00492f55
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov esi, 0xfe
mov edi, 0x59c
push esi
push edi
mov edx, 0x741e34
xor ecx, ecx
call fcn.0048cac3
add esp, 0xc
push edi
push 0x741e54
push 0x741e74
call fcn.00401109
add esp, 0xc
push esi
call fcn.005c8390
int3