Function at 0x402000
Capabilities:
Get hostname
Resolve dns

Disassembly:
sub esp, 0x10c
mov eax, dword [0x411278]
push ebx
push ebp
mov ebp, dword [esp + 0x118]
xor edx, edx
push esi
mov ecx, dword [ebp + 0xec]
push edi
cmp ecx, eax
mov dword [esp + 0x10], edx
jne 0x402085
cmp ecx, eax
jne 0x402085
xor eax, eax
mov cl, byte [eax + ebp + 0xf0]
cmp cl, 0x35
je 0x402058
test cl, cl
jne 0x402043
mov ecx, 1
jmp 0x40204f
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, 2
add eax, ecx
cmp eax, 0x4c3
jl 0x40202c
cmp eax, 0x4c4
jge 0x402085
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, eax
cmp ecx, 0x4c6
jge 0x402085
lea eax, [eax + ebp + 0xf2]
test eax, eax
je 0x402085
xor edx, edx
mov dl, byte [eax]
mov dword [esp + 0x10], edx
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x402099
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10c
ret
xor ecx, ecx
mov eax, 0x411030
mov dword [esp + 0x18], ecx
cmp edx, dword [eax]
je 0x4020b3
add eax, 8
inc ecx
cmp eax, 0x411078
jl 0x4020a4
xor eax, eax
lea edi, [ebp + 0x1c]
mov al, byte [ebp + 2]
mov dword [esp + 0x18], ecx
cmp eax, 0x10
mov dword [esp + 0x14], edi
jle 0x4020cd
mov eax, 0x10
test eax, eax
mov esi, 0x413cb8
jle 0x4020f3
mov ebx, eax
xor eax, eax
mov al, byte [edi]
inc edi
push eax
push str._02X:
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
add esi, 3
dec ebx
jne 0x4020d8
mov byte [esi - 1], 0
mov edx, dword [ebp + 0xc]
lea esi, [ebp + 0xc]
push 0x413cb8
push edx
call sub.WSOCK32.dll_inet_ntoa
mov ebx, dword [esp + 0x128]
push eax
mov eax, dword [esp + 0x20]
mov ecx, dword [eax*8 + 0x411034]
push ecx
push str.Rcvd__s_Msg_for_IP__s__Mac__s
push 0
push ebx
push 5
call fcn.004053b0
mov eax, dword [0x413cf4]
add esp, 0x1c
test eax, eax
je case.0x40214a.2
mov eax, dword [esp + 0x10]
cmp eax, 7
ja case.0x40214a.2
mov edx, eax
jmp dword [edx*4 + 0x402610]
mov eax, dword [ebp + 0xec]
mov ecx, dword [0x411278]
cmp eax, ecx
jne 0x4021d1
xor eax, eax
mov cl, byte [eax + ebp + 0xf0]
cmp cl, 0x32
je 0x40218f
test cl, cl
jne 0x40217a
mov ecx, 1
jmp 0x402186
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, 2
add eax, ecx
cmp eax, 0x4c3
jl 0x402163
cmp eax, 0x4c4
jge 0x4021d1
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, eax
cmp ecx, 0x4c6
jge 0x4021d1
lea eax, [eax + ebp + 0xf2]
test eax, eax
je 0x4021d1
mov eax, dword [eax]
push eax
mov dword [esi], eax
call sub.WSOCK32.dll_inet_ntoa
push eax
push str.Client_requested_address__s
push 0
push ebx
push 5
call fcn.004053b0
add esp, 0x14
mov eax, dword [esp + 0x14]
xor edx, edx
mov dl, byte [ebp + 2]
push edx
push eax
push esi
push ebx
call fcn.004015f0
mov esi, eax
add esp, 0x10
test esi, esi
jne 0x40220a
push str.no_more_address_or_address_previously_allocated_by_another_server
push eax
push ebx
push 1
call fcn.004053b0
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov ecx, dword [ebp + 0xec]
mov eax, dword [0x411278]
cmp ecx, eax
mov edi, str.DHCP
je 0x402223
mov edi, str.BOOTP
mov edx, dword [esi]
push edx
call sub.WSOCK32.dll_inet_ntoa
push eax
push edi
push str._s:_proposed_address__s
push 0
push ebx
push 2
call fcn.004053b0
add esp, 0x18
mov byte [ebp], 2
mov eax, dword [esi]
lea ecx, [ebp + 0x6c]
push 0x80
push 0x413d04
push ecx
mov dword [ebp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push ebp
call fcn.00401d00
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
xor ecx, ecx
mov cl, byte [ebp + 2]
cmp ecx, 0x10
mov dword [esp + 0x10], ecx
jb 0x40228c
mov ecx, 0x10
mov dword [esp + 0x10], ecx
mov edx, dword [0x413cb4]
xor eax, eax
test edx, edx
jle case.0x40214a.2
mov edx, dword [0x413cb0]
jmp 0x4022a8
mov ecx, dword [esp + 0x10]
mov esi, dword [edx]
mov edi, dword [esp + 0x14]
add esi, 4
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4022d5
mov ecx, dword [0x413cb4]
inc eax
add edx, 4
cmp eax, ecx
jl 0x4022a4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10c
ret
cmp eax, dword [0x413cb4]
jge case.0x40214a.2
mov edx, dword [0x413cb0]
mov edi, dword [edx + eax*4]
test edi, edi
je case.0x40214a.2
mov eax, dword [ebp + 0xec]
mov ecx, dword [0x411278]
cmp eax, ecx
mov edx, 1
jne 0x40239f
xor eax, eax
mov cl, byte [eax + ebp + 0xf0]
cmp cl, 0x36
je 0x402339
test cl, cl
jne 0x402324
mov ecx, 1
jmp 0x402330
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, 2
add eax, ecx
cmp eax, 0x4c3
jl 0x40230d
cmp eax, 0x4c4
jge 0x40239f
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, eax
cmp ecx, 0x4c6
jge 0x40239f
lea eax, [eax + ebp + 0xf2]
test eax, eax
je 0x40239f
mov esi, dword [eax]
lea edx, [esp + 0x1c]
push 0x100
push edx
call sub.WSOCK32.dll_gethostname
cmp eax, 0xffffffff
je 0x40239d
lea eax, [esp + 0x1c]
push eax
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x40239d
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x40239d
mov eax, dword [ecx]
test eax, eax
je 0x40239d
cmp dword [eax], esi
je 0x4023c8
mov eax, dword [ecx + 4]
add ecx, 4
test eax, eax
jne 0x40238f
xor edx, edx
mov ecx, dword [0x411278]
mov eax, dword [ebp + 0xec]
cmp eax, ecx
jne 0x402416
xor eax, eax
mov cl, byte [eax + ebp + 0xf0]
cmp cl, 0x32
je 0x4023e4
test cl, cl
jne 0x4023cf
mov ecx, 1
jmp 0x4023db
mov edx, 1
jmp 0x40239f
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, 2
add eax, ecx
cmp eax, 0x4c3
jl 0x4023b1
cmp eax, 0x4c4
jge 0x402416
xor ecx, ecx
mov cl, byte [eax + ebp + 0xf1]
add ecx, eax
cmp ecx, 0x4c6
jge 0x402416
lea eax, [eax + ebp + 0xf2]
test eax, eax
je 0x402416
mov eax, dword [eax]
mov ecx, dword [edi]
xor edx, edx
cmp ecx, eax
sete dl
jmp 0x40241a
mov eax, dword [esp + 0x10]
test edx, edx
je 0x40247d
lea edx, [edi + 0x18]
push edx
call fcn.004096e6
mov eax, dword [esp + 0x128]
push str.Previously_allocated_address_acked
push 0
push eax
push 5
call fcn.004053b0
add esp, 0x14
mov byte [ebp], 2
mov ecx, dword [edi]
lea edx, [ebp + 0x6c]
push 0x80
push 0x413d04
push edx
mov dword [ebp + 0x10], ecx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
push ebp
call fcn.00401d00
add esp, 4
mov byte [ebp + 0xf2], 5
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
push eax
call sub.WSOCK32.dll_inet_ntoa
push eax
mov eax, dword [esp + 0x128]
push str.Client_requested_address__s_which_was_not_allocated_by_tftpd32
push 0
push eax
push 5
call fcn.004053b0
add esp, 0x14
mov dword [edi + 0x18], 0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
xor ecx, ecx
mov cl, byte [ebp + 2]
mov ebp, ecx
cmp ebp, 0x10
jb 0x4024c2
mov ebp, 0x10
mov ecx, dword [0x413cb4]
xor eax, eax
test ecx, ecx
jle case.0x40214a.2
mov edx, dword [0x413cb0]
mov esi, dword [edx]
mov edi, dword [esp + 0x14]
add esi, 4
mov ecx, ebp
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x402507
mov ecx, dword [0x413cb4]
inc eax
add edx, 4
cmp eax, ecx
jl 0x4024d8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10c
ret
cmp eax, dword [0x413cb4]
jge case.0x40214a.2
mov edx, dword [0x413cb0]
mov esi, dword [edx + eax*4]
test esi, esi
je case.0x40214a.2
mov dword [esi], 0xffffffff
mov eax, dword [0x413cb4]
dec eax
push 0x4015c0
push 4
mov dword [0x413cb4], eax
push eax
mov eax, dword [0x413cb0]
push eax
call fcn.004097c2
push esi
call fcn.00409990
mov ecx, dword [esp + 0x138]
push str.item_destroyed
push 0
push ecx
push 5
call fcn.004053b0
add esp, 0x24
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
xor edx, edx
mov dl, byte [ebp + 2]
mov ebp, edx
cmp ebp, 0x10
jb 0x402588
mov ebp, 0x10
mov ecx, dword [0x413cb4]
xor eax, eax
test ecx, ecx
jle case.0x40214a.2
mov edx, dword [0x413cb0]
mov esi, dword [edx]
mov edi, dword [esp + 0x14]
add esi, 4
mov ecx, ebp
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x4025c9
mov ecx, dword [0x413cb4]
inc eax
add edx, 4
cmp eax, ecx
jl 0x40259a
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10c
ret
cmp eax, dword [0x413cb4]
jge case.0x40214a.2
mov ecx, dword [0x413cb0]
mov eax, dword [ecx + eax*4]
test eax, eax
je case.0x40214a.2
mov edx, dword [esp + 0x124]
xor ecx, ecx
push str.item_released
push ecx
push edx
push 5
mov dword [eax + 0x18], ecx
mov dword [eax + 0x14], ecx
call fcn.004053b0
add esp, 0x10
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10c
ret