Function at 0x1005aaf0
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov byte [ebp + 0xb], 0
mov eax, dword [esi + 0x90]
or eax, dword [esi + 0x94]
jne 0x1005ab2b
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x1005ab2b
push 7
lea eax, [ebp - 0x18]
push esi
push eax
call fcn.1005b440
add esp, 0xc
mov eax, dword [ebp + 0x10]
xor edi, edi
mov dword [ebp - 8], edi
or dword [eax], 2
mov ebx, dword [esi + 0x12c]
test ebx, ebx
je 0x1005aba3
mov eax, dword [esi + 0x4cc]
shr eax, 5
cmp ebx, eax
jge 0x1005ade0
cmp byte [esi + 0x144], 0
jne 0x1005ade0
cmp byte [esi + 0x13f], 0
jne 0x1005ade0
mov ecx, dword [esi + 0x98]
mov eax, ebx
sub ecx, dword [esi + 0xb0]
mov edi, dword [esi + 0x9c]
sbb edi, dword [esi + 0xb4]
cdq
add ecx, eax
adc edi, edx
cmp ecx, dword [esi + 0xc38]
jne 0x1005ab9e
cmp edi, dword [esi + 0xc3c]
je 0x1005ade0
mov edi, ebx
mov dword [ebp - 8], ebx
mov eax, dword [esi + 0x8e0]
test eax, eax
jne 0x1005abca
push dword [esi + 0x4cc]
call dword [0x100dcbac]
add esp, 4
mov dword [esi + 0x8e0], eax
test eax, eax
je 0x1005ad0a
test edi, edi
je 0x1005abe3
mov ecx, dword [esi + 0x130]
cmp ecx, eax
je 0x1005abe3
push edi
push ecx
push eax
call fcn.1008dc20
add esp, 0xc
cmp byte [esi + 0x13f], 0
mov edx, dword [esi + 0x8e0]
mov dword [esi + 0x130], edx
jne 0x1005afb7
cmp dword [esi + 0x108], 2
mov ecx, dword [esi + 0x134]
jne 0x1005ac5b
cmp dword [ecx + 0x1a0], 2
jne 0x1005ac5b
and dword [esi + 0xf4], 0xfffffffd
lea eax, [ebp - 0x18]
push eax
mov dword [esi + 0x108], 1
call fcn.10052170
push 0
movups xmm0, xmmword [eax]
mov eax, dword [ebp + 0x10]
movups xmmword [esi + 0xf8], xmm0
and dword [eax], 0xfffffffd
mov eax, dword [esi + 0x6b0]
cdq
push edx
push eax
push esi
call fcn.1003d520
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x2a8]
test dword [eax + 0x44], 0x40003
je 0x1005ac78
cmp dword [ecx + 0x1a0], 1
sete byte [ebp + 0xb]
lea eax, [edx + edi]
mov dword [esi + 0x130], eax
lea eax, [ebp + 0x10]
push eax
mov eax, dword [esi + 0x4cc]
sub eax, edi
push eax
push esi
call fcn.10059120
sub dword [esi + 0x130], edi
add esp, 0xc
test eax, eax
jne 0x1005afe2
mov ebx, dword [ebp + 0x10]
add ebx, edi
mov dword [ebp + 0x10], ebx
je 0x1005afb7
test ebx, ebx
jle 0x1005afc0
mov dword [esi + 0x12c], ebx
cmp byte [ebp + 0xb], al
jne 0x1005adbb
cmp byte [esi + 0x6e1], al
je 0x1005adbb
mov eax, dword [esi + 0x94c]
test eax, eax
jne 0x1005ad16
mov eax, dword [esi + 0x4cc]
add eax, eax
push eax
call dword [0x100dcbac]
add esp, 4
mov dword [esi + 0x94c], eax
test eax, eax
jne 0x1005ad16
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.1004c9f0
add esp, 8
pop edi
pop esi
mov eax, 0x1b
pop ebx
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x1005ad2a
push edi
push dword [esi + 0x130]
push eax
call fcn.1008dc20
add esp, 0xc
mov edx, edi
mov ecx, edi
cmp edi, ebx
jge 0x1005ada3
nop dword [eax]
nop word [eax + eax]
mov eax, dword [esi + 0x130]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0x94c]
cmp bl, 0xa
jne 0x1005ad94
mov byte [eax + ecx], 0xd
inc ecx
mov eax, dword [esi + 0x94c]
mov byte [ecx + eax], bl
cmp byte [esi + 0x6e1], 0
jne 0x1005ad97
mov edi, dword [esi + 0xc38]
mov eax, edi
mov ebx, dword [esi + 0xc3c]
and eax, ebx
cmp eax, 0xffffffff
je 0x1005ad97
add edi, 1
mov dword [esi + 0xc38], edi
adc ebx, 0
mov dword [esi + 0xc3c], ebx
jmp 0x1005ad97
mov byte [eax + ecx], bl
mov ebx, dword [ebp + 0x10]
inc edx
inc ecx
cmp edx, ebx
jl 0x1005ad40
mov edi, dword [ebp - 8]
cmp ecx, ebx
je 0x1005adbb
mov eax, dword [esi + 0x94c]
mov ebx, ecx
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], ecx
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x2a8]
test dword [eax + 0x44], 0x30000
je 0x1005ade0
push edi
push ebx
push esi
call fcn.1006c920
add esp, 0xc
test eax, eax
jne 0x1005afe2
mov ebx, dword [ebp + 0xc]
lea eax, [ebp - 4]
push eax
push dword [esi + 0x12c]
push dword [esi + 0x130]
push dword [ebx + 0x2c4]
push esi
call fcn.1004ceb0
add esp, 0x14
test eax, eax
jne 0x1005afe2
mov edi, dword [ebx + 0x2c4]
push eax
push eax
lea eax, [ebp + 8]
push eax
push 4
lea eax, [ebp + 0x10]
push eax
push 0
push 0
push 0x4004747b
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x1005ae47
push 4
lea eax, [ebp + 0x10]
push eax
push 0x1001
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ebx, dword [esi + 0xb0]
mov eax, ebx
mov edi, dword [esi + 0xb4]
or eax, edi
mov dword [ebp + 0x10], ebx
mov dword [ebp + 8], edi
je 0x1005aeaa
mov eax, dword [ebp - 4]
cdq
cmp edi, edx
jg 0x1005ae6d
jl 0x1005ae77
cmp ebx, eax
jb 0x1005ae77
mov ebx, eax
mov dword [ebp + 0x10], eax
mov edi, edx
mov dword [ebp + 8], edx
push ebx
push dword [esi + 0x130]
push 2
push esi
call fcn.1004c950
add esp, 0x10
sub dword [esi + 0xb0], ebx
sbb dword [esi + 0xb4], edi
mov edi, dword [ebp - 4]
mov eax, edi
cdq
mov ebx, eax
mov eax, edx
sub ebx, dword [ebp + 0x10]
sbb eax, dword [ebp + 8]
mov dword [ebp + 0x10], eax
jmp 0x1005aeb7
mov edi, dword [ebp - 4]
mov eax, edi
cdq
mov ebx, eax
mov dword [ebp + 0x10], edx
mov eax, edx
mov ecx, ebx
or ecx, eax
je 0x1005aefa
mov eax, dword [esi + 0x130]
sub eax, ebx
push ebx
add eax, edi
push eax
push 4
push esi
call fcn.1004c950
add ebx, dword [esi + 0x98]
mov eax, dword [esi + 0x9c]
adc eax, dword [ebp + 0x10]
push eax
push ebx
push esi
mov dword [esi + 0x98], ebx
mov dword [esi + 0x9c], eax
call fcn.1005b230
mov edi, dword [ebp - 4]
add esp, 0x1c
cmp byte [esi + 0x144], 0
je 0x1005af0c
cmp byte [esi + 0x146], 0
je 0x1005af2f
mov eax, dword [esi + 0x98]
cmp eax, dword [esi + 0xc38]
jne 0x1005af2f
mov eax, dword [esi + 0x9c]
cmp eax, dword [esi + 0xc3c]
jne 0x1005af2f
mov byte [esi + 0x13f], 1
mov eax, dword [esi + 0x12c]
cmp eax, edi
je 0x1005af50
add dword [esi + 0x130], edi
sub eax, edi
pop edi
mov dword [esi + 0x12c], eax
xor eax, eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x8e0]
test eax, eax
jne 0x1005af77
push dword [esi + 0x4cc]
call dword [0x100dcbac]
add esp, 4
mov dword [esi + 0x8e0], eax
test eax, eax
je 0x1005ad0a
cmp byte [esi + 0x13f], 0
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], 0
je 0x1005afe0
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x271], 0
je 0x1005afe0
push esi
call fcn.10059cf0
add esp, 4
test eax, eax
je 0x1005afe0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test byte [esi + 0xf4], 0x20
jne 0x1005afe0
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x271], 0
je 0x1005afe0
push esi
call fcn.10059cf0
add esp, 4
test eax, eax
jne 0x1005afe2
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret