Function at 0x405f70
Capabilities:
Get file size

Disassembly:
sub esp, 0x424
mov eax, dword [0x420050]
xor eax, esp
mov dword [esp + 0x420], eax
push ebx
push ebp
push edi
mov edi, dword [esp + 0x434]
movzx eax, word [edi + 0x4270]
mov ebp, dword [edi + 0x10]
push eax
mov dword [esp + 0x14], ebp
mov dword [esp + 0x18], 0
mov byte [edi + 0x446d], 0
call sub.WSOCK32.dll_ntohs
movzx ebx, ax
cmp ebx, 1
mov dword [esp + 0x18], ebx
je 0x406014
cmp ebx, 2
je 0x406014
mov ecx, dword [edi + 0x4474]
push ebx
push str.Unexpected_request__d_from_peer
push ecx
push ebp
push 0
call fcn.004098c0
mov edx, dword [edi + 0x4474]
push str.Returning_EBADOP_to_Peer
push edx
push ebp
push 0
call fcn.004098c0
push 4
mov ebx, edi
call fcn.00405810
add esp, 0x28
pop edi
pop ebp
mov eax, 0x3ec
pop ebx
mov ecx, dword [esp + 0x420]
xor ecx, esp
call fcn.0040c6d6
add esp, 0x424
ret
push esi
lea esi, [edi + 0x4272]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 0x104
jl 0x406033
push str.File_name_too_long__return_EBADOP_to_peer
jmp 0x40611c
push 0x25
push esi
call fcn.0040d2e0
add esp, 8
test eax, eax
je 0x40606c
mov ecx, dword [edi + 0x4474]
push str.Error:_Tftpd32_does_not_handle_filenames_with_a_percent_sign
push ecx
push ebp
push 1
call fcn.004098c0
push 2
mov ebx, edi
call fcn.00405810
add esp, 0x14
mov eax, 0x3ec
jmp 0x40672c
mov edx, dword [edi + 0x4474]
push esi
push str.FileName_is___s_
push edx
push ebp
push 9
call fcn.004098c0
add esp, 0x14
cmp ebx, 1
jne 0x406097
cmp dword [0x41f3a8], 0
je 0x406097
call fcn.00409380
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
add ebx, 1
push str.netascii
lea esi, [ebx + edi + 0x4272]
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40614a
push str.ascii
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40614a
push str.mail
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4060e7
mov dword [edi + 0x48], 2
jmp 0x406151
push str.octet
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406141
push str.binary
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406141
push str.OCTET
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406141
push str.Uncorrect_message
mov eax, dword [edi + 0x4474]
push eax
push ebp
push 0
call fcn.004098c0
push 4
mov ebx, edi
call fcn.00405810
add esp, 0x14
mov eax, 0x3ec
jmp 0x40672c
mov dword [edi + 0x48], 0
jmp 0x406151
mov dword [edi + 0x48], 1
mov ecx, dword [edi + 0x4474]
push esi
push str.Mode_is___s_
push ecx
push ebp
push 0xc
call fcn.004098c0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [esp + 0x1c], 1
lea ebx, [ebx + eax + 1]
mov eax, str.Read
je 0x406185
mov eax, str.Write
mov edx, dword [edi + 0x4474]
push esi
lea esi, [edi + 0x4272]
push esi
push eax
push str._s_request_for_file___s_._Mode__s
push edx
push ebp
push 1
call fcn.004098c0
push esi
call fcn.004058a0
push 0x208
lea eax, [esp + 0x24c]
push eax
push esi
mov ecx, edi
call fcn.00405140
mov edx, dword [edi + 0x4474]
lea ecx, [esp + 0x254]
push ecx
push str.final_name_:___s_
push edx
push ebp
push 0xa
call fcn.004098c0
add esp, 0x40
lea eax, [esp + 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 0x104
jl 0x40621b
mov ecx, dword [edi + 0x4474]
push str.File_name_too_long__return_EBADOP_to_peer
push ecx
push ebp
push 0
call fcn.004098c0
push 4
mov ebx, edi
call fcn.00405810
add esp, 0x14
mov eax, 0x3ec
jmp 0x40672c
mov edx, dword [esp + 0x1c]
push edx
lea eax, [esp + 0x22c]
push eax
call fcn.00405900
add esp, 8
test eax, eax
jne 0x406265
call fcn.004034f0
mov ecx, dword [edi + 0x4474]
push eax
push esi
push str.Error_EACCESS_on_file__s._Ext_error__s
push ecx
push ebp
push 1
call fcn.004098c0
push 2
mov ebx, edi
call fcn.00405810
add esp, 0x1c
mov eax, 0x3ec
jmp 0x40672c
mov esi, dword [esp + 0x1c]
mov edx, esi
sub edx, 1
push 0
neg edx
sbb edx, edx
push 0x8000020
mov eax, esi
sub eax, 1
add edx, 3
neg eax
push edx
sbb eax, eax
push 0
and eax, 0xc0000000
push 1
add eax, 0x80000000
push eax
lea ecx, [esp + 0x240]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [edi + 0x1c], eax
jne 0x4062d0
xor edx, edx
cmp esi, 1
setne dl
mov esi, str.CreateFile
mov ecx, edi
add edx, 1
push edx
call fcn.00405e10
add esp, 4
mov eax, 0x3ec
jmp 0x40672c
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0x204
lea esi, [edi + 0x405c]
push 0
push esi
mov dword [edi + 0x4480], eax
call fcn.0040c6f0
add esp, 0xc
push 6
call sub.WSOCK32.dll_htons
lea ebp, [esi + 2]
mov word [esi], ax
mov dword [esp + 0x24], ebp
jmp 0x406314
mov ebx, dword [esp + 0x10]
cmp dword [0x41f39c], 0
jne 0x40632a
cmp dword [0x41f3a0], 0
je 0x40662d
cmp ebx, 0x200
jge 0x40662d
cmp byte [edi + ebx + 0x4272], 0
lea esi, [edi + ebx + 0x4272]
jne 0x40634c
add ebx, 1
jmp 0x406314
mov eax, dword [edi + 0x4474]
mov ecx, dword [esp + 0x14]
push esi
push str.Option_is___s_
push eax
push ecx
push 0xc
call fcn.004098c0
add esp, 0x14
jmp 0x406370
cmp byte [edi + ebx + 0x4272], 0
je 0x406385
add ebx, 1
cmp ebx, 0x200
jl 0x406370
mov dword [esp + 0x10], ebx
mov eax, dword [esp + 0x10]
add eax, 1
cmp eax, 0x200
lea ebx, [ebx + edi + 0x4273]
mov dword [esp + 0x10], eax
jge 0x406310
jmp 0x4063b0
mov eax, dword [esp + 0x10]
cmp byte [edi + eax + 0x4272], 0
je 0x4063d1
add eax, 1
cmp eax, 0x200
mov dword [esp + 0x10], eax
jl 0x4063b0
jmp 0x406310
cmp eax, 0x200
jge 0x406310
mov edx, dword [esp + 0x10]
cmp byte [edi + edx + 0x4272], 0
jne 0x406310
mov eax, dword [edi + 0x4474]
mov ecx, dword [esp + 0x14]
push ebx
push esi
push str.Option___s_:_value___s_
push eax
push ecx
push 0xc
call fcn.004098c0
add esp, 0x18
cmp dword [0x41f3a0], 0
jne 0x40657e
push str.blksize
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4064fc
push ebx
call fcn.0040d695
add esp, 4
cmp eax, 8
mov dword [esp + 0x20], eax
jae 0x40645f
mov edx, dword [edi + 0x4474]
push eax
mov eax, dword [esp + 0x18]
push esi
push str.__s__proposed_by_client__d__refused_by_Tftpd32
push edx
push eax
push 9
call fcn.004098c0
mov eax, dword [esp + 0x38]
add esp, 0x18
cmp eax, 0x4000
jbe 0x406493
mov ecx, dword [edi + 0x4474]
mov edx, dword [esp + 0x14]
push 0x4000
push eax
push esi
push str.__s__proposed_by_client__d__reply_with__d
push ecx
push edx
push 2
call fcn.004098c0
mov eax, dword [esp + 0x3c]
add esp, 0x1c
mov dword [edi + 0x40], 0x4000
cmp eax, 8
jb 0x4064fc
cmp eax, 0x4000
ja 0x4064c3
mov eax, dword [edi + 0x4474]
mov ecx, dword [esp + 0x14]
push ebx
push esi
push str.__s__changed_to___s_
push eax
push ecx
push 9
call fcn.004098c0
mov edx, dword [esp + 0x38]
add esp, 0x18
mov dword [edi + 0x40], edx
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebp, [eax + ebp + 1]
mov eax, dword [edi + 0x40]
push eax
push 0x419b78
push ebp
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebp, [eax + ebp + 1]
mov dword [esp + 0x18], 1
cmp dword [0x41f3a0], 0
jne 0x40657e
push str.timeout
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40657e
push ebx
call fcn.0040d695
mov dword [esp + 0x24], eax
add eax, 0xffffffff
add esp, 4
cmp eax, 0xfe
ja 0x40657e
mov ecx, dword [edi + 0x4474]
mov edx, dword [esp + 0x14]
push ebx
push esi
push str.__s__changed_to___s_
push ecx
push edx
push 9
call fcn.004098c0
add esp, 0x18
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebp, [eax + ebp + 1]
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebp, [eax + ebp + 1]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], 1
mov dword [edi + 0x44], eax
push str.tsize
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x406310
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [esp + 0x1c], 1
lea ebp, [eax + ebp + 1]
jne 0x4065d8
mov ecx, dword [edi + 0x4480]
push ecx
push 0x419b78
push ebp
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [edi + 0x4480]
lea ebp, [eax + ebp + 1]
mov dword [edi + 0x50], edx
jmp 0x4065fd
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push ebx
lea ebp, [eax + ebp + 1]
call fcn.0040d695
add esp, 4
mov dword [edi + 0x4480], eax
mov dword [edi + 0x50], eax
mov eax, dword [edi + 0x4480]
mov ecx, dword [edi + 0x4474]
mov edx, dword [esp + 0x14]
push eax
push esi
push str.__s__changed_to___u_
push ecx
push edx
push 0xa
call fcn.004098c0
add esp, 0x18
mov dword [esp + 0x18], 1
jmp 0x406310
mov ebx, dword [esp + 0x1c]
lea eax, [edi + 0x405c]
sub ebp, eax
cmp ebx, 1
lea esi, [ebp - 2]
mov dword [edi + 0x34], esi
jne 0x40664f
cmp dword [esp + 0x18], 0
jne 0x40664f
mov eax, ebx
jmp 0x406651
xor eax, eax
mov ecx, dword [edi + 0x40]
mov dword [edi + 0x30], eax
mov dword [edi + 0x28], eax
mov eax, dword [edi + 0x4480]
xor edx, edx
div ecx
xor edx, edx
add eax, 1
mov dword [edi + 0x2c], eax
mov eax, dword [0x41f38c]
div ecx
cmp dword [esp + 0x18], 0
mov dword [edi + 0x4c], eax
je 0x40671f
push 0x200
lea eax, [esp + 0x2c]
push 0
push eax
call fcn.0040c6f0
mov ecx, dword [esp + 0x30]
push esi
push ecx
lea edx, [esp + 0x3c]
push edx
call fcn.0040ce50
add ebp, 0xfffffffe
add esp, 0x18
xor eax, eax
xor edx, edx
test ebp, ebp
jle 0x4066d8
cmp byte [esp + eax + 0x28], 0
jne 0x4066d1
mov ecx, edx
and cl, 1
add edx, 1
test cl, cl
mov ecx, 0x2c
jne 0x4066cd
mov ecx, 0x3d
mov byte [esp + eax + 0x28], cl
add eax, 1
cmp eax, ebp
jl 0x4066b0
mov eax, dword [edi + 0x4474]
mov esi, dword [esp + 0x14]
lea edx, [esp + 0x28]
push edx
push str.OACK:___s_
push eax
push esi
push 3
call fcn.004098c0
mov ecx, dword [edi + 0x34]
mov edx, dword [edi + 0x4474]
push ecx
push str.Size_of_OACK_string_:___d_
push edx
push esi
push 0xd
call fcn.004098c0
xor eax, eax
add esp, 0x28
cmp ebx, 1
setne al
add eax, 0x3e8
jmp 0x40672c
xor eax, eax
cmp ebx, 1
setne al
add eax, 0x3ea
mov ecx, dword [esp + 0x430]
pop esi
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040c6d6
add esp, 0x424
ret