Function at 0x10005050
Capabilities:
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
sub esp, 0xae8
push ebx
push ebp
mov ebp, dword [esp + 0xaf4]
mov eax, dword [ebp + 0x1b8]
push esi
xor esi, esi
cmp eax, esi
push edi
mov dword [ebp], esi
jne 0x10005081
cmp dword [ebp + 0x1bc], esi
je 0x100050bc
cmp eax, esi
jne 0x10005081
mov eax, 0x10031790
mov ecx, dword [ebp + 0x1bc]
push ecx
push eax
lea edx, [ebp + 0x190]
push edx
call fcn.10005a20
mov eax, dword [ebp + 0x1b8]
push eax
call sym.LIBMYSQL.dll_my_no_flags_free
mov ecx, dword [ebp + 0x1bc]
push ecx
call sym.LIBMYSQL.dll_my_no_flags_free
add esp, 0x14
mov dword [ebp + 0x1bc], esi
mov dword [ebp + 0x1b8], esi
mov ebx, dword [esp + 0xb00]
cmp ebx, esi
je 0x100050cc
cmp byte [ebx], 0
jne 0x100050d9
mov ebx, dword [ebp + 0x1a0]
mov dword [esp + 0xb00], ebx
mov eax, dword [esp + 0xb04]
cmp eax, esi
je 0x100050e9
cmp byte [eax], 0
jne 0x100050f6
mov edx, dword [ebp + 0x1a8]
mov dword [esp + 0xb04], edx
cmp dword [esp + 0xb08], esi
jne 0x10005124
mov eax, dword [ebp + 0x1ac]
cmp eax, esi
mov dword [esp + 0xb08], eax
jne 0x10005124
push str.MYSQL_PWD
call fcn.1001115f
add esp, 4
mov dword [esp + 0xb08], eax
mov eax, dword [esp + 0xb0c]
cmp eax, esi
je 0x10005134
cmp byte [eax], 0
jne 0x10005141
mov eax, dword [ebp + 0x1b4]
mov dword [esp + 0xb0c], eax
cmp dword [esp + 0xb10], esi
jne 0x10005157
mov ecx, dword [ebp + 0x19c]
mov dword [esp + 0xb10], ecx
mov eax, dword [esp + 0xb14]
cmp eax, esi
jne 0x1000516f
mov eax, dword [ebp + 0x1b0]
mov dword [esp + 0xb14], eax
cmp eax, esi
mov byte [ebp + 0x18d], 1
mov dword [ebp + 0x148], 2
jne 0x100051b8
cmp ebx, esi
jne 0x10005193
call fcn.100059f0
test al, al
jne 0x100051b8
jmp 0x100051a5
mov edi, 0x10030c98
mov esi, ebx
mov ecx, 2
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x100051b8
mov al, byte [ebp + 0x199]
test al, al
jne 0x100051b8
mov al, byte [0x10036b10]
test al, al
jne 0x1000522f
mov edx, dword [ebp + 0x190]
lea eax, [esp + 0xb14]
push eax
lea ecx, [esp + 0xb04]
push ecx
push edx
push ebp
call fcn.10004990
add esp, 0x10
cmp eax, 0xffffffff
jne 0x100052bf
mov al, byte [ebp + 0x199]
test al, al
jne 0x10005964
mov ebx, dword [esp + 0xb00]
test ebx, ebx
je 0x10005210
mov edi, 0x10030c98
mov esi, ebx
mov ecx, 2
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x10005964
mov esi, dword [esp + 0xb14]
test esi, esi
je 0x1000522f
mov edi, str.MySQL
mov ecx, 6
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x10005964
mov eax, dword [esp + 0xb10]
test eax, eax
mov dword [esp + 0xb14], 0
jne 0x10005252
mov ecx, dword [0x10036af0]
mov dword [esp + 0xb10], ecx
test ebx, ebx
jne 0x10005261
mov dword [esp + 0xb00], str.localhost
mov esi, dword [esp + 0xb00]
mov edx, dword [str.__.64s_via_TCP_IP]
push esi
push edx
lea eax, [esp + 0x3c]
push eax
call fcn.10010c0e
add esp, 0xc
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x10005366
mov dword [ebp + 0xe4], 0x7d4
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [ebp + 0xe4]
mov edx, dword [ecx*4 + 0x1002ed70]
push eax
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.10010c0e
jmp 0x10005961
push eax
call fcn.1000a720
mov ecx, dword [esp + 0xb04]
mov dword [ebp], eax
mov eax, dword [esp + 0xb18]
mov edx, dword [str.__.64s_via_named_pipe]
push eax
push ecx
push edx
lea eax, [esp + 0x44]
push eax
call fcn.10010c0e
add esp, 0x14
mov eax, dword [ebp]
test eax, eax
je 0x10005937
push eax
push ebp
call fcn.10009740
add esp, 8
test eax, eax
jne 0x10005937
mov eax, dword [ebp]
push 1
push eax
call fcn.1000a850
mov eax, dword [ebp + 0x190]
add esp, 8
test eax, eax
mov dword [ebp + 0x140], 0xa
je 0x10005474
mov ecx, dword [ebp]
push eax
push ecx
call fcn.1000a940
add esp, 8
test al, al
je 0x10005474
mov dword [ebp + 0xe4], 0x7dd
mov edx, dword [str.Lost_connection_to_MySQL_server_during_query]
push edx
lea eax, [ebp + 0x1c]
push eax
call sym.LIBMYSQL.dll_strmov
add esp, 8
jmp 0x10005964
push 0
push 1
push ebx
call fcn.1000a690
xor ecx, ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
add esp, 0xc
mov dword [esp + 0x18], ecx
push esi
mov dword [ebp], eax
mov dword [esp + 0x20], ecx
mov word [esp + 0x14], 2
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
je 0x100053a0
mov dword [esp + 0x14], eax
jmp 0x1000541a
lea edx, [esp + 0x20]
push edx
push 0x800
lea eax, [esp + 0x300]
push eax
lea ecx, [esp + 0xf4]
push ecx
push esi
call fcn.10008a90
add esp, 0x14
test eax, eax
jne 0x100053f3
mov edx, dword [esp + 0x20]
push edx
mov dword [ebp + 0xe4], 0x7d5
mov eax, dword [str.Unknown_MySQL_Server_Host___.64s___d_]
push esi
push eax
lea ecx, [ebp + 0x1c]
push ecx
call fcn.10010c0e
add esp, 0x10
call fcn.10008ac0
jmp 0x10005964
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov esi, dword [edx]
mov eax, ecx
shr ecx, 2
lea edi, [esp + 0x14]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.10008ac0
mov esi, dword [esp + 0xb00]
mov ecx, dword [esp + 0xb10]
push ecx
call sub.WSOCK32.dll_htons
mov edx, dword [ebp + 0x190]
push edx
mov word [esp + 0x16], ax
push 0x10
lea eax, [esp + 0x18]
push eax
push ebx
call fcn.100059a0
add esp, 0x10
test eax, eax
jge 0x100052ec
mov dword [ebp + 0xe4], 0x7d3
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [str.Cant_connect_to_MySQL_server_on___.64s___d_]
push eax
push esi
push ecx
lea edx, [ebp + 0x1c]
push edx
call fcn.10010c0e
add esp, 0x10
jmp 0x10005964
push ebp
call fcn.10004b60
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
je 0x10005964
mov eax, dword [ebp + 0x18]
movzx ecx, byte [eax]
cmp ecx, 0xa
mov dword [ebp + 0x140], ecx
je 0x100054c3
cmp ecx, 9
je 0x100054c3
push 0xa
mov dword [ebp + 0xe4], 0x7d7
mov edx, dword [str.Protocol_mismatch._Server_Version___d_Client_Version___d]
push ecx
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.10010c0e
add esp, 0x10
jmp 0x10005964
inc eax
push eax
call fcn.1000a3c0
mov esi, eax
mov ecx, dword [esi + 1]
push 8
add esi, 5
lea eax, [ebp + 0x1dc]
push esi
push eax
mov dword [ebp + 0x14c], ecx
call sym.LIBMYSQL.dll_strmake
mov edx, dword [ebp + 0x18]
add esi, 9
mov eax, esi
sub eax, edx
lea edx, [eax + 1]
add esp, 0x10
cmp edi, edx
jb 0x10005504
movzx ecx, word [esi]
mov dword [ebp + 0x13c], ecx
add eax, 0x12
cmp edi, eax
jb 0x1000551f
movsx edx, byte [esi + 2]
mov dword [ebp + 0x1ec], edx
movzx eax, word [esi + 3]
mov dword [ebp + 0x148], eax
mov edi, dword [ebp + 0x1c4]
test edi, edi
je 0x1000555d
mov eax, dword [ebp + 0x1c0]
test eax, eax
mov ebx, dword [0x10036ab0]
je 0x1000553e
mov dword [0x10036ab0], eax
mov ecx, dword [ebp + 0x1c4]
push 0x10
push ecx
call fcn.10001bd0
mov dword [ebp + 0x1e8], eax
add esp, 8
mov dword [0x10036ab0], ebx
jmp 0x100055b1
mov eax, dword [ebp + 0x1ec]
test eax, eax
je 0x100055a5
push eax
lea edx, [esp + 0x28]
push 0x10031780
push edx
lea edi, [esp + 0x30]
call fcn.10010c0e
movzx eax, byte [ebp + 0x1ec]
push 0x10
push eax
call fcn.10001780
add esp, 0x14
test eax, eax
mov dword [ebp + 0x1e8], eax
jne 0x100055b1
mov ecx, dword [0x10030ae0]
mov dword [ebp + 0x1e8], ecx
jmp 0x100055b1
mov edx, dword [0x10030ae0]
mov dword [ebp + 0x1e8], edx
mov eax, dword [ebp + 0x1e8]
test eax, eax
jne 0x10005632
mov eax, dword [ebp + 0x1c0]
test eax, eax
mov dword [ebp + 0xe4], 0x7e3
je 0x100055f1
test edi, edi
jne 0x100055d8
mov edi, str.unknown
push eax
mov eax, dword [str.Cant_initialize_character_set___.64s__path:___.64s_]
push edi
push eax
lea ecx, [ebp + 0x1c]
push ecx
call fcn.10010c0e
add esp, 0x10
jmp 0x10005964
lea edx, [esp + 0xf8]
push edx
call fcn.10001260
add esp, 4
test edi, edi
jne 0x1000560a
mov edi, str.unknown
mov ecx, dword [ebp + 0xe4]
mov edx, dword [ecx*4 + 0x1002ed70]
lea eax, [esp + 0xf8]
push eax
push edi
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.10010c0e
add esp, 0x10
jmp 0x10005964
mov ecx, dword [esp + 0xb04]
test ecx, ecx
mov eax, 0x10036ad8
jne 0x10005649
mov dword [esp + 0xb04], eax
mov ecx, dword [esp + 0xb08]
test ecx, ecx
jne 0x1000565b
mov dword [esp + 0xb08], eax
mov eax, dword [esp + 0xb14]
test eax, eax
je 0x10005673
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
jmp 0x10005678
mov ecx, 1
sub esi, dword [ebp + 0x18]
push 0
push esi
mov esi, dword [esp + 0xb08]
lea eax, [ebp + 0x124]
push eax
push ecx
or ecx, 0xffffffff
lea edi, [ebp + 0x120]
push edi
xor eax, eax
mov edi, esi
repne scasb al, byte es:[edi]
not ecx
push ecx
or ecx, 0xffffffff
lea edi, [esp + 0x4c]
repne scasb al, byte es:[edi]
lea ebx, [ebp + 0x114]
push ebx
not ecx
push ecx
lea edx, [ebp + 0x128]
push edx
push eax
call fcn.10008300
add esp, 0x28
test eax, eax
je 0x10005918
mov ecx, dword [esp + 0xb04]
push 0
push ecx
call sym.LIBMYSQL.dll_my_strdup
add esp, 8
test eax, eax
mov dword [ebp + 0x118], eax
je 0x10005918
mov edx, dword [esp + 0xb08]
push 0
push edx
call sym.LIBMYSQL.dll_my_strdup
add esp, 8
test eax, eax
mov dword [ebp + 0x11c], eax
je 0x10005918
mov ecx, dword [ebp + 0x128]
lea eax, [esp + 0x34]
push eax
push ecx
call sym.LIBMYSQL.dll_strmov
mov edx, dword [ebx]
push esi
push edx
call sym.LIBMYSQL.dll_strmov
mov eax, dword [esp + 0xb24]
add esp, 0x10
test eax, eax
je 0x10005745
push eax
mov eax, dword [ebp + 0x120]
push eax
call sym.LIBMYSQL.dll_strmov
add esp, 8
jmp 0x1000574f
mov dword [ebp + 0x120], 0
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x124]
inc ecx
push ecx
push edx
call sym.LIBMYSQL.dll_strmov
mov ecx, dword [ebp + 0x194]
mov ebx, dword [esp + 0xb20]
mov edi, dword [esp + 0xb14]
mov eax, dword [esp + 0xb18]
or ecx, 0x2005
add esp, 8
or ebx, ecx
test edi, edi
mov dword [ebp + 0x134], eax
je 0x10005793
or ebx, 8
test byte [ebp + 0x13c], 0x20
je 0x100057b0
mov al, byte [ebp + 0x198]
test al, al
jne 0x100057ab
test bl, 0x20
je 0x100057b0
or ebx, 0x20
jmp 0x100057b3
and ebx, 0xffffffdf
mov dword [ebp + 0x138], ebx
mov eax, dword [sym.LIBMYSQL.dll_max_allowed_packet]
mov dl, byte [0x10031956]
mov byte [esp + 0x36], al
shr eax, 8
mov byte [esp + 0x37], al
mov eax, dword [esp + 0xb04]
test eax, eax
mov word [esp + 0x34], bx
mov byte [esp + 0x38], dl
je 0x100057fa
cmp byte [eax], 0
je 0x100057fa
push 0x20
push eax
lea eax, [esp + 0x41]
push eax
call sym.LIBMYSQL.dll_strmake
add esp, 0xc
jmp 0x10005807
lea ecx, [esp + 0x39]
push ecx
call fcn.100059c0
add esp, 4
cmp dword [ebp + 0x140], 9
mov eax, dword [esp + 0xb08]
sete dl
lea ecx, [esp + 0x39]
push edx
push eax
lea eax, [ebp + 0x1dc]
push eax
push ecx
call fcn.1000a3c0
add esp, 4
inc eax
push eax
call fcn.1000a050
add esp, 0x10
test edi, edi
mov esi, eax
je 0x1000586f
test byte [ebp + 0x13c], 8
je 0x1000586f
push 0x40
push edi
inc esi
push esi
call sym.LIBMYSQL.dll_strmake
push 0x10
push edi
mov esi, eax
call sym.LIBMYSQL.dll_my_strdup
add esp, 0x14
mov dword [ebp + 0x130], eax
mov dword [esp + 0xb0c], 0
lea edx, [esp + 0x34]
sub esi, edx
push esi
lea eax, [esp + 0x38]
push eax
push ebp
call fcn.100098d0
add esp, 0xc
test eax, eax
jne 0x10005964
push ebp
call fcn.100098a0
add esp, 4
test eax, eax
jne 0x10005964
push ebp
call fcn.10004b60
add esp, 4
cmp eax, 0xffffffff
je 0x10005964
test bl, 0x20
je 0x100058bb
mov byte [ebp + 0xf6], 1
mov eax, dword [esp + 0xb0c]
test eax, eax
je 0x100058d5
push eax
push ebp
call sym.LIBMYSQL.dll_mysql_select_db
test eax, eax
jne 0x10005964
mov eax, dword [ebp + 0x1a4]
test eax, eax
je 0x10005909
mov bl, byte [ebp + 0x18d]
push eax
push ebp
mov byte [ebp + 0x18d], 0
call sym.LIBMYSQL.dll_mysql_query
test eax, eax
jne 0x10005964
push ebp
call sym.LIBMYSQL.dll_mysql_use_result
push eax
call sym.LIBMYSQL.dll_mysql_free_result
mov byte [ebp + 0x18d], bl
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0xae8
ret 0x20
mov dword [ebp + 0xe4], 0x7d8
mov ecx, dword [str.MySQL_client_run_out_of_memory]
push ecx
lea edx, [ebp + 0x1c]
push edx
call sym.LIBMYSQL.dll_strmov
add esp, 8
jmp 0x10005964
mov eax, dword [ebp]
push eax
call fcn.1000a760
mov dword [ebp], 0
mov dword [ebp + 0xe4], 0x7d8
mov ecx, dword [str.MySQL_client_run_out_of_memory]
push ecx
lea edx, [ebp + 0x1c]
push edx
call sym.LIBMYSQL.dll_strmov
add esp, 0xc
mov bl, byte [ebp + 0x18c]
push ebp
call fcn.10004db0
add esp, 4
push ebp
mov byte [ebp + 0x18c], 0
call sym.LIBMYSQL.dll_mysql_close
pop edi
pop esi
mov byte [ebp + 0x18c], bl
pop ebp
xor eax, eax
pop ebx
add esp, 0xae8
ret 0x20