Function at 0x596350
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5f0bd2
mov eax, dword fs:[0]
push eax
sub esp, 0x110
mov eax, dword [0x64c874]
xor eax, esp
mov dword [esp + 0x108], eax
push ebx
push esi
push edi
mov eax, dword [0x64c874]
xor eax, esp
push eax
lea eax, [esp + 0x120]
mov dword fs:[0], eax
xor edi, edi
mov ebx, ecx
mov dword [esp + 0x98], 0xf
mov dword [esp + 0x94], edi
mov byte [esp + 0x84], 0
mov dword [esp + 0x128], edi
mov dword [esp + 0x1c], edi
call fcn.005d95d0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x30], esp
push 0xffffffffffffffff
mov dword [esp + 0x40], eax
lea eax, [ebx + 0xe0]
push edi
mov dword [ecx + 0x18], 0xf
mov dword [ecx + 0x14], edi
push eax
lea esi, [esp + 0x44]
mov byte [ecx + 4], 0
call fcn.0040b390
lea eax, [esp + 0xb8]
push eax
mov ecx, esi
call fcn.005054b0
add esp, 0x20
push 0xffffffffffffffff
lea esi, [eax + 0x38]
push edi
push esi
lea ecx, [esp + 0x8c]
mov byte [esp + 0x134], 1
call fcn.0040b390
mov ecx, dword [esi + 0x1c]
lea esi, [esp + 0xb8]
mov dword [esp + 0x18], ecx
mov byte [esp + 0x128], 0
call fcn.004b10d0
mov esi, 0x10
cmp dword [esp + 0xb4], esi
jb 0x596452
mov edx, dword [esp + 0xa0]
push edx
call fcn.0059b877
add esp, 4
mov ecx, dword [esp + 0x1c]
mov eax, ecx
neg eax
sbb eax, eax
test eax, fcn.00489120
je 0x5964f7
mov edx, dword [esp + 0x20]
push edx
push ecx
push edi
mov eax, 0x592430
push eax
push ecx
mov eax, esp
mov ecx, ebx
mov dword [esp + 0x28], esp
call fcn.00596150
lea eax, [esp + 0x78]
push eax
call fcn.00599330
add esp, 0x18
mov byte [esp + 0x128], 2
mov ecx, dword [ebx + 0x1d4]
add ecx, 0x374
push ecx
mov ecx, eax
call fcn.00599450
mov byte [esp + 0x128], 0
mov eax, dword [esp + 0x6c]
cmp eax, edi
je 0x5964dd
add eax, 8
mov edx, eax
or ecx, 0xffffffff
lock xadd dword [edx], ecx
jne 0x5964dd
cmp eax, edi
je 0x5964dd
lea ecx, [eax - 8]
cmp ecx, edi
je 0x5964dd
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push 1
call eax
cmp dword [esp + 0x98], esi
jb 0x5966f9
mov ecx, dword [esp + 0x84]
push ecx
jmp 0x5966f1
mov esi, dword [ebx + 0x1d4]
add esi, 0x44
cmp byte [ebx + 0x23c], 0
mov dword [esp + 0x14], esi
je 0x596561
mov eax, dword [ebx + 0x238]
cmp eax, 2
je 0x59651d
cmp eax, 3
jne 0x596561
push 0xffffffffffffffff
push edi
lea edx, [esp + 0x88]
push edx
lea ecx, [ebx + 0x18c]
call fcn.0040b390
cmp word [ebx + 0x1a8], 2
jne 0x596544
mov eax, dword [esp + 0x18]
push eax
jmp 0x596549
mov ecx, dword [esp + 0x18]
push ecx
call sub.WS2_32.dll_htons
mov ecx, ebx
mov word [ebx + 0x1aa], ax
call fcn.00596f40
jmp 0x5966c3
mov eax, dword [esp + 0x18]
cdq
push edx
push eax
lea edx, [esp + 0x6c]
push edx
call fcn.004b02e0
mov ecx, dword [eax]
mov dword [esp + 0x3e], ecx
mov edx, dword [eax + 4]
mov dword [esp + 0x42], edx
mov ecx, dword [eax + 8]
mov dword [esp + 0x46], ecx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x4a], edx
mov ecx, dword [eax + 0x10]
mov dword [esp + 0x4e], ecx
mov dx, word [eax + 0x14]
lea eax, [esp + 0x3e]
mov word [esp + 0x52], dx
add esp, 0xc
mov dword [esp + 0x60], 0xf
mov dword [esp + 0x5c], edi
mov byte [esp + 0x4c], 0
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5965b8
sub eax, edx
push eax
lea eax, [esp + 0x36]
push eax
lea ecx, [esp + 0x50]
call fcn.0040b860
lea edi, [esp + 0x48]
lea edx, [esp + 0x80]
lea esi, [esp + 0x9c]
mov byte [esp + 0x128], 3
call fcn.004ef470
mov byte [esp + 0x128], 5
cmp dword [esp + 0x60], 0x10
jb 0x59660d
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.0059b877
add esp, 4
movzx edx, byte [0x65b62d]
xor ecx, ecx
push ecx
mov eax, 0x596950
push eax
movzx eax, byte [0x65b606]
push edx
push eax
push ecx
mov eax, esp
mov ecx, ebx
mov dword [esp + 0x74], 0xf
mov dword [esp + 0x70], 0
mov byte [esp + 0x60], 0
mov dword [esp + 0x30], esp
call fcn.00596150
lea ecx, [esp + 0x30]
push ecx
call fcn.005994a0
add esp, 0x18
lea edx, [esp + 0x9c]
push edx
mov byte [esp + 0x12c], 6
mov edx, dword [ebx + 0x1d4]
add edx, 0x1148
mov ecx, eax
call fcn.005995a0
mov byte [esp + 0x128], 5
mov eax, dword [esp + 0x24]
test eax, eax
je 0x5966ab
add eax, 8
mov ecx, eax
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x5966ab
test eax, eax
je 0x5966ab
lea ecx, [eax - 8]
test ecx, ecx
je 0x5966ab
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push 1
call edx
lea esi, [esp + 0x9c]
mov byte [esp + 0x128], 0
call fcn.004dc530
mov esi, dword [esp + 0x14]
cmp dword [ebx + 0xdc], 3
jne 0x5966d1
mov eax, dword [esi + 0x44]
jmp 0x5966d4
mov eax, dword [esi + 0x3c]
mov ecx, dword [esi + 0x40]
push eax
mov esi, ebx
call fcn.00567290
cmp dword [esp + 0x98], 0x10
jb 0x5966f9
mov eax, dword [esp + 0x84]
push eax
call fcn.0059b877
add esp, 4
mov ecx, dword [esp + 0x120]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x108]
xor ecx, esp
call fcn.005b88a9
mov esp, ebp
pop ebp
ret