Function at 0x4050b0
Capabilities:
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x2d4
push ebx
push ebp
mov ebp, dword [esp + 0x2e0]
mov eax, dword [ebp + 0x1b8]
push esi
xor esi, esi
cmp eax, esi
push edi
mov dword [ebp], esi
jne 0x4050e1
cmp dword [ebp + 0x1bc], esi
je 0x40511c
cmp eax, esi
jne 0x4050e1
mov eax, 0x4247b8
mov ecx, dword [ebp + 0x1bc]
push ecx
push eax
lea edx, [ebp + 0x190]
push edx
call fcn.00405a60
mov eax, dword [ebp + 0x1b8]
push eax
call fcn.00403c10
mov ecx, dword [ebp + 0x1bc]
push ecx
call fcn.00403c10
add esp, 0x14
mov dword [ebp + 0x1bc], esi
mov dword [ebp + 0x1b8], esi
mov ebx, dword [esp + 0x2ec]
cmp ebx, esi
je 0x40512c
cmp byte [ebx], 0
jne 0x405139
mov ebx, dword [ebp + 0x1a0]
mov dword [esp + 0x2ec], ebx
mov eax, dword [esp + 0x2f0]
cmp eax, esi
je 0x405149
cmp byte [eax], 0
jne 0x405156
mov edx, dword [ebp + 0x1a8]
mov dword [esp + 0x2f0], edx
cmp dword [esp + 0x2f4], esi
jne 0x405184
mov eax, dword [ebp + 0x1ac]
cmp eax, esi
mov dword [esp + 0x2f4], eax
jne 0x405184
push str.MYSQL_PWD
call fcn.0041261c
add esp, 4
mov dword [esp + 0x2f4], eax
mov eax, dword [esp + 0x2f8]
cmp eax, esi
je 0x405194
cmp byte [eax], 0
jne 0x4051a1
mov eax, dword [ebp + 0x1b4]
mov dword [esp + 0x2f8], eax
cmp dword [esp + 0x2fc], esi
jne 0x4051b7
mov ecx, dword [ebp + 0x19c]
mov dword [esp + 0x2fc], ecx
mov eax, dword [esp + 0x300]
cmp eax, esi
jne 0x4051cf
mov eax, dword [ebp + 0x1b0]
mov dword [esp + 0x300], eax
cmp eax, esi
mov byte [ebp + 0x18d], 1
mov dword [ebp + 0x148], 2
jne 0x405218
cmp ebx, esi
jne 0x4051f3
call fcn.00405a30
test al, al
jne 0x405218
jmp 0x405205
mov edi, 0x423040
mov esi, ebx
mov ecx, 2
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x405218
mov al, byte [ebp + 0x199]
test al, al
jne 0x405218
mov al, byte [0x4391a8]
test al, al
jne 0x40528f
mov edx, dword [ebp + 0x190]
lea eax, [esp + 0x300]
push eax
lea ecx, [esp + 0x2f0]
push ecx
push edx
push ebp
call fcn.00404a50
add esp, 0x10
cmp eax, 0xffffffff
jne 0x40531f
mov al, byte [ebp + 0x199]
test al, al
jne 0x4059a5
mov ebx, dword [esp + 0x2ec]
test ebx, ebx
je 0x405270
mov edi, 0x423040
mov esi, ebx
mov ecx, 2
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x4059a5
mov esi, dword [esp + 0x300]
test esi, esi
je 0x40528f
mov edi, str.MySQL
mov ecx, 6
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4059a5
mov eax, dword [esp + 0x2fc]
test eax, eax
mov dword [esp + 0x300], 0
jne 0x4052b2
mov ecx, dword [0x4391c0]
mov dword [esp + 0x2fc], ecx
test ebx, ebx
jne 0x4052c1
mov dword [esp + 0x2ec], str.localhost
mov esi, dword [esp + 0x2ec]
mov edx, dword [str.__.64s_via_TCP_IP]
push esi
push edx
lea eax, [esp + 0x38]
push eax
call fcn.004125ca
add esp, 0xc
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4053c6
mov dword [ebp + 0xe4], 0x7d4
call sub.WSOCK32.dll_WSAGetLastError
mov ecx, dword [ebp + 0xe4]
mov edx, dword [ecx*4 + 0x421138]
push eax
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.004125ca
jmp 0x4059a2
push eax
call fcn.00403d90
mov ecx, dword [esp + 0x2f0]
mov dword [ebp], eax
mov eax, dword [esp + 0x304]
mov edx, dword [str.__.64s_via_named_pipe]
push eax
push ecx
push edx
lea eax, [esp + 0x40]
push eax
call fcn.004125ca
add esp, 0x14
mov eax, dword [ebp]
test eax, eax
je 0x405978
push eax
push ebp
call fcn.00403370
add esp, 8
test eax, eax
jne 0x405978
mov eax, dword [ebp]
push 1
push eax
call fcn.00403ec0
mov eax, dword [ebp + 0x190]
add esp, 8
test eax, eax
mov dword [ebp + 0x140], 0xa
je 0x4054af
mov ecx, dword [ebp]
push eax
push ecx
call fcn.00403fb0
add esp, 8
test al, al
je 0x4054af
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 fcn.00403cb0
add esp, 8
jmp 0x4059a5
push 0
push 1
push ebx
call fcn.00403d00
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 0x405400
mov dword [esp + 0x14], eax
jmp 0x405455
push esi
call sub.WSOCK32.dll_gethostbyname
test eax, eax
jne 0x405433
mov dword [ebp + 0xe4], 0x7d5
call sub.WSOCK32.dll_WSAGetLastError
mov edx, dword [str.Unknown_MySQL_Server_Host___.64s___d_]
push eax
push esi
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.004125ca
add esp, 0x10
jmp 0x4059a5
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]
mov esi, dword [esp + 0x2ec]
mov ecx, dword [esp + 0x2fc]
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.004059e0
add esp, 0x10
test eax, eax
jge 0x40534c
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.004125ca
add esp, 0x10
jmp 0x4059a5
push ebp
call fcn.00404c20
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
je 0x4059a5
mov eax, dword [ebp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
cmp ecx, 0xa
mov dword [ebp + 0x140], ecx
je 0x4054ff
cmp ecx, 9
je 0x4054ff
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.004125ca
add esp, 0x10
jmp 0x4059a5
inc eax
push eax
call fcn.00404450
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 fcn.00403cd0
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 0x405542
xor ecx, ecx
mov cx, word [esi]
mov dword [ebp + 0x13c], ecx
add eax, 0x12
cmp edi, eax
jb 0x40555f
movsx edx, byte [esi + 2]
xor eax, eax
mov dword [ebp + 0x1ec], edx
mov ax, word [esi + 3]
mov dword [ebp + 0x148], eax
mov edi, dword [ebp + 0x1c4]
test edi, edi
je 0x40559d
mov eax, dword [ebp + 0x1c0]
test eax, eax
mov ebx, dword [0x4416a8]
je 0x40557e
mov dword [0x4416a8], eax
mov ecx, dword [ebp + 0x1c4]
push 0x10
push ecx
call fcn.00409500
mov dword [ebp + 0x1e8], eax
add esp, 8
mov dword [0x4416a8], ebx
jmp 0x4055f2
mov eax, dword [ebp + 0x1ec]
test eax, eax
je 0x4055e6
push eax
lea edx, [esp + 0x24]
push 0x4247a8
push edx
lea edi, [esp + 0x2c]
call fcn.004125ca
xor eax, eax
mov al, byte [ebp + 0x1ec]
push 0x10
push eax
call fcn.004090b0
add esp, 0x14
test eax, eax
mov dword [ebp + 0x1e8], eax
jne 0x4055f2
mov ecx, dword [0x4245c0]
mov dword [ebp + 0x1e8], ecx
jmp 0x4055f2
mov edx, dword [0x4245c0]
mov dword [ebp + 0x1e8], edx
mov eax, dword [ebp + 0x1e8]
test eax, eax
jne 0x405673
mov eax, dword [ebp + 0x1c0]
test eax, eax
mov dword [ebp + 0xe4], 0x7e3
je 0x405632
test edi, edi
jne 0x405619
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.004125ca
add esp, 0x10
jmp 0x4059a5
lea edx, [esp + 0xe4]
push edx
call fcn.00408ba0
add esp, 4
test edi, edi
jne 0x40564b
mov edi, str.unknown
mov ecx, dword [ebp + 0xe4]
mov edx, dword [ecx*4 + 0x421138]
lea eax, [esp + 0xe4]
push eax
push edi
push edx
lea eax, [ebp + 0x1c]
push eax
call fcn.004125ca
add esp, 0x10
jmp 0x4059a5
mov ecx, dword [esp + 0x2f0]
test ecx, ecx
mov eax, 0x439128
jne 0x40568a
mov dword [esp + 0x2f0], eax
mov ecx, dword [esp + 0x2f4]
test ecx, ecx
jne 0x40569c
mov dword [esp + 0x2f4], eax
mov eax, dword [esp + 0x300]
test eax, eax
je 0x4056b4
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
jmp 0x4056b9
mov ecx, 1
sub esi, dword [ebp + 0x18]
push 0
push esi
mov esi, dword [esp + 0x2f4]
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 + 0x48]
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.004043e0
add esp, 0x28
test eax, eax
je 0x405959
mov ecx, dword [esp + 0x2f0]
push 0
push ecx
call fcn.00403c70
add esp, 8
test eax, eax
mov dword [ebp + 0x118], eax
je 0x405959
mov edx, dword [esp + 0x2f4]
push 0
push edx
call fcn.00403c70
add esp, 8
test eax, eax
mov dword [ebp + 0x11c], eax
je 0x405959
mov ecx, dword [ebp + 0x128]
lea eax, [esp + 0x30]
push eax
push ecx
call fcn.00403cb0
mov edx, dword [ebx]
push esi
push edx
call fcn.00403cb0
mov eax, dword [esp + 0x310]
add esp, 0x10
test eax, eax
je 0x405786
push eax
mov eax, dword [ebp + 0x120]
push eax
call fcn.00403cb0
add esp, 8
jmp 0x405790
mov dword [ebp + 0x120], 0
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x124]
inc ecx
push ecx
push edx
call fcn.00403cb0
mov ecx, dword [ebp + 0x194]
mov ebx, dword [esp + 0x30c]
mov edi, dword [esp + 0x300]
mov eax, dword [esp + 0x304]
or ecx, 0x2005
add esp, 8
or ebx, ecx
test edi, edi
mov dword [ebp + 0x134], eax
je 0x4057d4
or ebx, 8
test byte [ebp + 0x13c], 0x20
je 0x4057f1
mov al, byte [ebp + 0x198]
test al, al
jne 0x4057ec
test bl, 0x20
je 0x4057f1
or ebx, 0x20
jmp 0x4057f4
and ebx, 0xffffffdf
mov dword [ebp + 0x138], ebx
mov eax, dword [0x423e20]
mov dl, byte [0x423e22]
mov byte [esp + 0x32], al
shr eax, 8
mov byte [esp + 0x33], al
mov eax, dword [esp + 0x2f0]
test eax, eax
mov word [esp + 0x30], bx
mov byte [esp + 0x34], dl
je 0x40583b
cmp byte [eax], 0
je 0x40583b
push 0x20
push eax
lea eax, [esp + 0x3d]
push eax
call fcn.00403cd0
add esp, 0xc
jmp 0x405848
lea ecx, [esp + 0x35]
push ecx
call fcn.00405a00
add esp, 4
cmp dword [ebp + 0x140], 9
mov eax, dword [esp + 0x2f4]
sete dl
lea ecx, [esp + 0x35]
push edx
push eax
lea eax, [ebp + 0x1dc]
push eax
push ecx
call fcn.00404450
add esp, 4
inc eax
push eax
call fcn.004042a0
add esp, 0x10
test edi, edi
mov esi, eax
je 0x4058b0
test byte [ebp + 0x13c], 8
je 0x4058b0
push 0x40
push edi
inc esi
push esi
call fcn.00403cd0
push 0x10
push edi
mov esi, eax
call fcn.00403c70
add esp, 0x14
mov dword [ebp + 0x130], eax
mov dword [esp + 0x2f8], 0
lea edx, [esp + 0x30]
sub esi, edx
push esi
lea eax, [esp + 0x34]
push eax
push ebp
call fcn.00403500
add esp, 0xc
test eax, eax
jne 0x4059a5
push ebp
call fcn.004034d0
add esp, 4
test eax, eax
jne 0x4059a5
push ebp
call fcn.00404c20
add esp, 4
cmp eax, 0xffffffff
je 0x4059a5
test bl, 0x20
je 0x4058fc
mov byte [ebp + 0xf6], 1
mov eax, dword [esp + 0x2f8]
test eax, eax
je 0x405916
push eax
push ebp
call fcn.00405e60
test eax, eax
jne 0x4059a5
mov eax, dword [ebp + 0x1a4]
test eax, eax
je 0x40594a
mov bl, byte [ebp + 0x18d]
push eax
push ebp
mov byte [ebp + 0x18d], 0
call fcn.00405fe0
test eax, eax
jne 0x4059a5
push ebp
call fcn.00406880
push eax
call fcn.00404ee0
mov byte [ebp + 0x18d], bl
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x2d4
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 fcn.00403cb0
add esp, 8
jmp 0x4059a5
mov eax, dword [ebp]
push eax
call fcn.00403dd0
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 fcn.00403cb0
add esp, 0xc
mov bl, byte [ebp + 0x18c]
push ebp
call fcn.00404e60
add esp, 4
push ebp
mov byte [ebp + 0x18c], 0
call fcn.00405eb0
pop edi
pop esi
mov byte [ebp + 0x18c], bl
pop ebp
xor eax, eax
pop ebx
add esp, 0x2d4
ret 0x20