Function at 0x10030070
Capabilities:
Create tcp socket
Create udp socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x13c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 0x3f
lea edi, [ebp - 0x13b]
mov eax, dword [esi + 0x16c]
pop ecx
mov dword [ebp - 0x1c], eax
mov al, byte [0x100bebb0]
mov byte [ebp - 0x13c], al
xor eax, eax
rep stosd dword es:[edi], eax
mov ebx, dword [esi]
and byte [ebp - 1], 0
and dword [ebp - 8], 0
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [ebx + 0x70]
test eax, eax
je 0x1003015c
mov edi, dword [sym.imp.WSOCK32.dll_inet_addr]
push eax
call edi
cmp eax, 0xffffffff
je 0x100300d9
push 0
push dword [ebx + 0x70]
push eax
call fcn.1002ca33
add esp, 0xc
mov dword [ebp - 8], eax
jmp 0x10030156
lea eax, [ebp - 0x13c]
push 0x100
push eax
push dword [ebx + 0x70]
call fcn.10039a5a
add esp, 0xc
test eax, eax
je 0x10030108
lea eax, [ebp - 0x13c]
push eax
call edi
lea ecx, [ebp - 0x13c]
push 0
push ecx
jmp 0x100300cb
push dword [ebx + 0x70]
call sub.MSVCRT.dll_strlen
cmp eax, 1
pop ecx
jbe 0x1003015c
and dword [ebp - 0x14], 0
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x13c]
push 0
push eax
push esi
call fcn.10024d42
add esp, 0x10
cmp eax, 1
jne 0x10030141
lea eax, [ebp - 0x14]
push eax
push esi
call fcn.1002cd1a
pop ecx
pop ecx
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1003015c
mov ecx, dword [eax]
push eax
push ebx
mov dword [ebp - 8], ecx
call fcn.10024e98
pop ecx
pop ecx
cmp dword [ebp - 8], 0
jne 0x10030183
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0x10
push eax
lea eax, [ebp - 0x2c]
push eax
push dword [esi + 0xa0]
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jl 0x10030204
mov byte [ebp - 1], 1
push 0
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x1003030c
mov eax, dword [esi + 0xa4]
add esi, 0xa4
cmp eax, 0xffffffff
je 0x100301b2
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
cmp byte [ebp - 1], 0
mov dword [esi], edi
jne 0x100301d2
mov eax, dword [ebp - 8]
push 0x10
push dword [eax + 0x14]
lea eax, [ebp - 0x2c]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
and dword [ebp - 0x28], 0
and word [ebp - 0x2a], 0
push 0x10
pop esi
lea eax, [ebp - 0x2c]
push esi
push eax
push edi
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jl 0x10030305
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], esi
push eax
lea eax, [ebp - 0x3c]
push eax
push edi
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jge 0x1003020e
push str.getsockname___failed
jmp 0x10030311
push dword [ebp - 0x3a]
call dword [sym.imp.WSOCK32.dll_ntohs]
push 1
push edi
mov esi, eax
call dword [sym.imp.WSOCK32.dll_listen]
test eax, eax
jge 0x10030230
push str.listen_2__failed_on_socket
jmp 0x10030311
cmp byte [ebp - 1], 0
lea eax, [ebp - 0x13c]
push 0x100
push eax
je 0x10030252
lea eax, [ebp - 0x28]
push eax
push 2
call fcn.1002c7b8
add esp, 0x10
jmp 0x1003025d
push dword [ebp - 8]
call fcn.10024be3
add esp, 0xc
lea eax, [ebp - 0xa]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0xe]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x13c]
push str._hu._hu._hu._hu
push eax
call dword [sym.imp.MSVCRT.dll_sscanf]
add esp, 0x18
cmp eax, 4
jne 0x10030319
movzx eax, word [ebp - 0xa]
movzx esi, si
push esi
push eax
movzx eax, word [ebp - 0xc]
push eax
movzx eax, word [ebp - 0xe]
push eax
movzx eax, word [ebp - 0x10]
push eax
push str.Telling_server_to_connect_to__d._d._d._d:_d_n
push ebx
call fcn.1002d9fc
mov eax, esi
and eax, 0xff
push eax
movzx eax, word [ebp - 0xa]
shr esi, 8
push esi
push eax
movzx eax, word [ebp - 0xc]
push eax
movzx eax, word [ebp - 0xe]
push eax
movzx eax, word [ebp - 0x10]
push eax
push str.PORT__d__d__d__d__d__d
push dword [ebp + 8]
call fcn.10031c5e
add esp, 0x3c
test eax, eax
jne 0x1003031c
push dword [ebp - 8]
call fcn.1002ca08
mov eax, dword [ebp - 0x1c]
push 0x19
push dword [ebp + 8]
mov dword [eax + 0x48], 2
call fcn.1002fe6e
add esp, 0xc
xor eax, eax
jmp 0x1003031c
push str.bind_2__failed_on_socket
jmp 0x10030311
push str.socket_2__failed___s_
push ebx
call fcn.1002da56
pop ecx
pop ecx
push 0x1e
pop eax
pop edi
pop esi
pop ebx
leave
ret