Function at 0x10003870
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x68
mov eax, dword [0x1013dd8c]
xor eax, esp
mov dword [esp + 0x64], eax
mov eax, dword [ebp + 0x18]
push esi
push edi
mov edi, ecx
mov dword [esp + 0xc], edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], 1
mov dword [esp + 0x10], 0
test edi, 0x40
jne 0x10003abf
test edi, 0x200
jne 0x10003abf
test edi, 2
jne 0x10003abf
test edi, 0x4000
jne 0x10003abf
test edi, 0x8000
je 0x100038e1
or edi, 0x2400
cmp dword [ebp + 0x10], 0
je 0x10003abf
mov ecx, edi
and ecx, 0x240
cmp ecx, 0x240
je 0x10003abf
mov eax, edi
and eax, 0x204
cmp eax, 0x204
je 0x10003abf
mov eax, edi
and al, 0x4c
cmp al, 0x40
je 0x10003abf
test ecx, ecx
setne cl
bt edi, 0x10
setb al
test al, cl
jne 0x10003abf
push 0x118
push 1
call fcn.100adf4a
mov esi, eax
add esp, 8
mov dword [esp + 0x24], esi
test esi, esi
je 0x10003abf
mov eax, edi
mov dword [esi + 0xb0], 0xffffffff
shr eax, 5
and eax, 1
mov dword [esi + 0xb4], 0
mov dword [esi + 0xe4], eax
mov eax, dword [esp + 0xc]
mov word [esi + 0xe0], ax
mov eax, dword [ebp + 8]
mov dword [esi + 0x30], eax
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x34], eax
mov eax, dword [ebp + 0x10]
mov dword [esi], eax
mov eax, dword [ebp + 0x14]
mov dword [esi + 0xdc], edi
mov dword [esi + 4], eax
mov dword [esi + 0xc8], 0
mov dword [esi + 0xcc], 0x7fe
mov dword [esi + 0x6c], 0x8000
mov dword [esi + 0x70], 0x400
mov dword [esi + 0x50], 0x10003400
mov dword [esi + 0xd0], 0
mov dword [esi + 0xd4], 0
mov dword [esi + 0xbc], 0xffffffff
mov dword [esi + 0xb8], 0xffffffff
push 2
mov dword [esi + 0x110], getpeername
mov dword [esi + 0x58], 0x100013a0
call fcn.100acc73
mov dword [esi + 0x5c], eax
add esp, 4
mov eax, dword [esi + 0xdc]
and al, 0xc
cmp al, 4
jne 0x10003a28
push str.Warning:_MHD_USE_THREAD_PER_CONNECTION_must_be_used_only_with_MHD_USE_INTERNAL_POLLING_THREAD._Flag_MHD_USE_INTERNAL_POLLING_THREAD_was_added._Consider_setting_MHD_USE_INTERNAL_POLLING_THREAD_explicitly._n
push esi
call fcn.100085c0
add esp, 8
or dword [esi + 0xdc], 8
mov eax, dword [esi + 0xdc]
test al, 8
jne 0x10003a39
and eax, 0xfffffbff
jmp 0x10003a3e
or eax, 0x400
push dword [esp + 0x1c]
mov dword [esi + 0xdc], eax
lea edx, [esp + 0x14]
mov ecx, esi
mov dword [esi + 0x108], 0
mov dword [esi + 0xe8], 0
mov dword [esi + 0x10c], 4
call fcn.10003460
add esp, 4
cmp eax, 1
jne 0x10003ab6
test dword [esi + 0xdc], 0x400
je 0x10003ad2
cmp dword [esi + 0x78], 0
jne 0x10003ad2
lea ecx, [esi + 0xb8]
call fcn.100080a0
test eax, eax
jne 0x10003ad2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.Failed_to_create_inter_thread_communication_channel:__s_n
push esi
call fcn.100085c0
add esp, 0xc
push esi
call fcn.100a9867
add esp, 4
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.10065961
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x10c]
test ecx, ecx
je 0x10003b4c
imul edi, ecx, 0x98
mov eax, 0xaf286bcb
mul edi
mov eax, edi
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 7
cmp eax, ecx
je 0x10003b1f
push str.Specified_value_for_NC_SIZE_too_large_n
push esi
call fcn.100085c0
push esi
call fcn.100a9867
add esp, 0xc
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.10065961
mov esp, ebp
pop ebp
ret
push edi
call fcn.100a986c
add esp, 4
mov dword [esi + 0xec], eax
test eax, eax
jne 0x10003b4c
call fcn.100adf37
push dword [eax]
call fcn.100b82eb
add esp, 4
push eax
push str.Failed_to_allocate_memory_for_nonce_nc_map:__s_n
jmp 0x10003aad
lea eax, [esi + 0xf0]
push 0x10
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x10003b7a
push str.MHD_failed_to_initialize_nonce_nc_mutex_n
push esi
call fcn.100085c0
push dword [esi + 0xec]
call fcn.100a9867
jmp 0x10003ab3
mov ecx, dword [esi + 0xdc]
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
test ecx, 8
jne 0x10003ba4
cmp dword [esi + 0x78], 0
jbe 0x10003ba4
push str.MHD_thread_pooling_only_works_with_MHD_USE_INTERNAL_POLLING_THREAD_n
push esi
call fcn.100085c0
add esp, 8
jmp 0x10003bf8
mov edi, dword [esi + 0xb0]
mov dword [esp + 0x1c], edi
cmp edi, 0xffffffff
jne 0x10003e4b
test ecx, 0x100
jne 0x10003e46
and ecx, 0x10
call fcn.10008340
mov edi, eax
mov dword [esp + 0x1c], eax
cmp edi, 0xffffffff
jne 0x10003c47
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.Failed_to_create_socket_for_listening:__s_n
push esi
call fcn.100085c0
add esp, 0xc
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push dword [esi + 0xec]
call fcn.100a9867
add esp, 4
lea eax, [esi + 0xf0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, dword [esi + 0xb8]
cmp eax, 0xffffffff
je 0x10003ab6
push eax
call edi
push dword [esi + 0xbc]
test eax, eax
jne 0x10004254
call edi
neg eax
sbb eax, eax
add eax, 1
je 0x10004256
jmp 0x10003ab6
mov eax, dword [esi + 0xb4]
mov ecx, dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
je 0x10003cac
push 4
lea eax, [esp + 0x24]
push eax
jle 0x10003c86
push 4
push 0xffff
push edi
call ecx
test eax, eax
jns 0x10003cac
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push 0x1013fcc4
jmp 0x10003be9
push 0xfffffffffffffffb
push 0xffff
push edi
call ecx
test eax, eax
jns 0x10003cac
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push 0x1013fd9c
jmp 0x10003be9
mov eax, dword [esi + 0xdc]
mov ecx, 0x10
and eax, 0x10
mov edx, 0x1c
cmovne ecx, edx
cmp dword [esp + 0x10], 0
mov dword [esp + 0x14], ecx
jne 0x10003d28
xorps xmm0, xmm0
push dword [esp + 0xc]
test eax, eax
je 0x10003d06
mov eax, 0x17
movaps xmmword [esp + 0x44], xmm0
movq qword [esp + 0x54], xmm0
mov dword [esp + 0x5c], 0
mov word [esp + 0x44], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x42], ax
lea eax, [esp + 0x40]
jmp 0x10003d24
mov eax, 2
movaps xmmword [esp + 0x34], xmm0
mov word [esp + 0x34], ax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x32], ax
lea eax, [esp + 0x30]
mov dword [esp + 0x10], eax
mov dword [esi + 0xb0], edi
mov ecx, dword [esi + 0xdc]
test ecx, 0x10
je 0x10003d83
xor eax, eax
and ecx, 0x810
cmp ecx, 0x810
push 4
setne al
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
push 0x1b
push 0x29
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x10003d83
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.setsockopt_failed:__s_n
push esi
call fcn.100085c0
add esp, 0xc
push dword [esp + 0x14]
push dword [esp + 0x14]
push edi
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x10003dea
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
mov eax, dword [esp + 0x10]
movzx eax, ax
push eax
push str.Failed_to_bind_to_port__u:__s_n
push esi
call fcn.100085c0
add esp, 0x10
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x10140074
push 0x16d3
push 0x101408a8
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
push dword [esi + 0x110]
push edi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x10003e46
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.Failed_to_listen_for_connections:__s_n
push esi
call fcn.100085c0
add esp, 0xc
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x10140924
push 0x16f1
push 0x10140970
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
cmp edi, 0xffffffff
je 0x10003eb3
mov ecx, edi
call fcn.10008320
test eax, eax
jne 0x10003eb3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.Failed_to_set_nonblocking_mode_on_listening_socket:__s_n
push esi
call fcn.100085c0
add esp, 0xc
test dword [esi + 0xdc], 0x200
jne 0x10003e84
cmp dword [esi + 0x78], 0
jbe 0x10003eb3
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x101409c4
push 0x1708
push 0x10140a38
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
lea eax, [esi + 0x80]
push 0x10
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x10003f0c
push 0x1013fdb4
push esi
call fcn.100085c0
add esp, 8
cmp edi, 0xffffffff
je 0x10003bf2
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x10140b54
push 0x1734
push 0x10140b88
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
lea eax, [esi + 0x98]
push 0x10
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x10003f73
push str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
push esi
call fcn.100085c0
add esp, 8
lea eax, [esi + 0x98]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call eax
cmp edi, 0xffffffff
je 0x10003bf2
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x10140c4c
push 0x173f
push 0x10140c98
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
mov eax, dword [esi + 0xdc]
test al, 8
je 0x1000402e
cmp dword [esi + 0x78], 0
jne 0x1000402e
test eax, 0x100
jne 0x1000402e
push esi
test al, 4
lea ecx, [esi + 0x7c]
push 0x100033b0
push dword [esi + 0x74]
mov eax, str.MHD_single
mov edx, str.MHD_listen
cmove edx, eax
call fcn.10008990
add esp, 0xc
test eax, eax
jne 0x1000402e
call fcn.100adf37
push dword [eax]
call fcn.100b82eb
add esp, 4
push eax
push str.Failed_to_create_listen_thread:__s_n
push esi
call fcn.100085c0
add esp, 0xc
lea eax, [esi + 0x98]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call eax
lea eax, [esi + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
cmp edi, 0xffffffff
je 0x10003bf2
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10003bf8
push 0x10140db4
push 0x1765
push 0x10140e00
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x10004165
test dword [esi + 0xdc], 0x100
jne 0x10004165
mov eax, dword [esi + 0xcc]
xor edx, edx
div ecx
imul ecx, ecx, 0x118
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], eax
push ecx
call fcn.100a986c
add esp, 4
mov dword [esi + 0x64], eax
test eax, eax
je 0x100041eb
xor eax, eax
mov dword [esp + 0xc], eax
cmp dword [esi + 0x78], eax
jbe 0x10004165
xor ecx, ecx
mov dword [esp + 0x18], ecx
nop word [eax + eax]
mov edx, dword [esi + 0x64]
add edx, ecx
mov ecx, 0x46
mov edi, edx
mov dword [esp + 0x14], edx
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x24]
mov dword [edx + 0x60], esi
mov dword [edx + 0x78], 0
mov dword [edx + 0x64], 0
test dword [esi + 0xdc], 0x400
je 0x100040e0
lea ecx, [edx + 0xb8]
call fcn.100080a0
test eax, eax
je 0x10004178
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0xc]
jmp 0x100040f4
mov dword [edx + 0xbc], 0xffffffff
mov dword [edx + 0xb8], 0xffffffff
mov ecx, dword [esp + 0x28]
mov dword [edx + 0xcc], ecx
cmp eax, dword [esp + 0x2c]
jae 0x1000410d
lea eax, [ecx + 1]
mov dword [edx + 0xcc], eax
push 0x10
lea eax, [edx + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
je 0x100041c3
mov edi, dword [esp + 0x14]
mov edx, str.MHD_worker
push edi
push 0x100033b0
push dword [esi + 0x74]
lea ecx, [edi + 0x7c]
call fcn.10008990
add esp, 0xc
test eax, eax
je 0x10004196
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x18]
inc eax
add ecx, 0x118
mov dword [esp + 0xc], eax
mov dword [esp + 0x18], ecx
cmp eax, dword [esi + 0x78]
jb 0x10004090
mov ecx, dword [esp + 0x6c]
mov eax, esi
pop edi
pop esi
xor ecx, esp
call fcn.10065961
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.10007c10
push eax
push str.Failed_to_create_worker_inter_thread_communication_channel:__s_n
push esi
call fcn.100085c0
add esp, 0xc
jmp 0x100041d1
call fcn.100adf37
push dword [eax]
call fcn.100b82eb
add esp, 4
push eax
push str.Failed_to_create_pool_thread:__s_n
push esi
call fcn.100085c0
add esp, 0xc
lea eax, [edi + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x100041d1
push str.MHD_failed_to_initialize_cleanup_connection_mutex_n
push esi
call fcn.100085c0
add esp, 8
mov eax, dword [esp + 0xc]
test eax, eax
je 0x100041e7
push esi
mov dword [esi + 0x78], eax
call fcn.10004500
jmp 0x10003abc
mov edi, dword [esp + 0x1c]
cmp edi, 0xffffffff
je 0x1000421b
push edi
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
call edi
test eax, eax
je 0x10004221
push 0x10140fcc
push 0x17db
push 0x10140ff0
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
lea eax, [esi + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea eax, [esi + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov eax, dword [esi + 0x64]
test eax, eax
je 0x10003bf8
push eax
call fcn.100a9867
add esp, 4
jmp 0x10003bf8
call edi
push 0x1014082c
push 0x180a
push 0x101411b0
push dword [0x10149f20]
call dword [0x10149f24]
add esp, 0x10
int3