Function at 0x502c90
Capabilities:
Set socket configuration

Disassembly:
sub esp, 0x2c
mov eax, dword [esp + 0x38]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x3c]
xor ebx, ebx
or dword [eax], 2
push edi
mov byte [esp + 0x40], 0
mov edi, dword [esi + 0x114]
mov dword [esp + 0x18], ebx
test edi, edi
je 0x502d19
mov eax, dword [esi + 0x4ac]
shr eax, 5
cmp edi, eax
jge 0x502f7e
cmp byte [esi + 0x145], bl
jne 0x502f7e
cmp byte [esi + 0x140], bl
jne 0x502f7e
mov ecx, dword [esi + 0xa0]
mov eax, edi
sub ecx, dword [esi + 0xa8]
mov ebx, dword [esi + 0xa4]
sbb ebx, dword [esi + 0xac]
cdq
add ecx, eax
adc ebx, edx
cmp ecx, dword [esi + 0xc70]
jne 0x502d13
cmp ebx, dword [esi + 0xc74]
je 0x502f7e
mov ebx, edi
mov dword [esp + 0x18], ebx
mov eax, dword [esi + 0x8c0]
lea edi, [esi + 0x8c0]
test eax, eax
jne 0x502d42
push dword [esi + 0x4ac]
call dword [0x6211e0]
add esp, 4
mov dword [edi], eax
test eax, eax
je 0x502e93
test ebx, ebx
je 0x502d61
mov ecx, dword [esi + 0x118]
cmp ecx, eax
je 0x502d61
push ebx
push ecx
push eax
call fcn.00572480
add esp, 0xc
lea edi, [esi + 0x8c0]
cmp byte [esi + 0x140], 0
mov edx, dword [edi]
mov dword [esi + 0x118], edx
jne 0x5031a2
cmp dword [esi + 0xf0], 2
mov ecx, dword [esi + 0x11c]
jne 0x502dd5
cmp dword [ecx + 0x30], 2
jne 0x502dd5
and dword [esi + 0xdc], 0xfffffffd
lea eax, [esp + 0x1c]
push eax
mov dword [esi + 0xf0], 1
call fcn.004fde70
push 0
movups xmm0, xmmword [eax]
mov eax, dword [esp + 0x50]
movups xmmword [esi + 0xe0], xmm0
and dword [eax], 0xfffffffd
mov eax, dword [esi + 0x678]
cdq
push edx
push eax
push esi
call fcn.004f8360
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esp + 0x44]
mov eax, dword [eax + 0x200]
test dword [eax + 0x44], 0x40003
je 0x502df1
cmp dword [ecx + 0x30], 1
sete byte [esp + 0x40]
lea eax, [edx + ebx]
mov dword [esi + 0x118], eax
lea eax, [esp + 0x48]
push eax
mov eax, dword [esi + 0x4ac]
sub eax, ebx
push eax
push esi
call fcn.00501130
sub dword [esi + 0x118], ebx
add esp, 0xc
test eax, eax
jne 0x5031bd
mov ebp, dword [esp + 0x48]
add ebp, ebx
je 0x5031a2
test ebp, ebp
jle 0x5031ab
mov dword [esi + 0x114], ebp
cmp byte [esp + 0x40], al
jne 0x502f58
lea ecx, [esi + 0x6b3]
mov dword [esp + 0x14], ecx
cmp byte [ecx], al
je 0x502f58
mov eax, dword [esi + 0x938]
lea edi, [esi + 0x938]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x40], edi
test eax, eax
jne 0x502eb4
mov eax, dword [esi + 0x4ac]
add eax, eax
push eax
call dword [0x6211e0]
add esp, 4
mov dword [edi], eax
test eax, eax
jne 0x502ea0
push str.Failed_to_alloc_scratch_buffer
push esi
call fcn.004e0f60
add esp, 8
mov eax, 0x1b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
lea ecx, [esi + 0x6b3]
mov dword [esp + 0x48], ecx
lea ecx, [esi + 0x938]
mov dword [esp + 0x40], ecx
test ebx, ebx
je 0x502ed6
push ebx
push dword [esi + 0x118]
push eax
call fcn.00572480
mov eax, dword [esp + 0x54]
add esp, 0xc
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x40]
jmp 0x502ed8
mov eax, edi
mov edx, ebx
mov ecx, ebx
cmp ebx, ebp
jge 0x502f44
mov eax, dword [esi + 0x118]
mov bl, byte [edx + eax]
mov eax, dword [edi]
cmp bl, 0xa
jne 0x50309d
mov byte [eax + ecx], 0xd
inc ecx
mov eax, dword [edi]
mov byte [ecx + eax], bl
mov eax, dword [esp + 0x14]
cmp byte [eax], 0
jne 0x502f34
mov edi, dword [esi + 0xc70]
mov eax, edi
mov ebx, dword [esi + 0xc74]
and eax, ebx
cmp eax, 0xffffffff
je 0x502f2e
add edi, 1
mov dword [esi + 0xc70], edi
adc ebx, 0
mov dword [esi + 0xc74], ebx
lea edi, [esi + 0x938]
inc edx
inc ecx
cmp edx, ebp
jl 0x502ee0
mov ebx, dword [esp + 0x18]
lea eax, [esi + 0x938]
cmp ecx, ebp
je 0x502f58
mov eax, dword [eax]
mov ebp, ecx
mov dword [esi + 0x118], eax
mov dword [esi + 0x114], ecx
mov eax, dword [esp + 0x44]
mov eax, dword [eax + 0x200]
test dword [eax + 0x44], 0x30000
je 0x502f7e
push ebx
push ebp
push esi
call fcn.004e94c0
add esp, 0xc
test eax, eax
jne 0x5031bd
mov ebx, dword [esp + 0x44]
lea eax, [esp + 0x10]
push eax
push dword [esi + 0x114]
push dword [esi + 0x118]
push dword [ebx + 0x21c]
push esi
call fcn.00503820
add esp, 0x14
test eax, eax
jne 0x5031bd
lea eax, [esp + 0x2c]
push eax
call fcn.004fde70
mov edx, eax
sub esp, 0xc
mov ecx, esp
sub esp, 0x10
mov eax, esp
movups xmm0, xmmword [edx]
movups xmmword [esp + 0x3c], xmm0
movups xmm0, xmmword [esi + 0x128]
movups xmmword [ecx], xmm0
movups xmm0, xmmword [edx]
movups xmmword [eax], xmm0
call fcn.004fdf20
add esp, 0x20
test edx, edx
jl 0x50303b
jg 0x502fed
cmp eax, 0x3e8
jbe 0x50303b
mov edi, dword [ebx + 0x21c]
lea eax, [esp + 0x40]
push 0
push 0
push eax
push 4
lea eax, [esp + 0x58]
push eax
push 0
push 0
push 0x4004747b
push edi
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x50302f
push 4
lea eax, [esp + 0x4c]
push eax
push 0x1001
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
movups xmm0, xmmword [esp + 0x1c]
movups xmmword [esi + 0x128], xmm0
mov ebx, dword [esi + 0xa8]
mov eax, ebx
mov ebp, dword [esi + 0xac]
or eax, ebp
mov dword [esp + 0x48], ebp
je 0x5030a5
mov eax, dword [esp + 0x10]
cdq
cmp ebp, edx
jg 0x503060
jl 0x503068
cmp ebx, eax
jb 0x503068
mov ebx, eax
mov dword [esp + 0x48], edx
mov ebp, edx
push ebx
push dword [esi + 0x118]
push 2
push esi
call fcn.004e0ec0
mov edi, dword [esp + 0x20]
add esp, 0x10
sub dword [esi + 0xa8], ebx
mov eax, edi
cdq
sbb dword [esi + 0xac], ebp
mov ebp, eax
sub ebp, ebx
mov eax, edx
sbb eax, dword [esp + 0x48]
mov dword [esp + 0x48], eax
jmp 0x5030b4
mov byte [eax + ecx], bl
jmp 0x502f34
mov edi, dword [esp + 0x10]
mov eax, edi
cdq
mov ebp, eax
mov dword [esp + 0x48], edx
mov eax, edx
mov ecx, ebp
or ecx, eax
je 0x5030f7
mov eax, dword [esi + 0x118]
sub eax, ebp
push ebp
add eax, edi
push eax
push 4
push esi
call fcn.004e0ec0
add dword [esi + 0xa0], ebp
mov eax, dword [esp + 0x58]
adc dword [esi + 0xa4], eax
push dword [esi + 0xa4]
push dword [esi + 0xa0]
push esi
call fcn.00503f10
mov edi, dword [esp + 0x2c]
add esp, 0x1c
cmp byte [esi + 0x145], 0
je 0x503109
cmp byte [esi + 0x147], 0
je 0x50313e
mov eax, dword [esi + 0xa0]
cmp eax, dword [esi + 0xc70]
jne 0x50313e
mov eax, dword [esi + 0xa4]
cmp eax, dword [esi + 0xc74]
jne 0x50313e
push str.We_are_completely_uploaded_and_fine
push esi
mov byte [esi + 0x140], 1
call fcn.004e1030
mov edi, dword [esp + 0x18]
add esp, 8
mov eax, dword [esi + 0x114]
cmp eax, edi
je 0x503160
add dword [esi + 0x118], edi
sub eax, edi
mov dword [esi + 0x114], eax
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esi + 0x8c0]
test eax, eax
jne 0x503187
push dword [esi + 0x4ac]
call dword [0x6211e0]
add esp, 4
mov dword [esi + 0x8c0], eax
test eax, eax
je 0x502e93
cmp byte [esi + 0x140], 0
mov dword [esi + 0x118], eax
mov dword [esi + 0x114], 0
je 0x5031bb
jmp 0x5031ab
test byte [esi + 0xdc], 0x20
jne 0x5031bb
and dword [esi + 0xdc], 0xfffffffd
push esi
call fcn.00507490
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret