Function at 0x40bd1f
Capabilities:
Get file size
Get local ipv4 addresses
Get socket information
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4d4
mov eax, dword [0x427484]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
movzx eax, word [ebx + 0x42e8]
push esi
push edi
xor esi, esi
push eax
mov dword [ebp - 0x4c8], esi
mov byte [ebx + 0x44e5], 0
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
mov dword [ebp - 0x4bc], eax
cmp eax, 1
je 0x40bd95
cmp eax, 2
je 0x40bd95
push eax
push str.Unexpected_request__d_from_peer
push esi
call fcn.00407001
add esp, 0xc
push str.Returning_EBADOP_to_Peer
push esi
call fcn.00407001
push 4
call fcn.0040b99f
add esp, 0xc
mov eax, 0x3ec
jmp 0x40c532
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea edi, [ebx + 0x42ea]
push edi
call esi
cmp eax, 0x104
jl 0x40bdb4
push 0x428bc8
push 0
jmp 0x40bd7c
push 0x25
push edi
call fcn.00410bb0
pop ecx
pop ecx
test eax, eax
je 0x40bdd2
push str.Error:_Tftpd32_does_not_handle_filenames_with_a_percent_sign
push 1
call fcn.00407001
push 2
jmp 0x40bd83
push edi
push str.FileName_is___s_
push 9
call fcn.00407001
add esp, 0xc
cmp dword [ebp - 0x4bc], 1
jne 0x40bdf9
cmp dword [0x429b5c], 0
je 0x40bdf9
call fcn.0040d127
push edi
call esi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
mov esi, eax
lea eax, [esi + ebx + 0x42eb]
push str.netascii
push eax
call edi
test eax, eax
je 0x40be8f
push str.ascii
lea eax, [esi + ebx + 0x42eb]
push eax
call edi
test eax, eax
je 0x40be8f
push str.mail
lea eax, [esi + ebx + 0x42eb]
push eax
call edi
test eax, eax
jne 0x40be46
mov dword [ebx + 0x50], 2
jmp 0x40be96
push 0x428c64
lea eax, [esi + ebx + 0x42eb]
push eax
call edi
test eax, eax
je 0x40be89
push str.binary
lea eax, [esi + ebx + 0x42eb]
push eax
call edi
test eax, eax
je 0x40be89
push str.OCTET
lea eax, [esi + ebx + 0x42eb]
push eax
call edi
test eax, eax
je 0x40be89
push str.Uncorrect_message
jmp 0x40bdb0
and dword [ebx + 0x50], 0
jmp 0x40be96
mov dword [ebx + 0x50], 1
lea edi, [esi + ebx + 0x42eb]
push edi
push str.Mode_is___s_
push 0xc
call fcn.00407001
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [ebp - 0x4bc], 1
lea eax, [esi + eax + 2]
mov dword [ebp - 0x4b8], eax
mov eax, str.Read
je 0x40bed1
mov eax, str.Write
push edi
lea esi, [ebx + 0x42ea]
push esi
push eax
push str._s_request_for_file___s_._Mode__s
push 1
call fcn.00407001
add esp, 0x14
call fcn.0040ba35
push dword [ebp - 0x4bc]
mov edi, esi
call fcn.0040b8dd
pop ecx
test eax, eax
jne 0x40bf28
call fcn.0040e9cb
push eax
lea eax, [ebx + 0x42ea]
push eax
push str.Error_EACCESS_on_file__s._Ext_error__s
push 1
call fcn.00407001
push 2
call fcn.0040b99f
add esp, 0x14
jmp 0x40bd8b
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x429e38
lea eax, [ebp - 0x230]
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [ebp - 0x230]
push eax
call edi
test eax, eax
jle 0x40bf62
cmp byte [ebp + eax - 0x231], 0x5c
je 0x40bf62
mov byte [ebp + eax - 0x230], 0x5c
inc eax
lea ecx, [ebx + 0x42ea]
push ecx
lea eax, [ebp + eax - 0x230]
push eax
call esi
lea eax, [ebp - 0x230]
push eax
push str.final_name_:___s_
push 0xa
call fcn.00407001
add esp, 0xc
lea eax, [ebp - 0x230]
push eax
call edi
cmp eax, 0x104
jl 0x40bfa3
push str.File_name_too_long__return_EBADOP_to_peer
jmp 0x40bdb0
mov eax, dword [ebp - 0x4bc]
xor esi, esi
dec eax
neg eax
sbb eax, eax
push esi
add eax, 3
push 0x8000020
push eax
mov eax, dword [ebp - 0x4bc]
dec eax
neg eax
sbb eax, eax
push esi
and eax, 0xc0000000
push 1
add eax, 0x80000000
push eax
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebx + 0x24], eax
cmp eax, 0xffffffff
jne 0x40c009
xor eax, eax
cmp dword [ebp - 0x4bc], 1
push str.CreateFile
setne al
inc eax
push eax
mov eax, ebx
call fcn.0040bc5f
pop ecx
pop ecx
jmp 0x40bd8b
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0x204
lea esi, [ebx + 0x4064]
push 0
push esi
mov dword [ebx + 0x44fc], eax
call fcn.00412af0
add esp, 0xc
push 6
call dword [sym.imp.WS2_32.dll_htons]
mov word [esi], ax
add esi, 2
mov dword [ebp - 0x4d0], esi
xor edx, edx
cmp dword [0x429b50], edx
jne 0x40c057
cmp dword [0x429b54], edx
je 0x40c43a
cmp dword [ebp - 0x4b8], 0x200
jge 0x40c43a
mov eax, dword [ebp - 0x4b8]
lea eax, [ebx + eax + 0x42ea]
mov dword [ebp - 0x4b4], eax
cmp byte [eax], dl
jne 0x40c086
inc dword [ebp - 0x4b8]
jmp 0x40c041
push eax
push str.Option_is___s_
push 0xc
call fcn.00407001
add esp, 0xc
mov eax, dword [ebp - 0x4b8]
cmp byte [ebx + eax + 0x42ea], 0
je 0x40c0b4
inc eax
mov dword [ebp - 0x4b8], eax
cmp eax, 0x200
jl 0x40c096
lea ecx, [eax + ebx + 0x42eb]
inc eax
mov dword [ebp - 0x4c4], ecx
mov dword [ebp - 0x4b8], eax
cmp eax, 0x200
jge 0x40c041
mov eax, dword [ebp - 0x4b8]
cmp byte [ebx + eax + 0x42ea], 0
je 0x40c0f5
inc dword [ebp - 0x4b8]
cmp dword [ebp - 0x4b8], 0x200
jl 0x40c0d3
cmp dword [ebp - 0x4b8], 0x200
jge 0x40c041
mov eax, dword [ebp - 0x4b8]
cmp byte [ebx + eax + 0x42ea], 0
jne 0x40c041
push ecx
push dword [ebp - 0x4b4]
push str.Option___s_:_value___s_
push 0xc
call fcn.00407001
add esp, 0x10
cmp dword [0x429b54], 0
jne 0x40c2b5
push 0x428d70
push dword [ebp - 0x4b4]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40c223
push dword [ebp - 0x4c4]
call fcn.00410b8e
pop ecx
mov dword [ebp - 0x4c0], eax
cmp eax, 8
jae 0x40c182
push eax
push dword [ebp - 0x4b4]
push str.__s__proposed_by_client__d__refused_by_Tftpd32
push 9
call fcn.00407001
add esp, 0x10
mov eax, 0x4000
cmp dword [ebp - 0x4c0], eax
jbe 0x40c1b7
push eax
push dword [ebp - 0x4c0]
push dword [ebp - 0x4b4]
push str.__s__proposed_by_client__d__reply_with__d
push 2
call fcn.00407001
add esp, 0x14
mov dword [ebx + 0x48], 0x4000
mov eax, 0x4000
cmp dword [ebp - 0x4c0], 8
jb 0x40c223
cmp dword [ebp - 0x4c0], eax
ja 0x40c1ec
push dword [ebp - 0x4c4]
push dword [ebp - 0x4b4]
push 0x428dd4
push 9
call fcn.00407001
mov eax, dword [ebp - 0x4c0]
add esp, 0x10
mov dword [ebx + 0x48], eax
push dword [ebp - 0x4b4]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call edi
push dword [ebx + 0x48]
lea esi, [esi + eax + 1]
push 0x428dec
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call edi
lea esi, [esi + eax + 1]
mov dword [ebp - 0x4c8], 1
cmp dword [0x429b54], 0
jne 0x40c2b5
push str.timeout
push dword [ebp - 0x4b4]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40c2b5
push dword [ebp - 0x4c4]
call fcn.00410b8e
mov dword [ebp - 0x4c0], eax
dec eax
pop ecx
cmp eax, 0xfe
ja 0x40c2b5
push dword [ebp - 0x4c4]
push dword [ebp - 0x4b4]
push str.__s__changed_to___s_
push 9
call fcn.00407001
add esp, 0x10
push dword [ebp - 0x4b4]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call edi
push dword [ebp - 0x4c4]
lea esi, [esi + eax + 1]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call edi
lea esi, [esi + eax + 1]
mov eax, dword [ebp - 0x4c0]
mov dword [ebp - 0x4c8], 1
mov dword [ebx + 0x4c], eax
push 0x428e10
push dword [ebp - 0x4b4]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40c362
push dword [ebp - 0x4b4]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 0x4b4]
call edi
cmp dword [ebp - 0x4bc], 1
lea esi, [esi + eax + 1]
jne 0x40c314
push dword [ebx + 0x44fc]
push 0x428e18
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call edi
lea esi, [esi + eax + 1]
mov eax, dword [ebx + 0x44fc]
jmp 0x40c33a
push dword [ebp - 0x4c4]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call edi
push dword [ebp - 0x4c4]
lea esi, [esi + eax + 1]
call fcn.00410b8e
pop ecx
mov dword [ebx + 0x44fc], eax
push dword [ebx + 0x44fc]
mov dword [ebx + 0x58], eax
push dword [ebp - 0x4b4]
push str.__s__changed_to___u_
push 0xa
call fcn.00407001
add esp, 0x10
mov dword [ebp - 0x4c8], 1
cmp dword [0x429e20], 0
je 0x40c041
push 0x428e34
push dword [ebp - 0x4b4]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40c041
lea eax, [ebp - 0x4cc]
push eax
lea eax, [ebp - 0x4b0]
push eax
push dword [ebx + 0x20]
mov dword [ebp - 0x4cc], 0x80
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
js 0x40c041
push 8
push 0x20
lea eax, [ebp - 0x24]
push eax
push 0
push 0
push 0x80
lea eax, [ebp - 0x4b0]
push eax
call dword [sym.imp.WS2_32.dll_getnameinfo]
lea eax, [ebp - 0x24]
push eax
push str.using_udpport_option______s
call fcn.0040e70d
pop ecx
pop ecx
push dword [ebp - 0x4b4]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 0x4b4]
call edi
lea esi, [esi + eax + 1]
lea eax, [ebp - 0x24]
push eax
call fcn.00410b8e
pop ecx
push eax
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
push eax
push 0x428e58
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call edi
lea esi, [esi + eax + 1]
mov eax, dword [0x429b48]
mov dword [ebx + 0x44], eax
mov dword [ebp - 0x4c8], 1
jmp 0x40c041
lea ecx, [ebx + 0x4064]
xor eax, eax
sub esi, ecx
inc eax
lea edi, [esi - 2]
mov dword [ebx + 0x38], edi
cmp dword [ebp - 0x4bc], eax
jne 0x40c45b
cmp dword [ebp - 0x4c8], edx
je 0x40c45d
xor eax, eax
mov ecx, dword [ebx + 0x48]
mov dword [ebx + 0x34], eax
mov dword [ebx + 0x2c], eax
mov eax, dword [ebx + 0x44fc]
xor edx, edx
div ecx
xor edx, edx
inc eax
mov dword [ebx + 0x30], eax
mov eax, dword [0x429b40]
div ecx
cmp dword [ebp - 0x4c8], 0
mov dword [ebx + 0x54], eax
je 0x40c521
push 0x200
lea eax, [ebp - 0x430]
push 0
push eax
call fcn.00412af0
add esp, 0xc
push edi
push dword [ebp - 0x4d0]
lea eax, [ebp - 0x430]
push eax
call fcn.00412b70
add esi, 0xfffffffe
add esp, 0xc
xor edi, edi
xor edx, edx
test esi, esi
jle 0x40c4e6
lea eax, [ebp + edi - 0x430]
cmp byte [eax], 0
jne 0x40c4e1
mov ecx, edx
inc edx
and cl, 1
je 0x40c4dc
push 0x2c
jmp 0x40c4de
push 0x3d
pop ecx
mov byte [eax], cl
inc edi
cmp edi, esi
jl 0x40c4c4
lea eax, [ebp - 0x430]
push eax
push str.OACK:___s_
push 3
call fcn.00407001
add esp, 0xc
push dword [ebx + 0x38]
push str.Size_of_OACK_string_:___d_
push 0xd
call fcn.00407001
xor eax, eax
add esp, 0xc
cmp dword [ebp - 0x4bc], 1
setne al
add eax, 0x3e8
jmp 0x40c532
xor eax, eax
cmp dword [ebp - 0x4bc], 1
setne al
add eax, 0x3ea
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040ffa3
leave
ret