Function at 0x51b060
Capabilities:
Set socket configuration

Disassembly:
push esi
push ebx
sub esp, 0x34
mov ebx, dword [esp + 0x40]
mov dword [esp + 0x24], 1
mov dword [esp + 0x2c], 4
cmp ebx, 0xffffffff
je 0x51b121
lea eax, [esp + 0x2c]
mov dword [esp + 8], 0x1008
mov dword [esp + 4], 0xffff
mov dword [esp], ebx
mov dword [esp + 0x10], eax
lea eax, [esp + 0x28]
mov dword [esp + 0xc], eax
call dword [sym.imp.WS2_32.dll_getsockopt]
sub esp, 0x14
test eax, eax
jne 0x51b0bd
cmp dword [esp + 0x2c], 4
je 0x51b160
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0xdc
mov dword [esp + 8], eax
xor esi, esi
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 4], 0xf
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0xdd
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x86
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
add esp, 0x34
mov eax, esi
pop ebx
pop esi
ret
mov dword [esp + 0x10], 0xd5
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
xor esi, esi
mov dword [esp + 8], 0x87
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
add esp, 0x34
mov eax, esi
pop ebx
pop esi
ret
mov eax, dword [esp + 0x48]
mov dword [esp], ebx
shr eax, 3
and eax, 1
mov dword [esp + 4], eax
call sym._BIO_socket_nbio
test eax, eax
mov esi, eax
je 0x51b119
test byte [esp + 0x48], 4
jne 0x51b2a5
test byte [esp + 0x48], 0x10
jne 0x51b210
mov eax, dword [esp + 0x44]
mov dword [esp], eax
call sym._BIO_ADDR_family
cmp eax, 0x17
je 0x51b340
mov eax, dword [esp + 0x44]
mov dword [esp], eax
call sym._BIO_ADDR_sockaddr_size
mov esi, eax
mov eax, dword [esp + 0x44]
mov dword [esp], eax
call sym._BIO_ADDR_sockaddr
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.WS2_32.dll_bind]
sub esp, 0xc
test eax, eax
mov esi, eax
jne 0x51b3e2
cmp dword [esp + 0x28], 2
je 0x51b203
mov dword [esp + 4], 0x7fffffff
mov dword [esp], ebx
call dword [sym.imp.WS2_32.dll_listen]
sub esp, 8
cmp eax, 0xffffffff
je 0x51b443
mov esi, 1
jmp 0x51b119
lea eax, [esp + 0x24]
mov dword [esp + 0x10], 4
mov dword [esp + 8], 1
mov dword [esp + 4], 6
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
je 0x51b192
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0xf0
mov dword [esp + 8], eax
xor esi, esi
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 4], 0xe
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0xf1
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x8a
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
jmp 0x51b119
lea eax, [esp + 0x24]
mov dword [esp + 0x10], 4
mov dword [esp + 8], 8
mov dword [esp + 4], 0xffff
mov dword [esp], ebx
mov dword [esp + 0xc], eax
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
je 0x51b187
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0xe7
mov dword [esp + 8], eax
xor esi, esi
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 4], 0xe
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0xe8
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x89
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
jmp 0x51b119
mov eax, dword [esp + 0x48]
mov dword [esp + 0x10], 4
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 0x29
mov dword [esp], ebx
sar eax, 1
and eax, 1
mov dword [esp + 0x24], eax
lea eax, [esp + 0x24]
mov dword [esp + 0xc], eax
call dword [sym.imp.WS2_32.dll_setsockopt]
sub esp, 0x14
test eax, eax
je 0x51b1a7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0xff
mov dword [esp + 8], eax
xor esi, esi
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 4], 0xe
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0x100
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x88
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
jmp 0x51b119
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0xa1
mov dword [esp + 8], eax
xor esi, esi
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 4], 6
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0xa2
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x75
mov dword [esp + 4], 0x93
mov dword [esp], 0x20
call sym._ERR_put_error
jmp 0x51b119
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x10], 0x10a
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], eax
mov dword [esp + 4], 7
mov dword [esp], 2
call sym._ERR_put_error
mov dword [esp + 0x10], 0x10b
mov dword [esp + 0xc], str.crypto_bio_b_sock2.c
mov dword [esp + 8], 0x77
mov dword [esp + 4], 0x8b
mov dword [esp], 0x20
call sym._ERR_put_error
jmp 0x51b119