Function at 0x507fb0
Capabilities:
Create tcp socket
Create thread
Create udp socket
Initialize winsock library
Reference 114dns dns server
Set socket configuration

Disassembly:
sub esp, 0x9c
mov eax, dword [0x5d7050]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
push ebp
push esi
push edi
push 0x3f
lea eax, [esp + 0x25]
mov esi, ecx
push 0
push eax
mov dword [esp + 0x20], esi
mov ebx, edx
mov byte [esp + 0x2c], 0
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0x3f
lea ecx, [esp + 0x65]
push 0
push ecx
mov byte [esp + 0x6c], 0
call sub.MSVCR80.dll_memset
add esp, 0xc
push ebx
lea edx, [esp + 0x64]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.00506e70
add esp, 0xc
lea eax, [esp + 0x20]
call fcn.005074d0
test al, al
je 0x508b0f
lea eax, [esp + 0x60]
call fcn.005074d0
test al, al
je 0x508b0f
mov eax, esi
call fcn.005074d0
test al, al
je 0x508b0f
push 0x5eeb50
push 0x101
call sub.WS2_32.dll_WSAStartup
cmp word [0x5eeb50], 0x101
mov ebp, dword [sym.imp.MSVCR80.dll_sprintf]
je 0x508090
call sub.WS2_32.dll_WSAGetLastError
push eax
push str.WSAStartup_Error:___d_
push 0x5e7878
call ebp
add esp, 0xc
cmp byte [0x617f22], 1
jb 0x508090
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
mov ecx, dword [0x5effb4]
test ecx, ecx
mov dword [0x5effa8], 0x8ca0
jne 0x5080af
mov ecx, 0xe10
mov dword [0x5effb4], ecx
mov edx, dword [0x5effb8]
test edx, edx
je 0x5080bd
cmp edx, ecx
jbe 0x5080ec
mov eax, 0xcccccccd
mul ecx
shr edx, 2
cmp edx, 0x258
mov dword [0x5effb8], edx
jbe 0x5080dc
mov edx, 0x258
jmp 0x5080e6
cmp edx, 0x3c
jae 0x5080ec
mov edx, 0x3c
mov dword [0x5effb8], edx
cmp dword [0x5effbc], 0
jne 0x5080ff
mov dword [0x5effbc], 0xd2f00
cmp dword [0x5effc0], 0
jne 0x50810e
mov dword [0x5effc0], edx
call fcn.004fddd0
mov ecx, 0x5e96f0
call fcn.00508b60
push 0x5eece0
push 0x5ef3e2
push str._s._s
push 0x5ef462
call ebp
mov edx, dword [0x5efff8]
add esp, 0x10
test edx, edx
jne 0x508153
cmp dword [0x5efffc], edx
je 0x5081e0
push str.Section__ZONE_REPLICATION__Missing_Primary_Server
jmp 0x5081d1
mov edi, dword [0x5efffc]
test edi, edi
jne 0x508164
push str.Section__ZONE_REPLICATION__Missing_Secondary_Server
jmp 0x5081d1
xor al, al
jmp 0x508170
movzx ecx, al
mov ecx, dword [ecx*4 + 0x5ee568]
test ecx, ecx
je 0x50818c
cmp ecx, edx
je 0x508454
add al, 1
cmp al, 0x7d
jb 0x508170
xor al, al
mov edi, edi
movzx ecx, al
mov ecx, dword [ecx*4 + 0x5ee568]
test ecx, ecx
je 0x5081ac
cmp ecx, edx
je 0x5084ad
add al, 1
cmp al, 0x7d
jb 0x508190
xor al, al
mov edi, edi
movzx edx, al
mov ecx, dword [edx*4 + 0x5ee568]
test ecx, ecx
je 0x5081cc
cmp ecx, edi
je 0x5084cb
add al, 1
cmp al, 0x7d
jb 0x5081b0
push str.Section__ZONE_REPLICATION__No_Server_IP_not_found_on_this_Machine
push 0x5e7878
call ebp
add esp, 8
call fcn.00509860
cmp byte [0x617f25], 2
je 0x508243
mov eax, 0x5ef462
mov edi, edi
mov cl, byte [eax]
mov byte [eax - 0x380], cl
add eax, 1
test cl, cl
jne 0x5081f0
mov eax, 0x5ef462
mov cl, byte [eax]
mov byte [eax - 0x480], cl
add eax, 1
test cl, cl
jne 0x508204
mov eax, 0x5ef3e2
jmp 0x508220
mov cl, byte [eax]
mov byte [eax - 0x100], cl
add eax, 1
test cl, cl
jne 0x508220
mov eax, 0x5ef3e2
mov cl, byte [eax]
mov byte [eax - 0x200], cl
add eax, 1
test cl, cl
jne 0x508234
push ebx
mov ecx, esi
call fcn.005065e0
xor ebx, ebx
add esp, 4
cmp byte [0x617f20], bl
jbe 0x508379
mov edi, 0x600504
cmp byte [0x617f22], 1
jb 0x508379
push str.DHCP_Range:
push 0x5e7878
call ebp
mov esi, eax
mov eax, dword [edi - 4]
add esp, 8
push eax
add esi, 0x5e7878
call sub.WS2_32.dll_htonl
mov ecx, eax
shr ecx, 0x18
push ecx
mov edx, eax
shr edx, 0x10
movzx ecx, dl
push ecx
mov edx, eax
shr edx, 8
movzx ecx, dl
push ecx
movzx edx, al
push edx
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push 0x58df2c
push esi
call ebp
add esi, eax
mov eax, dword [edi]
add esp, 0x24
push eax
call sub.WS2_32.dll_htonl
mov ecx, eax
shr ecx, 0x18
push ecx
mov edx, eax
shr edx, 0x10
movzx ecx, dl
push ecx
mov edx, eax
shr edx, 8
movzx ecx, dl
push ecx
movzx edx, al
push edx
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push 0x5a871c
push esi
call ebp
add esi, eax
mov eax, dword [edi + 4]
add esp, 0x24
mov ecx, eax
shr ecx, 0x18
push ecx
mov edx, eax
shr edx, 0x10
movzx ecx, dl
push ecx
mov edx, eax
shr edx, 8
movzx ecx, dl
push ecx
movzx edx, al
push edx
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push 0x5a8720
push esi
call ebp
add esp, 0x24
cmp byte [0x617f22], 2
jb 0x508360
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
movzx eax, byte [0x617f20]
mov esi, dword [esp + 0x14]
add ebx, 1
add edi, 0x1c
cmp ebx, eax
jl 0x508261
cmp byte [0x617f25], 0
je 0x508396
mov eax, dword [0x5efff8]
call fcn.00505bb0
mov eax, dword [0x5efffc]
call fcn.00505bb0
mov eax, dword [0x5eff78]
cmp dword [0x5eeb44], eax
jae 0x5083a8
mov dword [0x5eeb44], eax
push esi
mov byte [esp + 0x17], 0
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [0x5ee180], eax
mov eax, dword [0x619880]
test eax, eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x1c], 4
jne 0x5083dc
call fcn.00418600
mov dword [0x619880], eax
cmp eax, 6
jne 0x5083e9
mov dword [esp + 0x1c], SysReAllocString
mov dword [esp + 0x18], 0x5ee180
mov esi, 0x5e96f6
mov ecx, dword [esp + 0x18]
cmp dword [ecx], 0
je 0x5085bf
push 0x11
push 2
push 2
xor ebx, ebx
call sub.WS2_32.dll_socket
cmp eax, 0xffffffff
mov dword [esi - 6], eax
jne 0x5084e9
push str.Failed_to_Create_Socket
push 0x5e7878
mov byte [esp + 0x1b], 1
call ebp
add esp, 8
cmp byte [0x617f22], 1
jb 0x5085a9
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
jmp 0x5085a9
movzx eax, al
lea eax, [eax*4 + 0x5ee568]
test eax, eax
je 0x50818c
xor al, al
jmp 0x508470
movzx ecx, al
mov ecx, dword [ecx*4 + 0x5ee568]
test ecx, ecx
je 0x50818c
cmp ecx, edi
je 0x508491
add al, 1
cmp al, 0x7d
jb 0x508470
jmp 0x50818c
movzx eax, al
lea eax, [eax*4 + 0x5ee568]
test eax, eax
je 0x50818c
push str.Section__ZONE_REPLICATION__Primary__Secondary_should_be_Different_Boxes
jmp 0x5081d1
movzx eax, al
lea eax, [eax*4 + 0x5ee568]
test eax, eax
je 0x5081ac
mov byte [0x617f25], 1
jmp 0x5081e9
movzx eax, al
lea eax, [eax*4 + 0x5ee568]
test eax, eax
je 0x5081cc
mov byte [0x617f25], 2
jmp 0x508243
mov edx, dword [esp + 0x18]
lea edi, [esi - 2]
mov word [edi], 2
mov eax, dword [edx]
push 0x43
mov dword [esi + 2], eax
call sub.WS2_32.dll_htons
mov ecx, dword [esi - 6]
push 4
mov word [esi], ax
lea eax, [esi + 0x1a]
push eax
push 0x20
push 0xffff
push ecx
mov dword [eax], 1
mov dword [esi + 0x1e], 4
call sub.WS2_32.dll_setsockopt
mov edx, dword [esi - 6]
push 0x10
push edi
push edx
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
jne 0x508571
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2741
jne 0x508620
cmp ebx, dword [esp + 0x1c]
jae 0x508620
push 0x3e8
add ebx, 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esi - 6]
push 0x10
push edi
push eax
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
je 0x508538
mov eax, dword [esi - 6]
mov byte [esi + 0x32], 1
mov byte [esi + 0x33], 1
cmp dword [0x5eeb44], eax
jae 0x508589
mov dword [0x5eeb44], eax
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
add dword [esp + 0x14], 1
mov dword [esi + 0xe], ecx
mov edx, dword [eax + 0x1f4]
mov dword [esi + 0x16], edx
mov word [esi + 0x12], 0x43
add esi, 0x3c
mov eax, dword [esp + 0x18]
add eax, 4
cmp eax, 0x5ee374
mov dword [esp + 0x18], eax
jl 0x5083f6
mov ebx, 0x5ee180
mov edi, 0x5eb43c
cmp dword [ebx], 0
je 0x50873b
push 0x11
push 2
push 2
call sub.WS2_32.dll_socket
cmp eax, 0xffffffff
mov dword [edi], eax
jne 0x50866c
push str.Failed_to_Create_Socket
push 0x5e7878
mov byte [esp + 0x1b], 1
call ebp
add esp, 8
cmp byte [0x617f22], 1
jb 0x50872c
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
jmp 0x50872c
mov ecx, dword [esp + 0x14]
mov esi, ecx
shl esi, 4
sub esi, ecx
add esi, esi
mov ecx, dword [esi + esi + 0x5e96f8]
add esi, esi
push ecx
push eax
push str.Failed_to_bind_Socket___d___ip:0x_08x
push 0x5e7878
call ebp
push 0x5e7878
push 0x6180b8
call fcn.00435820
mov edx, dword [esi + 0x5e96f0]
add esp, 0x18
push edx
call sub.WS2_32.dll_closesocket
mov eax, 0x10
jmp 0x508b43
lea esi, [edi + 4]
mov word [esi], 2
mov eax, dword [ebx]
push 0x35
mov dword [esi + 4], eax
call sub.WS2_32.dll_htons
mov edx, dword [edi]
push 4
lea ecx, [esp + 0x20]
push ecx
push 4
push 0xffff
push edx
mov word [esi + 2], ax
mov dword [esp + 0x30], 1
call sub.WS2_32.dll_setsockopt
mov eax, dword [edi]
push 0x10
push esi
push eax
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
jne 0x508707
call sub.WS2_32.dll_WSAGetLastError
mov ecx, dword [edi]
push ecx
mov byte [esp + 0x17], 1
call sub.WS2_32.dll_closesocket
mov eax, dword [ebx]
mov edx, eax
shr edx, 0x18
push edx
mov ecx, eax
shr ecx, 0x10
movzx edx, cl
push edx
mov ecx, eax
shr ecx, 8
movzx edx, cl
push edx
movzx eax, al
push eax
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push str.Warning:__s_UDP_Port_53_already_in_use
push 0x5e7878
call ebp
add esp, 0x24
jmp 0x5085fc
mov eax, dword [edi]
mov byte [esi + 0x26], 1
mov byte [esi + 0x27], 1
cmp dword [0x5eeb44], eax
jae 0x50871e
mov dword [0x5eeb44], eax
mov ecx, dword [ebx]
mov dword [edi + 0x24], ecx
mov word [edi + 0x28], 0x35
add edi, 0x2c
add ebx, 4
cmp ebx, 0x5ee374
jl 0x5085c9
push 0x11
push 2
push 2
call sub.WS2_32.dll_socket
cmp eax, 0xffffffff
mov dword [0x5ec9b8], eax
jne 0x508781
push str.Failed_to_Create_Socket
push 0x5e7878
mov byte [esp + 0x1b], 1
call ebp
add esp, 8
cmp byte [0x617f22], 1
jb 0x5087db
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
jmp 0x5087db
mov ecx, dword [0x5ee950]
test ecx, ecx
je 0x508790
cmp ecx, 0xffffffff
jne 0x5087a8
push str.114.114.114.114
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, eax
mov eax, dword [0x5ec9b8]
mov dword [0x5ee950], ecx
cmp dword [0x5eeb44], eax
mov word [0x5ec9bc], 2
mov dword [0x5ec9dc], ecx
mov word [0x5ec9e0], 0x35
mov byte [0x5ec9e2], 1
mov byte [0x5ec9e3], 1
jae 0x5087db
mov dword [0x5eeb44], eax
mov edi, 0x5ee180
mov esi, 0x5ec9e8
mov ebx, 0x35
lea ebx, [ebx]
cmp dword [edi], 0
je 0x508906
push 6
push 1
push 2
call sub.WS2_32.dll_socket
cmp eax, 0xffffffff
mov dword [esi - 4], eax
jne 0x50881b
mov byte [esp + 0x13], 1
push str.Failed_to_Create_Socket
jmp 0x5088ac
mov word [esi], 2
mov edx, dword [edi]
push ebx
mov dword [esi + 4], edx
call sub.WS2_32.dll_htons
push 0x10
mov word [esi + 2], ax
mov eax, dword [esi - 4]
push esi
push eax
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
mov ecx, dword [esi - 4]
jne 0x50888e
push ecx
mov byte [esp + 0x17], 1
call sub.WS2_32.dll_closesocket
mov eax, dword [edi]
mov edx, eax
shr edx, 0x18
push edx
mov ecx, eax
shr ecx, 0x10
movzx edx, cl
push edx
mov ecx, eax
shr ecx, 8
movzx edx, cl
push edx
movzx eax, al
push eax
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push str.Warning:__s_TCP_Port_53_already_in_use
push 0x5e7878
call ebp
add esp, 0x24
jmp 0x5088b6
push SysReAllocString
push ecx
call sub.WS2_32.dll_listen
cmp eax, 0xffffffff
jne 0x5088d3
mov edx, dword [esi - 4]
push edx
call sub.WS2_32.dll_closesocket
push str.TCP_Port_53_Error_on_Listen
push 0x5e7878
call ebp
add esp, 8
cmp byte [0x617f22], 1
jb 0x5088f7
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
jmp 0x5088f7
mov eax, dword [edi]
mov dword [esi + 0x20], eax
mov eax, dword [esi - 4]
mov word [esi + 0x24], bx
mov byte [esi + 0x26], 1
mov byte [esi + 0x27], 1
cmp dword [0x5eeb44], eax
jae 0x5088f4
mov dword [0x5eeb44], eax
add esi, 0x2c
add edi, 4
cmp edi, 0x5ee374
jl 0x5087f0
mov esi, 1
add dword [0x5eeb44], esi
xor bl, bl
movzx ecx, bl
mov eax, dword [ecx*4 + 0x5edf8c]
test eax, eax
je 0x50892e
call fcn.00505bb0
add bl, 1
cmp bl, 0x7d
jb 0x508913
xor bl, bl
movzx edx, bl
mov eax, dword [edx*4 + 0x5ee950]
test eax, eax
je 0x50894b
call fcn.00505bb0
add bl, 1
cmp bl, 0x7d
jb 0x508930
cmp byte [esp + 0x13], 0
je 0x50895a
add dword [0x617f08], esi
jmp 0x508964
mov dword [0x617f08], 0
cmp byte [0x5e9729], 0
je 0x508983
cmp byte [0x5eb467], 0
je 0x508983
cmp byte [0x5eca0f], 0
jne 0x508a0a
push str.No_Static_Interface_ready__Waiting...
push 0x5e7878
call ebp
push 0x5e7878
push 0x5a89a0
call dword [sym.imp.MSVCR80.dll_printf]
add esp, 0x10
cmp byte [0x617f23], 1
jae 0x5089b8
cmp byte [0x617f22], 1
jb 0x508b0b
mov eax, 0x5e7878
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5089c0
sub eax, edx
add eax, 1
push eax
push esi
call dword [sym.imp.MSVCR80.dll_calloc]
add esp, 8
test eax, eax
je 0x5089f2
mov ecx, 0x5e7878
mov esi, eax
sub esi, ecx
mov dl, byte [ecx]
mov byte [ecx + esi], dl
add ecx, 1
test dl, dl
jne 0x5089e6
push eax
push 0
push 0x509670
call dword [sym.imp.MSVCR80.dll__beginthread]
add esp, 0xc
xor eax, eax
jmp 0x508b43
mov edi, dword [sym.imp.MSVCR80.dll_printf]
mov ebx, 0x5ee568
mov eax, dword [ebx]
test eax, eax
je 0x508b04
xor dl, dl
movzx ecx, dl
mov esi, ecx
shl esi, 4
sub esi, ecx
cmp dword [esi*4 + 0x5e9704], eax
je 0x508a4c
imul ecx, ecx, 0x2c
cmp dword [ecx + 0x5eb460], eax
je 0x508a4c
add dl, 1
cmp dl, 0x7d
jb 0x508a21
jmp 0x508af5
mov ecx, eax
shr ecx, 0x18
push ecx
mov edx, eax
shr edx, 0x10
movzx ecx, dl
push ecx
mov edx, eax
shr edx, 8
movzx ecx, dl
push ecx
movzx edx, al
push edx
push str._u._u._u._u
push 0x5e7b78
call ebp
push 0x5e7b78
push str.Listening_On:__s
push 0x5e7878
call ebp
add esp, 0x24
push 0x5e7878
push 0x5a89a0
call edi
add esp, 8
cmp byte [0x617f23], 1
jae 0x508aa9
cmp byte [0x617f22], 1
jb 0x508af5
mov eax, 0x5e7878
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x508ab1
sub eax, edx
add eax, 1
push eax
push 1
call dword [sym.imp.MSVCR80.dll_calloc]
add esp, 8
test eax, eax
je 0x508ae4
mov ecx, 0x5e7878
mov esi, eax
sub esi, ecx
mov dl, byte [ecx]
mov byte [esi + ecx], dl
add ecx, 1
test dl, dl
jne 0x508ad8
push eax
push 0
push 0x509670
call dword [sym.imp.MSVCR80.dll__beginthread]
add esp, 0xc
add ebx, 4
cmp ebx, 0x5ee75c
jl 0x508a15
mov byte [0x5eeb49], 1
xor eax, eax
jmp 0x508b43
push esi
push str.IpV4_is_Error__s
push 0x5e7878
call dword [sym.imp.MSVCR80.dll_sprintf]
add esp, 0xc
cmp byte [0x617f22], 1
jb 0x508b3e
push 0x5e7878
push 0x6180b8
call fcn.00435820
add esp, 8
mov eax, 0x20
mov ecx, dword [esp + 0xa4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00569ed6
add esp, 0x9c
ret