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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5ec6b6
mov eax, dword fs:[0]
push eax
sub esp, 0x408
mov eax, dword [0x64c874]
xor eax, esp
mov dword [esp + 0x400], eax
push ebx
push esi
push edi
mov eax, dword [0x64c874]
xor eax, esp
push eax
lea eax, [esp + 0x418]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebx + 0x1d0], 0
mov dword [esp + 0x1c], ebx
jne 0x59807e
mov eax, dword [0x64ebc8]
mov edx, dword [0x6542b0]
mov edi, dword [0x6542ac]
mov esi, dword [0x6542a8]
mov ecx, eax
shl ecx, 0xb
xor ecx, eax
mov eax, edx
shr eax, 0xb
xor eax, ecx
shr eax, 8
xor eax, edx
xor eax, ecx
mov dword [0x6542ac], edx
mov ecx, dword [0x6542ac]
mov dword [0x6542a8], ecx
mov edx, esi
shl edx, 0xb
xor edx, esi
mov ecx, eax
shr ecx, 0xb
xor ecx, edx
shr ecx, 8
xor ecx, eax
xor ecx, edx
mov dword [0x6542b0], ecx
shl ecx, 0x10
xor ecx, eax
mov dword [0x64ebc8], edi
mov dword [0x6542ac], eax
mov dword [ebx + 0x1d0], ecx
cmp byte [ebx + 0x188], 0
jne 0x59857e
mov al, byte [ebx + 0x174]
mov byte [esp + 0x17], al
mov eax, dword [ebx + 0x1d4]
add eax, 0x44
mov dword [esp + 0x20], eax
lea eax, [ebx + 0x1a8]
lea edx, [esp + 0xec]
push eax
lea esi, [esp + 0xd4]
mov dword [esp + 0x1c], edx
call fcn.004a90b0
lea edi, [esp + 0x30]
call fcn.00598930
mov edi, dword [esp + 0x30]
test edi, edi
mov ecx, dword [0x65b624]
mov dword [esp + 0x3c], ecx
je 0x5980e3
cmp edi, 0x65b620
je 0x5980e8
call fcn.005b8b18
mov esi, dword [esp + 0x34]
cmp esi, dword [esp + 0x3c]
je 0x59857e
test edi, edi
jne 0x5980ff
call fcn.005b8b18
cmp esi, dword [edi + 4]
jne 0x598109
call fcn.005b8b18
mov eax, dword [esi + 0x30]
mov esi, dword [esi + 0x34]
push esi
push eax
lea esi, [esp + 0x20]
call fcn.00599b30
mov esi, dword [esp + 0x20]
add esp, 8
mov edi, 0x18
mov ecx, edi
mov edx, 1
sar edx, cl
add esi, 1
sub edi, 8
mov byte [esi - 1], dl
jns 0x598126
mov eax, dword [ebx + 0x1d0]
mov edi, 0x18
mov ecx, edi
mov edx, eax
sar edx, cl
add esi, 1
sub edi, 8
mov byte [esi - 1], dl
jns 0x598145
lea eax, [ebx + 0x98]
lea ecx, [ebx + 0x84]
cmp ecx, eax
je 0x59817c
mov edi, esi
sub edi, ecx
lea ebx, [ebx]
mov dl, byte [ecx]
mov byte [edi + ecx], dl
add ecx, 1
cmp ecx, eax
jne 0x598170
lea edi, [ebx + 0xac]
add esi, 0x14
cmp eax, edi
je 0x59819c
mov ecx, esi
sub ecx, eax
lea ecx, [ecx]
mov dl, byte [eax]
mov byte [ecx + eax], dl
add eax, 1
cmp eax, edi
jne 0x598190
add esi, 0x14
cmp byte [esp + 0x17], 0
mov dword [esp + 0x18], esi
je 0x5981b8
mov eax, dword [ebx + 0xb0]
mov ecx, dword [ebx + 0xb4]
jmp 0x5981bc
xor eax, eax
xor ecx, ecx
push ecx
push eax
lea esi, [esp + 0x20]
call fcn.00599b30
add esp, 8
cmp byte [esp + 0x17], 0
je 0x5981df
mov eax, dword [ebx + 0xc0]
mov ecx, dword [ebx + 0xc4]
jmp 0x5981e3
xor eax, eax
xor ecx, ecx
push ecx
push eax
lea esi, [esp + 0x20]
call fcn.00599b30
add esp, 8
cmp byte [esp + 0x17], 0
je 0x598206
mov eax, dword [ebx + 0xb8]
mov ecx, dword [ebx + 0xbc]
jmp 0x59820a
xor eax, eax
xor ecx, ecx
push ecx
push eax
lea esi, [esp + 0x20]
call fcn.00599b30
mov edi, dword [ebx + 0xdc]
mov ebx, dword [esp + 0x20]
add esp, 8
mov esi, 0x18
mov ecx, esi
mov eax, edi
sar eax, cl
add ebx, 1
sub esi, 8
mov byte [ebx - 1], al
jns 0x598227
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx + 0x1d4]
xor esi, esi
cmp byte [edx + 0x23a], 0
jne 0x5982b0
mov edi, dword [esp + 0x20]
cmp dword [edi + 0xb4], esi
je 0x5982b0
mov dword [esp + 0x20], esi
call fcn.005d95d0
cmp dword [edi + 0xb8], 0x10
mov dword [esp + 0x24], eax
jb 0x598277
mov edi, dword [edi + 0xa4]
jmp 0x59827d
add edi, 0xa4
push edi
lea ecx, [esp + 0x24]
lea edi, [esp + 0xd4]
call fcn.004a89c0
add esp, 4
cmp dword [esp + 0x20], 0
jne 0x5982b0
cmp dword [esp + 0xd0], 0
jne 0x5982b0
lea eax, [esp + 0x20]
push eax
mov ecx, edi
call fcn.004a8890
mov esi, dword [eax]
push esi
call dword [sym.imp.WS2_32.dll_ntohl]
mov esi, eax
mov edi, 0x18
mov edi, edi
mov ecx, edi
mov edx, esi
shr edx, cl
add ebx, 1
sub edi, 8
mov byte [ebx - 1], dl
jns 0x5982c0
mov eax, dword [esp + 0x1c]
mov esi, dword [eax + 0x118]
mov edi, 0x18
mov ecx, edi
mov edx, esi
sar edx, cl
add ebx, 1
sub edi, 8
mov byte [ebx - 1], dl
jns 0x5982e0
mov esi, dword [eax + 0x11c]
mov edi, 0x18
lea esp, [esp]
mov ecx, edi
mov edx, esi
sar edx, cl
add ebx, 1
sub edi, 8
mov byte [ebx - 1], dl
jns 0x598300
movzx esi, word [eax + 0xd8]
mov edi, 8
lea ecx, [ecx]
mov cx, di
mov edx, esi
shr dx, cl
add ebx, 1
sub edi, 8
mov byte [ebx - 1], dl
jns 0x598320
xor esi, esi
mov dword [esp + 0xcc], 0xf
mov dword [esp + 0xc8], esi
mov byte [esp + 0xb8], 0
mov dword [esp + 0x420], esi
mov dword [esp + 0x28], esi
call fcn.005d95d0
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x3c], esp
push 0xffffffffffffffff
add eax, 0xe0
push esi
mov dword [ecx + 0x18], 0xf
mov dword [ecx + 0x14], esi
push eax
lea edi, [esp + 0x50]
mov byte [ecx + 4], 0
call fcn.0040b390
lea eax, [esp + 0x5c]
push eax
mov ecx, edi
call fcn.005054b0
add esp, 0x20
push 0xffffffffffffffff
push esi
add eax, 0x58
push eax
lea ecx, [esp + 0xc0]
mov byte [esp + 0x42c], 1
call fcn.0040b390
lea esi, [esp + 0x5c]
mov byte [esp + 0x420], 0
call fcn.004b10d0
cmp dword [esp + 0x58], 0x10
jb 0x5983df
mov ecx, dword [esp + 0x44]
push ecx
call fcn.0059b877
add esp, 4
mov edx, dword [esp + 0x28]
neg edx
sbb edx, edx
test edx, fcn.00489120
je 0x5983fb
lea eax, [esp + 0xb4]
call fcn.004321c0
mov ecx, dword [esp + 0xc8]
test ecx, ecx
je 0x598474
cmp ecx, 0xff
mov dword [esp + 0x20], 0xff
mov dword [esp + 0x18], ecx
lea eax, [esp + 0x20]
jg 0x598422
lea eax, [esp + 0x18]
mov eax, dword [eax]
cmp eax, ecx
mov dword [esp + 0x20], eax
ja 0x59843d
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0xbc]
call fcn.0040b930
jmp 0x59844d
push 0
sub eax, ecx
lea edi, [esp + 0xb8]
call fcn.004192a0
mov al, byte [esp + 0x20]
mov byte [ebx], 2
add ebx, 1
mov byte [ebx], al
add ebx, 1
lea edi, [esp + 0x18]
lea esi, [esp + 0xb4]
mov dword [esp + 0x18], ebx
call fcn.0057d8b0
mov ebx, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
cmp dword [edi + 0x1a0], 0
je 0x5984d7
movzx eax, word [edi + 0x1aa]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
cmp dword [edi + 0x1a4], 0x10
movzx ecx, ax
jb 0x5984a3
mov eax, dword [edi + 0x190]
jmp 0x5984a9
lea eax, [edi + 0x190]
lea edx, [esp + 0xec]
sub ebx, edx
lea edx, [esp + 0x28]
push edx
movzx ecx, cx
push ebx
push ecx
mov ecx, dword [edi + 0x1d4]
push eax
add ecx, 0xd20
lea edx, [esp + 0xfc]
call fcn.0057dc50
jmp 0x598501
mov esi, dword [edi + 0x1d4]
lea edx, [esp + 0xec]
lea eax, [esp + 0x28]
push eax
sub ebx, edx
push ebx
mov ecx, edx
push ecx
lea eax, [edi + 0x1a8]
push eax
add esi, 0xd20
call fcn.0057ecf0
mov edx, dword [edi + 0x78]
mov esi, 1
mov dword [edi + 0x1dc], esi
mov ecx, dword [edx + 0x24]
add ecx, 0xc70
lea eax, [ebx + 0x1c]
add dword [ecx], eax
cdq
add dword [ecx + 0x10], eax
adc dword [ecx + 0x14], edx
add dword [edi + 0x1d8], esi
mov eax, dword [esp + 0x28]
neg eax
sbb eax, eax
test eax, fcn.00489120
je 0x598564
push 0
push 0
push 0x611070
push 0xffffffffffffffff
lea ecx, [esp + 0x38]
push ecx
mov ecx, edi
call fcn.00596780
cmp dword [esp + 0xcc], 0x10
jb 0x59857e
mov edx, dword [esp + 0xb8]
push edx
jmp 0x598576
cmp dword [esp + 0xcc], 0x10
jb 0x59857e
mov eax, dword [esp + 0xb8]
push eax
call fcn.0059b877
add esp, 4
mov ecx, dword [esp + 0x418]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x400]
xor ecx, esp
call fcn.005b88a9
mov esp, ebp
pop ebp
ret