Function at 0x401710
Capabilities:
Query or enumerate registry value
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
mov eax, dword [0x41a6e8]
sub esp, 0x20
mov ecx, dword [0x41a6e0]
push ebx
push ebp
push esi
push edi
push 0x4015e0
push 4
push eax
push ecx
call fcn.0040b207
mov eax, dword [esp + 0x50]
add esp, 0x10
cmp eax, 6
jl 0x4018e1
cmp eax, 0x10
mov dword [esp + 0x10], eax
jb 0x401751
mov dword [esp + 0x10], 0x10
mov eax, dword [0x41a6e8]
xor edx, edx
test eax, eax
jle 0x401782
mov ebp, dword [0x41a6e0]
mov esi, dword [ebp]
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x3c]
add esi, 4
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x40182e
inc edx
add ebp, 4
cmp edx, eax
jl 0x401762
mov ecx, dword [esp + 0x40]
mov ebp, 6
cmp ecx, ebp
jne 0x4018e6
lea edx, [esp + 0x10]
mov byte [esp + 0x1c], 0
push edx
push 0x20019
push 0
push str.SOFTWARETFTPD32DHCP
push reloc.WSOCK32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401808
mov edi, dword [esp + 0x3c]
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [esp + 0x14], 0x14
mov esi, 0x41a6ec
xor eax, eax
mov al, byte [edi]
inc edi
push eax
push str._02X:
push esi
call ebx
add esp, 0xc
add esi, 3
dec ebp
jne 0x4017cf
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x1c]
push eax
push ecx
push 0
push 0
push 0x41a6ec
push edx
mov byte [esi - 1], 0
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x417b84], 1
jle 0x401879
movsx ecx, byte [esp + 0x1c]
push 4
push ecx
call fcn.0040b4be
add esp, 8
jmp 0x401889
cmp edx, eax
jge 0x401782
mov ecx, dword [0x41a6e0]
mov esi, dword [ecx + edx*4]
test esi, esi
je 0x401782
mov edx, dword [esi]
push edx
call sub.WSOCK32.dll_inet_ntoa
push eax
mov eax, dword [esp + 0x38]
push str.Reply_with_previously_allocated_:__s
push 0
push eax
push 0xc
call fcn.00408200
lea ecx, [esi + 0x14]
push ecx
call fcn.0040b12b
add esp, 0x18
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
movsx edx, byte [esp + 0x1c]
mov eax, dword [str.________________________________H]
mov al, byte [eax + edx*2]
and eax, 4
test eax, eax
je 0x4018e1
mov ecx, dword [esp + 0x3c]
push 6
lea edx, [esp + 0x20]
push ecx
push edx
call sub.WSOCK32.dll_inet_addr
push eax
push 0
call fcn.00401660
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4018e1
mov eax, dword [esi]
push eax
call sub.WSOCK32.dll_inet_ntoa
mov ecx, dword [esp + 0x34]
push eax
push str.Reply_with_registry_entry_:__s
push 0
push ecx
push 2
call fcn.00408200
lea edx, [esi + 0x14]
push edx
call fcn.0040b12b
add esp, 0x18
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
mov eax, dword [0x41a6e8]
mov edi, dword [esp + 0x38]
xor ebx, ebx
cmp dword [edi], ebx
je 0x401b2e
mov eax, dword [0x41a720]
push eax
call sub.WSOCK32.dll_ntohl
mov ecx, dword [edi]
mov esi, eax
push ecx
call sub.WSOCK32.dll_ntohl
cmp eax, esi
jb 0x401b29
mov edx, dword [0x41a720]
push edx
call sub.WSOCK32.dll_ntohl
mov ecx, dword [0x41a724]
mov edx, dword [edi]
push edx
lea esi, [eax + ecx]
call sub.WSOCK32.dll_ntohl
cmp eax, esi
jae 0x401b29
mov eax, dword [0x41a6e8]
xor ecx, ecx
cmp eax, ebx
jle 0x40195c
mov ebp, dword [edi]
mov edx, dword [0x41a6e0]
mov esi, dword [edx]
cmp dword [esi], ebp
jne 0x401954
cmp dword [esi + 0x18], ebx
je 0x401986
inc ecx
add edx, 4
cmp ecx, eax
jl 0x401949
xor ecx, ecx
cmp eax, ebx
jle 0x401a32
mov esi, dword [edi]
mov edx, dword [0x41a6e0]
mov ebp, dword [edx]
cmp dword [ebp], esi
je 0x401a1f
inc ecx
add edx, 4
cmp ecx, eax
jl 0x40196e
jmp 0x401a32
cmp ecx, eax
jge 0x40195c
mov edx, dword [0x41a6e0]
mov ebp, dword [edx + ecx*4]
cmp ebp, ebx
je 0x40195c
mov eax, dword [ebp]
push eax
call sub.WSOCK32.dll_inet_ntoa
mov ecx, dword [esp + 0x34]
push eax
push str.Request_for__s_granted
push ebx
push ecx
push 5
call fcn.00408200
mov eax, dword [edi]
lea edx, [ebp + 0x14]
push edx
mov dword [ebp], eax
call fcn.0040b12b
lea edi, [ebp + 4]
xor eax, eax
mov ecx, edi
mov dword [ebp + 0x18], ebx
add esp, 0x18
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x40]
cmp ecx, 0x10
jbe 0x4019e7
mov ecx, 0x10
mov esi, dword [esp + 0x3c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x4015e0
and ecx, 3
push 4
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a6e0]
push eax
push ecx
call fcn.0040b207
add esp, 0x10
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
cmp ecx, eax
jge 0x401a32
mov edx, dword [0x41a6e0]
cmp dword [edx + ecx*4], ebx
jne 0x401b2e
cmp eax, dword [0x41a724]
jge 0x401b2e
push ebx
push 0x1f4
push edi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401b29
push ebx
push 0x1f4
push edi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401b29
mov esi, dword [edi]
push 0x1c
call fcn.0040aff1
mov ecx, dword [0x41a6e0]
mov edx, dword [0x41a6e8]
mov dword [ecx + edx*4], eax
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a6e0]
inc eax
mov ebp, dword [ecx + eax*4 - 4]
mov dword [0x41a6e8], eax
lea edx, [ebp + 0x14]
mov dword [ebp], esi
push edx
call fcn.0040b12b
lea edi, [ebp + 4]
xor eax, eax
mov ecx, edi
mov dword [ebp + 0x18], ebx
add esp, 8
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov eax, dword [esp + 0x40]
mov ecx, 0x10
cmp eax, ecx
ja 0x401ad2
mov ecx, eax
mov esi, dword [esp + 0x3c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x4015e0
and ecx, 3
push 4
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a6e0]
push eax
push ecx
call fcn.0040b207
mov edx, dword [ebp]
add esp, 0x10
push edx
call sub.WSOCK32.dll_inet_ntoa
push eax
mov eax, dword [esp + 0x38]
push str.Reply_with_requested_address_:__s
push ebx
push eax
push 0xc
call fcn.00408200
add esp, 0x14
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a724]
cmp ecx, ebx
jle 0x401ce6
cmp eax, ecx
jge 0x401ce6
mov esi, dword [0x41a720]
cmp eax, ebx
jle 0x401c43
mov ecx, dword [0x41a6e0]
mov edx, dword [ecx]
cmp dword [edx], esi
jne 0x401c43
mov esi, 1
cmp eax, esi
jle 0x401b9d
mov eax, dword [0x41a6e0]
mov ecx, dword [eax + esi*4 - 4]
mov edx, dword [ecx]
push edx
call sub.WSOCK32.dll_ntohl
mov edi, eax
mov eax, dword [0x41a6e0]
inc edi
mov ecx, dword [eax + esi*4]
mov edx, dword [ecx]
push edx
call sub.WSOCK32.dll_ntohl
cmp eax, edi
jne 0x401b9d
mov eax, dword [0x41a6e8]
inc esi
cmp esi, eax
jl 0x401b6b
mov eax, dword [0x41a6e0]
mov ecx, dword [eax + esi*4 - 4]
mov edx, dword [ecx]
push edx
call sub.WSOCK32.dll_ntohl
inc eax
push eax
call sub.WSOCK32.dll_htonl
push 0x1c
mov esi, eax
call fcn.0040aff1
mov ecx, dword [0x41a6e0]
mov edx, dword [0x41a6e8]
mov dword [ecx + edx*4], eax
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a6e0]
inc eax
mov ebp, dword [ecx + eax*4 - 4]
mov dword [0x41a6e8], eax
lea edx, [ebp + 0x14]
mov dword [ebp], esi
push edx
call fcn.0040b12b
lea edi, [ebp + 4]
xor eax, eax
mov ecx, edi
mov dword [ebp + 0x18], 0
add esp, 8
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x40]
cmp ecx, 0x10
jbe 0x401c18
mov ecx, 0x10
mov esi, dword [esp + 0x3c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x4015e0
and ecx, 3
push 4
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x41a6e8]
mov ecx, dword [0x41a6e0]
push eax
push ecx
jmp 0x401cc8
push 0x1c
call fcn.0040aff1
mov edx, dword [0x41a6e0]
mov ecx, dword [0x41a6e8]
mov dword [edx + ecx*4], eax
mov eax, dword [0x41a6e8]
mov edx, dword [0x41a6e0]
inc eax
mov ebp, dword [edx + eax*4 - 4]
mov dword [0x41a6e8], eax
lea eax, [ebp + 0x14]
mov dword [ebp], esi
push eax
call fcn.0040b12b
lea edi, [ebp + 4]
xor ecx, ecx
mov edx, edi
mov dword [ebp + 0x18], ebx
mov eax, dword [esp + 0x48]
add esp, 8
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov dword [edx + 8], ecx
mov dword [edx + 0xc], ecx
mov ecx, 0x10
cmp eax, ecx
ja 0x401ca1
mov ecx, eax
mov esi, dword [esp + 0x3c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x4015e0
and ecx, 3
push 4
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x41a6e8]
mov edx, dword [0x41a6e0]
push ecx
push edx
call fcn.0040b207
mov eax, dword [ebp]
add esp, 0x10
push eax
call sub.WSOCK32.dll_inet_ntoa
push eax
push str.Reply_with_new_:__s
push 0
jmp 0x401ecf
lea edx, [esp + 0x18]
push edx
call fcn.0040b12b
mov eax, dword [0x41a6e8]
add esp, 4
xor edi, edi
cmp eax, ebx
jle 0x401d65
mov eax, dword [0x41a6e0]
mov esi, dword [eax + edi*4]
mov eax, dword [esp + 0x18]
mov ecx, dword [esi + 0x14]
add ecx, 0x78
cmp ecx, eax
jge 0x401d5b
cmp dword [esi + 0x18], ebx
jne 0x401d5b
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401d5b
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401d5b
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
je 0x401d8e
mov eax, dword [0x41a6e8]
inc edi
cmp edi, eax
jl 0x401cfe
xor edi, edi
xor ebp, ebp
cmp eax, ebx
jle 0x401ee8
mov edx, dword [0x41a6e0]
mov esi, dword [edx + edi*4]
mov eax, dword [esi + 0x18]
cmp eax, ebx
je 0x401e45
cmp ebp, ebx
jne 0x401dfa
or ecx, 0xffffffff
jmp 0x401dfd
mov edi, dword [esi]
cmp esi, ebx
mov ebp, esi
jne 0x401dc4
push 0x1c
call fcn.0040aff1
mov edx, dword [0x41a6e0]
mov ecx, dword [0x41a6e8]
add esp, 4
mov dword [edx + ecx*4], eax
mov eax, dword [0x41a6e8]
mov edx, dword [0x41a6e0]
inc eax
mov ebp, dword [edx + eax*4 - 4]
mov dword [0x41a6e8], eax
lea eax, [ebp + 0x14]
mov dword [ebp], edi
push eax
call fcn.0040b12b
lea edi, [ebp + 4]
xor ecx, ecx
mov edx, edi
mov dword [ebp + 0x18], ebx
add esp, 4
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov dword [edx + 8], ecx
mov dword [edx + 0xc], ecx
mov ecx, dword [esp + 0x40]
cmp ecx, 0x10
jbe 0x401e90
jmp 0x401e8b
mov ecx, dword [ebp + 0x18]
cmp eax, ecx
jae 0x401e45
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401e45
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401e45
push ebx
push 0x1f4
push esi
call fcn.00403410
add esp, 0xc
cmp eax, 0xfffffc1b
jne 0x401e45
mov ebp, esi
mov eax, dword [0x41a6e8]
inc edi
cmp edi, eax
jl 0x401d71
cmp ebp, ebx
je 0x401ee8
mov eax, dword [ebp]
mov dword [ebp], eax
lea eax, [ebp + 0x14]
push eax
call fcn.0040b12b
lea edi, [ebp + 4]
xor ecx, ecx
mov edx, edi
mov dword [ebp + 0x18], ebx
add esp, 4
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov dword [edx + 8], ecx
mov dword [edx + 0xc], ecx
mov ecx, dword [esp + 0x40]
cmp ecx, 0x10
jbe 0x401e90
mov ecx, 0x10
mov esi, dword [esp + 0x3c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x4015e0
and ecx, 3
push 4
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x41a6e8]
mov edx, dword [0x41a6e0]
push ecx
push edx
call fcn.0040b207
mov eax, dword [ebp]
add esp, 0x10
push eax
call sub.WSOCK32.dll_inet_ntoa
push eax
push str.Reply_with_reuse_:__s
push ebx
mov ecx, dword [esp + 0x40]
push ecx
push 0xc
call fcn.00408200
add esp, 0x14
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret