Function at 0x499880
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
push edi
mov byte [esp + 0x28], 0
mov eax, dword [esi + 0x90]
or eax, dword [esi + 0x94]
jne 0x4998bc
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x4998bc
push 7
lea eax, [esp + 0x18]
push esi
push eax
call fcn.004a1b00
add esp, 0xc
mov ebp, dword [esp + 0x30]
xor edi, edi
or dword [ebp], 2
mov ebx, dword [esi + 0x12c]
test ebx, ebx
je 0x499930
mov eax, dword [esi + 0x4b8]
shr eax, 5
cmp ebx, eax
jge 0x499b43
cmp byte [esi + 0x144], 0
jne 0x499b43
cmp byte [esi + 0x13f], 0
jne 0x499b43
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 + 0xc20]
jne 0x49992e
cmp edi, dword [esi + 0xc24]
je 0x499b43
mov edi, ebx
mov eax, dword [esi + 0x890]
test eax, eax
jne 0x499957
push dword [esi + 0x4b8]
call dword [section..data]
add esp, 4
mov dword [esi + 0x890], eax
test eax, eax
je 0x499a9b
test edi, edi
je 0x499970
mov ecx, dword [esi + 0x130]
cmp ecx, eax
je 0x499970
push edi
push ecx
push eax
call fcn.004b94a0
add esp, 0xc
cmp byte [esi + 0x13f], 0
mov edx, dword [esi + 0x890]
mov dword [esi + 0x130], edx
jne 0x499d34
cmp dword [esi + 0x108], 2
mov ecx, dword [esi + 0x134]
jne 0x4999e8
cmp dword [ecx + 0x1a0], 2
jne 0x4999e8
and dword [esi + 0xf4], 0xfffffffd
lea eax, [esp + 0x14]
push eax
mov dword [esi + 0x108], 1
call fcn.0049ac10
push 0
movups xmm0, xmmword [eax]
movups xmmword [esi + 0xf8], xmm0
and dword [ebp], 0xfffffffd
mov eax, dword [esi + 0x66c]
cdq
push edx
push eax
push esi
call fcn.00482ea0
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esp + 0x2c]
mov eax, dword [eax + 0x280]
test dword [eax + 0x44], 0x40003
je 0x499a07
cmp dword [ecx + 0x1a0], 1
sete bl
jmp 0x499a0b
mov bl, byte [esp + 0x28]
lea eax, [edx + edi]
mov dword [esi + 0x130], eax
lea eax, [esp + 0x28]
push eax
mov eax, dword [esi + 0x4b8]
sub eax, edi
push eax
push esi
call fcn.00497d20
sub dword [esi + 0x130], edi
add esp, 0xc
test eax, eax
jne 0x499d5f
mov ebp, dword [esp + 0x28]
add ebp, edi
je 0x499d34
test ebp, ebp
jle 0x499d3d
mov dword [esi + 0x12c], ebp
test bl, bl
jne 0x499b43
cmp byte [esi + 0x695], bl
je 0x499b43
mov eax, dword [esi + 0x8fc]
test eax, eax
jne 0x499aa8
mov eax, dword [esi + 0x4b8]
add eax, eax
push eax
call dword [section..data]
add esp, 4
mov dword [esi + 0x8fc], eax
test eax, eax
jne 0x499aa8
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.00492850
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
add esp, 0x14
ret
test edi, edi
je 0x499abc
push edi
push dword [esi + 0x130]
push eax
call fcn.004b94a0
add esp, 0xc
mov ecx, edi
cmp edi, ebp
jge 0x499b2d
nop dword [eax]
nop word [eax + eax]
mov eax, dword [esi + 0x130]
mov dl, byte [edi + eax]
mov eax, dword [esi + 0x8fc]
cmp dl, 0xa
jne 0x499b24
mov byte [eax + ecx], 0xd
inc ecx
mov eax, dword [esi + 0x8fc]
mov byte [ecx + eax], dl
cmp byte [esi + 0x695], 0
jne 0x499b27
mov edx, dword [esi + 0xc20]
mov eax, edx
mov ebx, dword [esi + 0xc24]
and eax, ebx
cmp eax, 0xffffffff
je 0x499b27
add edx, 1
mov dword [esi + 0xc20], edx
adc ebx, 0
mov dword [esi + 0xc24], ebx
jmp 0x499b27
mov byte [eax + ecx], dl
inc edi
inc ecx
cmp edi, ebp
jl 0x499ad0
cmp ecx, ebp
je 0x499b43
mov eax, dword [esi + 0x8fc]
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], ecx
mov ebx, dword [esp + 0x2c]
lea eax, [esp + 0x10]
push eax
push dword [esi + 0x12c]
push dword [esi + 0x130]
push dword [ebx + 0x29c]
push esi
call fcn.00492d80
add esp, 0x14
test eax, eax
jne 0x499d5f
mov edi, dword [ebx + 0x29c]
push eax
push eax
lea eax, [esp + 0x38]
push eax
push 4
lea eax, [esp + 0x38]
push eax
push 0
push 0
push 0x4004747b
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x499baf
push 4
lea eax, [esp + 0x2c]
push eax
push 0x1001
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
mov ebp, dword [esi + 0xb0]
mov eax, ebp
mov ebx, dword [esi + 0xb4]
or eax, ebx
mov dword [esp + 0x28], ebx
je 0x499c11
mov eax, dword [esp + 0x10]
cdq
cmp ebx, edx
jg 0x499bd4
jl 0x499bdc
cmp ebp, eax
jb 0x499bdc
mov ebp, eax
mov dword [esp + 0x28], edx
mov ebx, edx
push ebp
push dword [esi + 0x130]
push 2
push esi
call fcn.004927b0
mov edi, dword [esp + 0x20]
add esp, 0x10
sub dword [esi + 0xb0], ebp
mov eax, edi
cdq
sbb dword [esi + 0xb4], ebx
mov ebx, eax
sub ebx, ebp
mov eax, edx
sbb eax, dword [esp + 0x28]
mov dword [esp + 0x28], eax
jmp 0x499c20
mov edi, dword [esp + 0x10]
mov eax, edi
cdq
mov ebx, eax
mov dword [esp + 0x28], edx
mov eax, edx
mov ecx, ebx
or ecx, eax
je 0x499c63
push ebx
sub edi, ebx
add edi, dword [esi + 0x130]
push edi
push 4
push esi
call fcn.004927b0
add ebx, dword [esi + 0x98]
mov eax, dword [esi + 0x9c]
adc eax, dword [esp + 0x38]
push eax
push ebx
push esi
mov dword [esi + 0x98], ebx
mov dword [esi + 0x9c], eax
call fcn.004a18e0
mov edi, dword [esp + 0x2c]
add esp, 0x1c
cmp byte [esi + 0x144], 0
je 0x499c75
cmp byte [esi + 0x146], 0
je 0x499caa
mov eax, dword [esi + 0x98]
cmp eax, dword [esi + 0xc20]
jne 0x499caa
mov eax, dword [esi + 0x9c]
cmp eax, dword [esi + 0xc24]
jne 0x499caa
push str.We_are_completely_uploaded_and_fine
push esi
mov byte [esi + 0x13f], 1
call fcn.00492920
mov edi, dword [esp + 0x18]
add esp, 8
mov eax, dword [esi + 0x12c]
cmp eax, edi
je 0x499ccc
add dword [esi + 0x130], edi
sub eax, edi
pop edi
mov dword [esi + 0x12c], eax
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esi + 0x890]
test eax, eax
jne 0x499cf3
push dword [esi + 0x4b8]
call dword [section..data]
add esp, 4
mov dword [esi + 0x890], eax
test eax, eax
je 0x499a9b
cmp byte [esi + 0x13f], 0
mov dword [esi + 0x130], eax
mov dword [esi + 0x12c], 0
je 0x499d5d
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x251], 0
je 0x499d5d
push esi
call fcn.004989e0
add esp, 4
test eax, eax
je 0x499d5d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
test byte [esi + 0xf4], 0x20
jne 0x499d5d
mov eax, dword [esi + 0xc]
and dword [esi + 0xf4], 0xfffffffd
cmp byte [eax + 0x251], 0
je 0x499d5d
push esi
call fcn.004989e0
add esp, 4
test eax, eax
jne 0x499d5f
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret