Function at 0x4055b0
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
mov eax, dword [0x410004]
xor eax, esp
mov dword [esp + 0x40], eax
push ebx
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, 4
push edi
push 0x10
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x1c], ebx
call esi
add esp, 4
mov edi, eax
mov dword [esp + 0x14], edi
push 0x20
call esi
add esp, 4
mov esi, eax
cmp dword [0x4104f8], 0
mov dword [esp + 0x10], esi
je 0x405634
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push edi
call esi
add esp, 4
push dword [esp + 0x10]
call esi
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x40]
xor ecx, esp
call fcn.004088e2
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x10]
push str.main_loop_iteration
push 7
call fcn.004052a0
add esp, 8
test ebx, ebx
jne 0x40566b
mov ebx, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
xor eax, eax
push eax
push edi
mov dword [esp + 0x20], eax
call ebx
mov edi, eax
push 0
push esi
mov dword [esp + 0x24], edi
call ebx
mov esi, eax
add esp, 0x10
mov dword [esp + 0x10], esi
mov eax, dword [esp + 0x28]
mov ebx, 1
mov dword [edi], 0
push 0x410510
mov dword [esi], eax
mov dword [esi + 4], 0x300
call dword [sym.imp.pthreadVC3.dll_pthread_mutex_lock]
mov ecx, dword [0x41048c]
add esp, 4
xor esi, esi
test ecx, ecx
jle 0x40572d
mov eax, dword [0x410488]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x405720
movzx ecx, word [eax + 0x1c]
mov edx, dword [esp + 0x18]
mov eax, dword [eax]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], eax
cmp ebx, edx
jne 0x4056ff
add edx, edx
mov dword [esp + 0x18], edx
lea eax, [edx*4]
push eax
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
mov edi, eax
mov eax, dword [esp + 0x20]
shl eax, 3
push eax
push dword [esp + 0x1c]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
mov ecx, dword [esp + 0x30]
mov edx, eax
mov eax, dword [esp + 0x2c]
add esp, 0x10
mov dword [esp + 0x10], edx
jmp 0x405703
mov edx, dword [esp + 0x10]
mov dword [edi + ebx*4], 1
mov dword [edx + ebx*8], eax
xor eax, eax
mov word [edx + ebx*8 + 4], cx
mov word [edx + ebx*8 + 6], ax
inc ebx
mov ecx, dword [0x41048c]
inc esi
cmp esi, ecx
jl 0x4056a1
mov dword [esp + 0x14], edi
push 0x410510
call dword [sym.imp.pthreadVC3.dll_pthread_mutex_unlock]
add esp, 4
push ebx
push str.fd_count_is__d
push 7
call fcn.004052a0
add esp, 0xc
push 0x64
push ebx
push dword [esp + 0x18]
call dword [sym.imp.WS2_32.dll_WSAPoll]
mov esi, eax
call fcn.00408020
push esi
push str.poll___returned__d
push 7
call fcn.004052a0
add esp, 0xc
cmp esi, 0xffffffff
jne 0x4057c4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
cmp dword [eax], 4
jne 0x4059c9
cmp dword [0x4104f8], 0
jne 0x4059df
cmp dword [0x4104fc], 0
mov ebx, dword [esp + 0x18]
je 0x405630
push str.Device_discovery_triggered
push 4
mov dword [0x4104fc], 0
call fcn.004052a0
add esp, 8
call fcn.00407dc0
jmp 0x4059c9
xor ecx, ecx
xor esi, esi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x1c], esi
test ebx, ebx
jle 0x4059c9
mov edi, dword [esp + 0x10]
add edi, 6
mov dword [esp + 0x20], edi
cmp word [edi], 0
je 0x4059b1
mov eax, dword [esp + 0x14]
test ecx, ecx
jne 0x405814
cmp dword [eax + esi*4], 2
jne 0x405814
call fcn.00408020
test eax, eax
js 0x4059f3
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], 1
cmp dword [eax + esi*4], 0
jne 0x40599c
lea eax, [esp + 0x30]
mov dword [esp + 0x30], 0x10
push eax
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x30]
call dword [sym.imp.WS2_32.dll_accept]
mov edi, eax
test edi, edi
js 0x405a2c
lea eax, [esp + 0x34]
mov dword [esp + 0x34], 1
push eax
push 0x8004667e
push edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [esp + 0x2c]
push 4
push eax
push 0x1001
push 0xffff
push edi
mov dword [esp + 0x40], 0x20000
call esi
cmp eax, 0xffffffff
jne 0x405893
push str.Could_not_set_send_buffer_for_client_socket
push 2
call fcn.004052a0
add esp, 8
push 4
lea eax, [esp + 0x30]
push eax
push 0x1002
push 0xffff
push edi
call esi
cmp eax, 0xffffffff
jne 0x4058bb
push str.Could_not_set_receive_buffer_for_client_socket
push 2
call fcn.004052a0
add esp, 8
push 4
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], 1
push eax
push 1
push 6
push edi
call esi
push 0x38
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov esi, eax
push 0x38
push 0
push esi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [esi], edi
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push 0x10000
call edi
add esp, 4
mov dword [esi + 4], eax
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0x10000
push 0x10000
call edi
add esp, 4
mov dword [esi + 0x10], eax
mov eax, 0x300
mov dword [esi + 0x14], 0
mov dword [esi + 0x18], 0x10000
mov dword [esi + 0x28], 0
push 0x410510
mov word [esi + 0x1c], ax
mov dword [esi + 0x34], 0
call dword [sym.imp.pthreadVC3.dll_pthread_mutex_lock]
mov eax, dword [0x410490]
add esp, 4
mov dword [esi + 0x30], eax
mov edx, esi
inc eax
mov ecx, 0x410488
mov dword [0x410490], eax
call fcn.004083b0
push 0x410510
call dword [sym.imp.pthreadVC3.dll_pthread_mutex_unlock]
add esp, 4
push dword [esi]
push str.Client__d_accepted
push 4
call fcn.004052a0
add esp, 0xc
cmp dword [esi], 0
jl 0x405a4d
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
cmp dword [eax + esi*4], 1
jne 0x4059ad
mov dx, word [edi]
mov ecx, dword [edi - 6]
call fcn.00402ad0
mov ecx, dword [esp + 0x24]
inc esi
add edi, 8
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], edi
cmp esi, ebx
jl 0x4057e3
mov edi, dword [esp + 0x14]
cmp dword [0x4104f8], 0
jne 0x4055fd
mov ebx, dword [esp + 0x18]
jmp 0x405630
push str.Event_processing_interrupted
push 4
call fcn.004052a0
add esp, 8
jmp 0x4055fd
push str.usb_process___failed
push 0
call fcn.004052a0
push dword [esp + 0x1c]
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 0xc
push dword [esp + 0x10]
call esi
mov ecx, dword [esp + 0x50]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004088e2
mov esp, ebp
pop ebp
ret
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.accept___failed___s_
push 1
call fcn.004052a0
add esp, 0xc
push str.client_accept___failed
jmp 0x4059f8