Function at 0x100397c0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create raw socket
Create tcp socket
Create udp socket
Resolve dns
Send data
Send data on socket

Disassembly:
sub esp, 0x194
push ebp
mov ebp, dword [esp + 0x19c]
test ebp, ebp
je 0x100397d9
mov eax, dword [ebp + 4]
test eax, eax
jne 0x100397e4
or eax, 0xffffffff
pop ebp
add esp, 0x194
ret
mov ecx, dword [0x102d8a3c]
test ecx, ecx
mov eax, dword [0x102d8a40]
jne 0x100397f6
mov eax, dword [ebp + 8]
test eax, eax
mov dword [esp + 4], eax
jne 0x10039806
mov dword [esp + 4], 0x15
push ebx
xor eax, eax
test ecx, ecx
lea ebx, [ebp + 0x18]
mov edx, ebx
mov dword [edx], eax
mov dword [edx + 4], eax
mov dword [edx + 8], eax
mov dword [edx + 0xc], eax
je 0x10039820
push ecx
jmp 0x10039824
mov eax, dword [ebp + 4]
push eax
call dword [sym.imp.WSOCK32.dll_gethostbyname]
test eax, eax
jne 0x1003984a
push str.gethostbyname_failed
push eax
push 9
call fcn.10017850
add esp, 0xc
pop ebx
or eax, 0xffffffff
pop ebp
add esp, 0x194
ret
cmp word [eax + 0xa], 4
jbe 0x1003986e
push str.gethostbyname_address_mismatch
push 0
push 9
call fcn.10017850
add esp, 0xc
pop ebx
or eax, 0xffffffff
pop ebp
add esp, 0x194
ret
mov word [ebx], 2
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
push esi
mov esi, dword [edx]
mov eax, ecx
push edi
shr ecx, 2
lea edi, [ebp + 0x1c]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.WSOCK32.dll_htons]
push 0
push 1
push 2
mov word [ebp + 0x1a], ax
call dword [sym.imp.WSOCK32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 0x2c], eax
jne 0x100398d1
push str.socket_failed
push 0
push 9
call fcn.10017850
add esp, 0xc
pop edi
pop esi
pop ebx
or eax, 0xffffffff
pop ebp
add esp, 0x194
ret
push 0x10
push ebx
push eax
call dword [sym.imp.WSOCK32.dll_connect]
test eax, eax
jge 0x100398eb
push str.Failed_to_create_a_connection
push 0
jmp 0x10039cc5
mov eax, ebp
call fcn.100394a0
cmp eax, 2
je 0x10039912
mov eax, dword [ebp + 0x2c]
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov dword [ebp + 0x2c], eax
pop ebp
add esp, 0x194
ret
mov eax, dword [0x102d8a3c]
test eax, eax
je 0x10039ac2
mov eax, dword [0x102d8a44]
test eax, eax
mov ebx, dword [sym.imp.MSVCR120.dll__snprintf]
mov edi, dword [sym.imp.WSOCK32.dll_send]
je 0x10039a14
push eax
push str.USER__s_r_n
lea ecx, [esp + 0x1c]
push 0x190
push ecx
call ebx
lea eax, [esp + 0x24]
add esp, 0x10
mov byte [esp + 0x1a3], 0
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10039960
sub eax, edx
push 0
push eax
mov eax, dword [ebp + 0x2c]
lea edx, [esp + 0x1c]
push edx
push eax
call edi
mov esi, eax
test esi, esi
jl 0x10039a7d
mov eax, ebp
call fcn.100394a0
dec eax
je 0x10039a14
dec eax
je 0x100399b9
dec eax
jne 0x10039ccf
mov eax, dword [0x102d8a48]
test eax, eax
je 0x100399c4
push eax
push str.PASS__s_r_n
lea eax, [esp + 0x1c]
push 0x190
push eax
call ebx
add esp, 0x10
jmp 0x100399d8
mov eax, dword [0x102d8a48]
test eax, eax
je 0x10039a14
jmp 0x100399a2
push str.PASS_anonymous__r_n
lea ecx, [esp + 0x18]
push 0x190
push ecx
call ebx
add esp, 0xc
lea eax, [esp + 0x14]
mov byte [esp + 0x1a3], 0
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100399e7
sub eax, edx
push 0
push eax
mov eax, dword [ebp + 0x2c]
lea edx, [esp + 0x1c]
push edx
push eax
call edi
mov esi, eax
test esi, esi
jl 0x10039a7d
mov eax, ebp
call fcn.100394a0
cmp eax, 3
jg 0x10039ccf
mov eax, dword [0x102d8a4c]
test eax, eax
jl 0x10039af7
cmp eax, 1
jle 0x10039a34
cmp eax, 2
je 0x10039b1f
jmp 0x10039af7
mov eax, dword [ebp + 4]
push eax
push str.SITE__s_r_n
lea ecx, [esp + 0x1c]
push 0x190
push ecx
call ebx
lea eax, [esp + 0x24]
add esp, 0x10
mov byte [esp + 0x1a3], 0
lea edx, [eax + 1]
jmp 0x10039a60
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10039a60
sub eax, edx
push 0
push eax
mov eax, dword [ebp + 0x2c]
lea edx, [esp + 0x1c]
push edx
push eax
call edi
mov esi, eax
test esi, esi
jge 0x10039aac
push str.send_failed
push 0
push 9
call fcn.10017850
mov ecx, dword [ebp + 0x2c]
add esp, 0xc
push ecx
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
mov eax, esi
pop esi
pop ebx
mov dword [ebp + 0x2c], 0xffffffff
pop ebp
add esp, 0x194
ret
mov eax, ebp
call fcn.100394a0
cmp eax, 2
jne 0x10039b12
mov dword [0x102d8a4c], 1
mov eax, ebp
call fcn.100395f0
test eax, eax
jl 0x10039ccf
mov eax, ebp
call fcn.100394a0
sub eax, 2
je 0x10039c9f
dec eax
jne 0x10039c7a
mov eax, ebp
call fcn.10039690
test eax, eax
jge 0x10039cac
mov ecx, dword [ebp + 0x2c]
push ecx
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov dword [ebp + 0x2c], eax
pop ebp
add esp, 0x194
ret
cmp dword [0x102d8a4c], 1
je 0x10039ccf
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x10039b40
mov eax, dword [ebp + 4]
push eax
push str.USER_anonymous__s_r_n
lea ecx, [esp + 0x1c]
push 0x190
push ecx
call ebx
add esp, 0x10
jmp 0x10039b59
mov edx, dword [ebp + 4]
push edx
push eax
push str.USER__s__s_r_n
lea eax, [esp + 0x20]
push 0x190
push eax
call ebx
add esp, 0x14
lea eax, [esp + 0x14]
mov byte [esp + 0x1a3], 0
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10039b68
push 0
sub eax, edx
mov edx, dword [ebp + 0x2c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push edx
call edi
mov esi, eax
test esi, esi
jge 0x10039bb4
push str.send_failed
push 0
push 9
call fcn.10017850
mov eax, dword [ebp + 0x2c]
add esp, 0xc
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
mov eax, esi
pop esi
pop ebx
mov dword [ebp + 0x2c], 0xffffffff
pop ebp
add esp, 0x194
ret
mov eax, ebp
call fcn.100394a0
cmp eax, 1
je 0x10039c95
cmp eax, 2
je 0x10039c95
mov eax, dword [ebp + 0x14]
test eax, eax
jne 0x10039bea
push str.PASS_anonymous__r_n
lea ecx, [esp + 0x18]
push 0x190
push ecx
call ebx
add esp, 0xc
jmp 0x10039bff
push eax
push str.PASS__s_r_n
lea edx, [esp + 0x1c]
push 0x190
push edx
call ebx
add esp, 0x10
lea eax, [esp + 0x14]
mov byte [esp + 0x1a3], 0
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10039c10
mov ecx, dword [ebp + 0x2c]
push 0
sub eax, edx
push eax
lea eax, [esp + 0x1c]
push eax
push ecx
call edi
mov esi, eax
test esi, esi
jge 0x10039c5c
push str.send_failed
push 0
push 9
call fcn.10017850
mov edx, dword [ebp + 0x2c]
add esp, 0xc
push edx
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
mov eax, esi
pop esi
pop ebx
mov dword [ebp + 0x2c], 0xffffffff
pop ebp
add esp, 0x194
ret
mov eax, ebp
call fcn.100394a0
cmp eax, 1
je 0x10039c95
cmp eax, 2
je 0x10039c95
cmp dword [0x102d8a4c], 2
jne 0x10039af7
mov eax, dword [ebp + 0x2c]
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov dword [ebp + 0x2c], eax
pop ebp
add esp, 0x194
ret
mov dword [0x102d8a4c], 2
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x194
ret
mov eax, ebp
call fcn.100394a0
sub eax, 2
je 0x10039c9f
dec eax
jne 0x10039ccf
push str.FTP_server_asking_for_ACCNT_on_anonymous_n
push 0x7d2
push 9
call fcn.10017850
add esp, 0xc
mov edx, dword [ebp + 0x2c]
push edx
call dword [sym.imp.WSOCK32.dll_closesocket]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov dword [ebp + 0x2c], eax
pop ebp
add esp, 0x194
ret