Function at 0x405f40
Capabilities:
Get file size

Disassembly:
sub esp, 0x424
mov eax, dword [0x41f050]
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 0x405fe4
cmp ebx, 2
je 0x405fe4
mov ecx, dword [edi + 0x4474]
push ebx
push str.Unexpected_request__d_from_peer
push ecx
push ebp
push 0
call fcn.00409890
mov edx, dword [edi + 0x4474]
push str.Returning_EBADOP_to_Peer
push edx
push ebp
push 0
call fcn.00409890
push 4
mov ebx, edi
call fcn.004057e0
add esp, 0x28
pop edi
pop ebp
mov eax, 0x3ec
pop ebx
mov ecx, dword [esp + 0x420]
xor ecx, esp
call fcn.0040c6a6
add esp, 0x424
ret
push esi
lea esi, [edi + 0x4272]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 0x104
jl 0x406003
push str.File_name_too_long__return_EBADOP_to_peer
jmp 0x4060ec
push 0x25
push esi
call fcn.0040d2b0
add esp, 8
test eax, eax
je 0x40603c
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.00409890
push 2
mov ebx, edi
call fcn.004057e0
add esp, 0x14
mov eax, 0x3ec
jmp 0x4066fc
mov edx, dword [edi + 0x4474]
push esi
push str.FileName_is___s_
push edx
push ebp
push 9
call fcn.00409890
add esp, 0x14
cmp ebx, 1
jne 0x406067
cmp dword [0x41e3a8], 0
je 0x406067
call fcn.00409350
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 0x40611a
push str.ascii
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40611a
push str.mail
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4060b7
mov dword [edi + 0x48], 2
jmp 0x406121
push str.octet
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406111
push str.binary
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406111
push str.OCTET
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x406111
push str.Uncorrect_message
mov eax, dword [edi + 0x4474]
push eax
push ebp
push 0
call fcn.00409890
push 4
mov ebx, edi
call fcn.004057e0
add esp, 0x14
mov eax, 0x3ec
jmp 0x4066fc
mov dword [edi + 0x48], 0
jmp 0x406121
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.00409890
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 0x406155
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.00409890
push esi
call fcn.00405870
push 0x208
lea eax, [esp + 0x24c]
push eax
push esi
mov ecx, edi
call fcn.00405110
mov edx, dword [edi + 0x4474]
lea ecx, [esp + 0x254]
push ecx
push str.final_name_:___s_
push edx
push ebp
push 0xa
call fcn.00409890
add esp, 0x40
lea eax, [esp + 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 0x104
jl 0x4061eb
mov ecx, dword [edi + 0x4474]
push str.File_name_too_long__return_EBADOP_to_peer
push ecx
push ebp
push 0
call fcn.00409890
push 4
mov ebx, edi
call fcn.004057e0
add esp, 0x14
mov eax, 0x3ec
jmp 0x4066fc
mov edx, dword [esp + 0x1c]
push edx
lea eax, [esp + 0x22c]
push eax
call fcn.004058d0
add esp, 8
test eax, eax
jne 0x406235
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.00409890
push 2
mov ebx, edi
call fcn.004057e0
add esp, 0x1c
mov eax, 0x3ec
jmp 0x4066fc
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 0x4062a0
xor edx, edx
cmp esi, 1
setne dl
mov esi, str.CreateFile
mov ecx, edi
add edx, 1
push edx
call fcn.00405de0
add esp, 4
mov eax, 0x3ec
jmp 0x4066fc
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.0040c6c0
add esp, 0xc
push 6
call sub.WSOCK32.dll_htons
lea ebp, [esi + 2]
mov word [esi], ax
mov dword [esp + 0x24], ebp
jmp 0x4062e4
mov ebx, dword [esp + 0x10]
cmp dword [0x41e39c], 0
jne 0x4062fa
cmp dword [0x41e3a0], 0
je 0x4065fd
cmp ebx, 0x200
jge 0x4065fd
cmp byte [edi + ebx + 0x4272], 0
lea esi, [edi + ebx + 0x4272]
jne 0x40631c
add ebx, 1
jmp 0x4062e4
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.00409890
add esp, 0x14
jmp 0x406340
cmp byte [edi + ebx + 0x4272], 0
je 0x406355
add ebx, 1
cmp ebx, 0x200
jl 0x406340
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 0x4062e0
jmp 0x406380
mov eax, dword [esp + 0x10]
cmp byte [edi + eax + 0x4272], 0
je 0x4063a1
add eax, 1
cmp eax, 0x200
mov dword [esp + 0x10], eax
jl 0x406380
jmp 0x4062e0
cmp eax, 0x200
jge 0x4062e0
mov edx, dword [esp + 0x10]
cmp byte [edi + edx + 0x4272], 0
jne 0x4062e0
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.00409890
add esp, 0x18
cmp dword [0x41e3a0], 0
jne 0x40654e
push str.blksize
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4064cc
push ebx
call fcn.0040d665
add esp, 4
cmp eax, 8
mov dword [esp + 0x20], eax
jae 0x40642f
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.00409890
mov eax, dword [esp + 0x38]
add esp, 0x18
cmp eax, 0x4000
jbe 0x406463
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.00409890
mov eax, dword [esp + 0x3c]
add esp, 0x1c
mov dword [edi + 0x40], 0x4000
cmp eax, 8
jb 0x4064cc
cmp eax, 0x4000
ja 0x406493
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.00409890
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 [0x41e3a0], 0
jne 0x40654e
push str.timeout
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40654e
push ebx
call fcn.0040d665
mov dword [esp + 0x24], eax
add eax, 0xffffffff
add esp, 4
cmp eax, 0xfe
ja 0x40654e
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.00409890
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 0x4062e0
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 0x4065a8
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 0x4065cd
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.0040d665
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.00409890
add esp, 0x18
mov dword [esp + 0x18], 1
jmp 0x4062e0
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 0x40661f
cmp dword [esp + 0x18], 0
jne 0x40661f
mov eax, ebx
jmp 0x406621
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 [0x41e38c]
div ecx
cmp dword [esp + 0x18], 0
mov dword [edi + 0x4c], eax
je 0x4066ef
push 0x200
lea eax, [esp + 0x2c]
push 0
push eax
call fcn.0040c6c0
mov ecx, dword [esp + 0x30]
push esi
push ecx
lea edx, [esp + 0x3c]
push edx
call fcn.0040ce20
add ebp, 0xfffffffe
add esp, 0x18
xor eax, eax
xor edx, edx
test ebp, ebp
jle 0x4066a8
cmp byte [esp + eax + 0x28], 0
jne 0x4066a1
mov ecx, edx
and cl, 1
add edx, 1
test cl, cl
mov ecx, 0x2c
jne 0x40669d
mov ecx, 0x3d
mov byte [esp + eax + 0x28], cl
add eax, 1
cmp eax, ebp
jl 0x406680
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.00409890
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.00409890
xor eax, eax
add esp, 0x28
cmp ebx, 1
setne al
add eax, 0x3e8
jmp 0x4066fc
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.0040c6a6
add esp, 0x424
ret