Function at 0x524e80
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x148
mov eax, dword [0x5af710]
mov dword [esp + 0x144], eax
mov eax, dword [ebx + 0x16c]
push esi
mov esi, dword [ebx]
push edi
mov dword [esp + 0x1c], eax
xor eax, eax
mov byte [esp + 0x48], 0
mov ecx, 0x3f
lea edi, [esp + 0x49]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esi + 0x70]
test eax, eax
mov dword [esp + 0x10], esi
mov byte [esp + 0xb], 0
mov dword [esp + 0xc], 0
je 0x524f9e
mov edi, dword [sym.imp.WSOCK32.dll_inet_addr]
push eax
call edi
cmp eax, 0xffffffff
je 0x524efd
mov ecx, dword [esi + 0x70]
push 0
push ecx
push eax
call fcn.00521150
add esp, 0xc
mov dword [esp + 0xc], eax
jmp 0x524f96
mov eax, dword [esi + 0x70]
push 0x100
lea edx, [esp + 0x4c]
push edx
push eax
call fcn.00510b50
add esp, 0xc
test eax, eax
je 0x524f34
lea ecx, [esp + 0x48]
push ecx
call edi
push 0
lea edx, [esp + 0x4c]
push edx
push eax
call fcn.00521150
add esp, 0xc
mov dword [esp + 0xc], eax
jmp 0x524f96
mov eax, dword [esi + 0x70]
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x524f40
sub eax, edx
cmp eax, 1
jbe 0x524f9e
lea eax, [esp + 0x18]
push eax
push 0
lea ecx, [esp + 0x50]
push ecx
push ebx
mov dword [esp + 0x28], 0
call fcn.00518090
add esp, 0x10
cmp eax, 1
jne 0x524f7e
lea edx, [esp + 0x18]
push edx
push ebx
call fcn.00521650
add esp, 8
mov eax, dword [esp + 0x18]
test eax, eax
je 0x524f9e
mov ecx, dword [eax]
push eax
push esi
mov dword [esp + 0x14], ecx
call fcn.00518260
add esp, 8
mov eax, dword [esp + 0xc]
test eax, eax
jne 0x524fd1
mov ecx, dword [ebx + 0xa0]
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x2c]
push eax
push ecx
mov dword [esp + 0x20], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jge 0x524fcc
push str.getsockname___failed
push esi
jmp 0x5251af
mov byte [esp + 0xb], 1
xor edi, edi
push edi
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x5251a5
mov eax, dword [ebx + 0xa4]
cmp eax, 0xffffffff
je 0x524ffb
push eax
call dword [sym.imp.WSOCK32.dll_closesocket]
mov al, byte [esp + 0xb]
test al, al
mov dword [ebx + 0xa4], esi
jne 0x52502f
mov edx, dword [esp + 0xc]
mov eax, dword [edx + 0x14]
mov ecx, dword [eax]
mov dword [esp + 0x28], ecx
mov edx, dword [eax + 4]
mov dword [esp + 0x2c], edx
mov ecx, dword [eax + 8]
mov dword [esp + 0x30], ecx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x34], edx
mov dword [esp + 0x2c], edi
push 0x10
lea eax, [esp + 0x2c]
push eax
push esi
mov word [esp + 0x36], di
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jl 0x525199
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x3c]
push edx
push esi
mov dword [esp + 0x20], 0x10
call dword [sym.imp.WSOCK32.dll_getsockname]
test eax, eax
jge 0x525076
mov eax, dword [esp + 0x10]
push str.getsockname___failed
push eax
jmp 0x5251af
mov ecx, dword [esp + 0x3a]
push ecx
call dword [sym.imp.WSOCK32.dll_ntohs]
push 1
push esi
mov edi, eax
call dword [sym.imp.WSOCK32.dll_listen]
test eax, eax
jge 0x52509a
push str.listen_2__failed_on_socket
jmp 0x5251aa
mov al, byte [esp + 0xb]
test al, al
push 0x100
je 0x5250bd
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x34]
push ecx
push 2
call fcn.0051fc60
add esp, 0x10
jmp 0x5250cf
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x4c]
push edx
push eax
call fcn.00517ee0
add esp, 0xc
lea ecx, [esp + 0x26]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x2a]
push eax
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x58]
push str._hu._hu._hu._hu
push edx
call fcn.0053ecb1
add esp, 0x18
cmp eax, 4
jne 0x5251b7
movzx eax, word [esp + 0x26]
movzx ecx, word [esp + 0x24]
movzx edx, word [esp + 0x22]
movzx esi, di
push esi
push eax
movzx eax, word [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x1c]
push edx
push eax
push str.Telling_server_to_connect_to__d._d._d._d:_d_n
push ecx
call fcn.00521c20
movzx eax, word [esp + 0x42]
movzx ecx, word [esp + 0x40]
mov edx, esi
and edx, 0xff
push edx
movzx edx, word [esp + 0x42]
shr esi, 8
push esi
push eax
movzx eax, word [esp + 0x48]
push ecx
push edx
push eax
push str.PORT__d__d__d__d__d__d
push ebx
call fcn.00524630
add esp, 0x3c
test eax, eax
jne 0x5251bc
mov ecx, dword [esp + 0xc]
push ecx
call fcn.00521060
mov edx, dword [esp + 0x20]
mov dword [edx + 0x48], 2
mov eax, dword [ebx + 0x16c]
add esp, 4
mov dword [eax + 0x68], 0x19
xor eax, eax
mov ecx, dword [esp + 0x14c]
call fcn.0053aaae
pop edi
pop esi
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x10]
push str.bind_2__failed_on_socket
push ecx
jmp 0x5251af
push str.socket_2__failed___s_
mov edx, dword [esp + 0x14]
push edx
call fcn.00521d00
add esp, 8
mov eax, 0x1e
mov ecx, dword [esp + 0x14c]
call fcn.0053aaae
pop edi
pop esi
mov esp, ebp
pop ebp
ret