Function at 0x5053a0
Capabilities:
Reference 114dns dns server

Disassembly:
sub esp, 0x114
mov eax, dword [0x5d7050]
xor eax, esp
mov dword [esp + 0x110], eax
push ebx
push ebp
push esi
mov esi, ecx
cmp byte [esi + 0xc8c], 0
push edi
je 0x5053e4
mov al, byte [esi + 0xc8d]
test al, al
je 0x5053e4
lea edi, [esp + 0x14]
mov byte [esp + 0x14], 0x35
mov byte [esp + 0x15], 1
mov byte [esp + 0x16], al
call fcn.005058d0
cmp dword [esi + 0x56c], 0
je 0x505890
mov al, byte [esi + 0xc8d]
cmp al, 4
je 0x505890
cmp al, 6
je 0x505890
mov eax, 0x5ef3e2
lea edx, [esi + 0x30]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x505411
mov eax, dword [esi + 0x56c]
test byte [eax + 0x10], 1
je 0x505490
mov ebp, dword [eax + 0x1c]
test ebp, ebp
je 0x505490
mov bl, byte [ebp]
mov al, byte [ebp + 1]
add ebp, 1
test al, al
je 0x505490
cmp al, 0xff
je 0x505490
add ebp, 1
mov byte [esp + 0x14], al
mov al, byte [ebp]
add ebp, 1
test bl, bl
mov byte [esp + 0x15], al
je 0x505464
movzx ecx, byte [ebp]
cmp byte [ecx + esi + 0xa8c], 0
je 0x505483
movzx edx, al
push edx
lea eax, [esp + 0x1a]
push ebp
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
lea edi, [esp + 0x14]
call fcn.005058d0
mov al, byte [esp + 0x15]
movzx ecx, al
mov al, byte [ebp + ecx]
add ebp, ecx
test al, al
jne 0x50543d
cmp byte [esi + 0xc8c], 0
je 0x505890
cmp byte [esi + 0xc8d], 0
je 0x505890
mov edx, dword [esi + 0x56c]
mov al, byte [edx + 0x14]
test al, al
jl 0x50552e
movsx eax, al
lea ecx, [eax*8]
sub ecx, eax
mov ebp, dword [ecx*4 + 0x60050c]
test ebp, ebp
je 0x50552e
mov bl, byte [ebp]
mov al, byte [ebp + 1]
add ebp, 1
test al, al
je 0x50552e
cmp al, 0xff
je 0x50552e
add ebp, 1
mov byte [esp + 0x14], al
mov al, byte [ebp]
add ebp, 1
test bl, bl
mov byte [esp + 0x15], al
je 0x505502
movzx edx, byte [ebp]
cmp byte [edx + esi + 0xa8c], 0
je 0x505521
movzx eax, al
push eax
lea ecx, [esp + 0x1a]
push ebp
push ecx
call sub.MSVCR80.dll_memcpy
add esp, 0xc
lea edi, [esp + 0x14]
call fcn.005058d0
mov al, byte [esp + 0x15]
movzx edx, al
mov al, byte [ebp + edx]
add ebp, edx
test al, al
jne 0x5054db
mov ebp, dword [0x617dfc]
test ebp, ebp
je 0x505598
mov bl, byte [ebp]
mov al, byte [ebp + 1]
add ebp, 1
test al, al
je 0x505598
cmp al, 0xff
je 0x505598
add ebp, 1
mov byte [esp + 0x14], al
mov al, byte [ebp]
add ebp, 1
test bl, bl
mov byte [esp + 0x15], al
je 0x50556c
movzx ecx, byte [ebp]
cmp byte [ecx + esi + 0xa8c], 0
je 0x50558b
movzx edx, al
push edx
lea eax, [esp + 0x1a]
push ebp
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
lea edi, [esp + 0x14]
call fcn.005058d0
mov al, byte [esp + 0x15]
movzx ecx, al
mov al, byte [ebp + ecx]
add ebp, ecx
test al, al
jne 0x505545
movzx eax, byte [esi + 0xc8e]
mov edx, eax
shl edx, 4
sub edx, eax
mov eax, dword [edx*4 + 0x5e9704]
lea edi, [esp + 0x14]
mov byte [esp + 0x14], 0x36
mov byte [esp + 0x15], 4
mov dword [esp + 0x16], eax
call fcn.005058d0
mov eax, 0x5eece0
mov byte [esp + 0x14], 0xf
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5055d1
sub eax, edx
add al, 1
movzx ecx, al
push ecx
lea edx, [esp + 0x1a]
push 0x5eece0
push edx
mov byte [esp + 0x21], al
call sub.MSVCR80.dll_memcpy
add esp, 0xc
lea edi, [esp + 0x14]
call fcn.005058d0
cmp byte [esi + 0xbbf], 0
jne 0x505628
mov eax, dword [0x5effa8]
push eax
mov byte [esp + 0x18], 0x33
mov byte [esp + 0x19], 4
call sub.WS2_32.dll_htonl
mov dword [esp + 0x16], eax
call fcn.005058d0
cmp byte [esi + 0xb8d], 0
jne 0x505674
mov ecx, dword [esi + 0x56c]
mov al, byte [ecx + 0x14]
test al, al
mov byte [esp + 0x14], 1
mov byte [esp + 0x15], 4
jl 0x505661
movsx eax, al
lea edx, [eax*8]
sub edx, eax
mov eax, dword [edx*4 + 0x600508]
mov dword [esp + 0x16], eax
jmp 0x50566b
mov ecx, dword [0x5effa4]
mov dword [esp + 0x16], ecx
lea edi, [esp + 0x14]
call fcn.005058d0
cmp byte [esi + 0x404], 0
lea edi, [esi + 0x404]
jne 0x505693
mov al, byte [esi + 6]
lea edx, [esi + 0x20]
push edx
push edi
call fcn.005075a0
add esp, 8
mov eax, dword [esi + 0x56c]
mov eax, dword [eax + 0x20]
xor ebx, ebx
cmp eax, ebx
je 0x5056c4
push edi
push eax
call dword [sym.imp.MSVCR80.dll__stricmp]
add esp, 8
test eax, eax
je 0x5056d2
mov edx, dword [esi + 0x56c]
mov eax, dword [edx + 0x20]
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
call fcn.00507e00
mov ecx, dword [esi + 0x56c]
mov dword [ecx + 0x20], eax
cmp byte [esi + 0xb92], 0
jne 0x505868
mov edx, dword [0x617f14]
mov eax, dword [0x61972c]
cmp edx, eax
mov ecx, dword [0x619728]
mov byte [esp + 0x14], 6
jl 0x505757
jg 0x505705
mov edx, dword [0x617f10]
cmp edx, ecx
jbe 0x505757
mov edx, dword [0x617f1c]
cmp edx, eax
jl 0x50578a
jg 0x50571a
mov eax, dword [0x617f18]
cmp eax, ecx
jbe 0x50578a
cmp byte [0x617f25], 1
mov ecx, dword [0x5efff8]
mov byte [esp + 0x15], 8
lea edi, [esp + 0x14]
jne 0x505745
mov edx, dword [0x5efffc]
mov dword [esp + 0x16], ecx
mov dword [esp + 0x1a], edx
jmp 0x505863
mov eax, dword [0x5efffc]
mov dword [esp + 0x16], eax
mov dword [esp + 0x1a], ecx
jmp 0x505863
mov edx, dword [0x617f1c]
cmp edx, eax
jl 0x50578a
jg 0x50576c
mov eax, dword [0x617f18]
cmp eax, ecx
jbe 0x50578a
mov ecx, dword [0x5efffc]
mov edx, dword [0x5efff8]
mov byte [esp + 0x15], 8
mov dword [esp + 0x16], ecx
mov dword [esp + 0x1a], edx
jmp 0x50585f
mov ecx, dword [0x618028]
lea eax, [esp + 0x10]
push eax
xor ebp, ebp
push ebp
push ecx
mov dword [esp + 0x1c], ebx
call sub.iphlpapi.dll_GetPerAdapterInfo
cmp eax, 0x6f
jne 0x505832
mov edx, dword [esp + 0x10]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [0x618028]
mov edi, eax
lea eax, [esp + 0x10]
push eax
push edi
push ecx
call sub.iphlpapi.dll_GetPerAdapterInfo
test eax, eax
jne 0x50581a
lea edx, [edi + 0x10]
push edx
lea ebp, [eax + 1]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ebx, eax
movzx eax, byte [esi + 0xc8e]
mov ecx, eax
shl ecx, 4
sub ecx, eax
cmp byte [0x617f22], 2
mov edx, dword [ecx*4 + 0x5e9704]
mov dword [esp + 0x16], edx
jb 0x50581a
push str.Set_Provide_DNS_OK___
push 0x6180b8
call fcn.00435820
add esp, 8
push edi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test ebp, ebp
jne 0x5058b2
movzx eax, byte [esi + 0xc8e]
mov ecx, eax
shl ecx, 4
sub ecx, eax
mov edx, dword [ecx*4 + 0x5e9704]
mov dword [esp + 0x16], edx
push str.114.114.114.114
mov byte [esp + 0x19], 8
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x1a], eax
lea edi, [esp + 0x14]
call fcn.005058d0
cmp byte [esi + 0x774], 0x76
lea edi, [esi + 0x774]
jne 0x50587c
call fcn.005058d0
cmp byte [esi + 0x570], 0x52
lea edi, [esi + 0x570]
jne 0x505890
call fcn.005058d0
mov eax, dword [esi + 0x568]
mov ecx, dword [esp + 0x120]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov byte [eax], 0xff
call fcn.00569ed6
add esp, 0x114
ret
test ebx, ebx
je 0x50584b
mov byte [esp + 0x15], 8
mov dword [esp + 0x1a], ebx
jmp 0x50585f