Function at 0x51ae80
Capabilities:
Set socket configuration

Disassembly:
sub esp, 8
push ebx
push esi
mov esi, dword [esp + 0x14]
push edi
mov byte [esp + 0xf], 0
mov eax, dword [esi + 0x98]
or eax, dword [esi + 0x9c]
jne 0x51aeb6
mov eax, dword [esi + 0xa0]
or eax, dword [esi + 0xa4]
jne 0x51aeb6
push 7
push esi
call fcn.0050f3f0
add esp, 8
mov ebx, dword [esp + 0x20]
mov edi, dword [esp + 0x1c]
or dword [ebx], 2
cmp dword [esi + 0x120], 0
jne 0x51b0bf
cmp dword [esi + 0xc0c], 0
jne 0x51aef4
push dword [esi + 0x8d4]
call dword [0x1c4e5c8]
add esp, 4
mov dword [esi + 0xc0c], eax
test eax, eax
je 0x51affe
cmp byte [esi + 0x566], 0
mov eax, dword [esi + 0xc0c]
mov dword [esi + 0x124], eax
jne 0x51b1d3
cmp dword [esi + 0xfc], 2
mov ecx, dword [esi + 0x128]
jne 0x51af67
cmp dword [ecx + 0x1a0], 2
jne 0x51af67
and dword [esi + 0x114], 0xfffffffd
mov dword [esi + 0xfc], 1
call fcn.0050ee90
mov dword [esi + 0xf4], eax
mov dword [esi + 0xf8], edx
and dword [ebx], 0xfffffffd
mov eax, dword [esi + 0xa48]
push 0
cdq
push edx
push eax
push esi
call fcn.004ff480
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 8
ret
mov eax, dword [edi + 0x2c0]
test dword [eax + 0x40], 0x40003
je 0x51af82
cmp dword [ecx + 0x1a0], 1
sete byte [esp + 0xf]
lea eax, [esp + 0x18]
push eax
push dword [esi + 0x8d4]
push edi
call fcn.00519690
add esp, 0xc
test eax, eax
jne 0x51b268
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x51b1d3
jle 0x51b1e0
mov dword [esi + 0x120], ebx
cmp byte [esp + 0xf], al
jne 0x51b09e
cmp byte [esi + 0xa7e], al
je 0x51b09e
cmp dword [esi + 0xc50], eax
jne 0x51b00a
mov eax, dword [esi + 0x8d4]
add eax, eax
push eax
call dword [0x1c4e5c8]
add esp, 4
mov dword [esi + 0xc50], eax
test eax, eax
jne 0x51b00a
push str.Failed_to_alloc_scratch_buffer_
push esi
call fcn.004feb50
add esp, 8
pop edi
pop esi
mov eax, 0x1b
pop ebx
add esp, 8
ret
xor ecx, ecx
xor edx, edx
test ebx, ebx
jle 0x51b086
mov edi, dword [esp + 0x18]
push ebp
jmp 0x51b020
mov eax, dword [esi + 0x124]
mov bl, byte [edx + eax]
mov eax, dword [esi + 0xc50]
cmp bl, 0xa
jne 0x51b074
mov byte [ecx + eax], 0xd
inc ecx
mov eax, dword [esi + 0xc50]
mov byte [ecx + eax], bl
cmp byte [esi + 0xa7e], 0
jne 0x51b077
mov ebx, dword [esi + 0xe20]
mov eax, ebx
mov ebp, dword [esi + 0xe24]
and eax, ebp
cmp eax, 0xffffffff
je 0x51b077
add ebx, 1
mov dword [esi + 0xe20], ebx
adc ebp, 0
mov dword [esi + 0xe24], ebp
jmp 0x51b077
mov byte [ecx + eax], bl
inc edx
inc ecx
cmp edx, edi
jl 0x51b020
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
pop ebp
cmp ecx, ebx
je 0x51b09e
mov eax, dword [esi + 0xc50]
mov ebx, ecx
mov dword [esi + 0x124], eax
mov dword [esi + 0x120], ecx
mov eax, dword [edi + 0x2c0]
test dword [eax + 0x40], 0x30000
je 0x51b0bf
push ebx
push edi
call fcn.0050c490
add esp, 8
test eax, eax
jne 0x51b268
lea eax, [esp + 0x10]
push eax
push dword [esi + 0x120]
push dword [esi + 0x124]
push dword [edi + 0x2dc]
push edi
call fcn.004fef60
add esp, 0x14
test eax, eax
jne 0x51b268
mov ebx, dword [edi + 0x2dc]
push eax
push eax
lea eax, [esp + 0x28]
push eax
push 4
lea eax, [esp + 0x28]
push eax
push 0
push 0
push 0x4004747b
push ebx
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x51b127
push 4
lea eax, [esp + 0x1c]
push eax
push 0x1001
push 0xffff
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp byte [esi + 0xa91], 0
je 0x51b145
push dword [esp + 0x10]
push dword [esi + 0x124]
push 4
push esi
call fcn.004feac0
add esp, 0x10
mov eax, dword [esp + 0x10]
cdq
add dword [esi + 0xa0], eax
adc dword [esi + 0xa4], edx
push dword [esi + 0xa4]
push dword [esi + 0xa0]
push esi
call fcn.0050f2f0
add esp, 0xc
cmp byte [esi + 0x56a], 0
je 0x51b17d
cmp byte [esi + 0x56c], 0
je 0x51b1ae
mov eax, dword [esi + 0xa0]
cmp eax, dword [esi + 0xe20]
jne 0x51b1ae
mov eax, dword [esi + 0xa4]
cmp eax, dword [esi + 0xe24]
jne 0x51b1ae
push str.We_are_completely_uploaded_and_fine_n
push esi
mov byte [esi + 0x566], 1
call fcn.004fec10
add esp, 8
mov eax, dword [esi + 0x120]
mov ecx, dword [esp + 0x10]
cmp eax, ecx
je 0x51b204
add dword [esi + 0x124], ecx
sub eax, ecx
pop edi
mov dword [esi + 0x120], eax
xor eax, eax
pop esi
pop ebx
add esp, 8
ret
test byte [esi + 0x114], 0x20
jne 0x51b266
and dword [esi + 0x114], 0xfffffffd
cmp byte [edi + 0x299], 0
je 0x51b266
push edi
call fcn.00519f60
add esp, 4
test eax, eax
je 0x51b266
pop edi
pop esi
pop ebx
add esp, 8
ret
cmp dword [esi + 0xc0c], 0
jne 0x51b22a
push dword [esi + 0x8d4]
call dword [0x1c4e5c8]
add esp, 4
mov dword [esi + 0xc0c], eax
test eax, eax
je 0x51affe
cmp byte [esi + 0x566], 0
mov eax, dword [esi + 0xc0c]
mov dword [esi + 0x124], eax
mov dword [esi + 0x120], 0
je 0x51b266
and dword [esi + 0x114], 0xfffffffd
cmp byte [edi + 0x299], 0
je 0x51b266
push edi
call fcn.00519f60
add esp, 4
test eax, eax
jne 0x51b268
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 8
ret