Function at 0x404270
Capabilities:
Get file size

Disassembly:
sub esp, 0x418
push ebx
push ebp
mov ebp, dword [esp + 0x424]
push esi
push edi
mov dword [esp + 0x18], 0
mov ax, word [ebp + 0x4268]
mov edi, dword [ebp + 0x10]
push eax
mov dword [esp + 0x14], edi
mov byte [ebp + 0x4469], 0
mov byte [ebp + 0x4468], 0
call sub.WSOCK32.dll_ntohs
and eax, 0xffff
cmp eax, 1
mov dword [esp + 0x20], eax
je 0x404302
cmp eax, 2
je 0x404310
mov ecx, dword [ebp + 0x446c]
push eax
push str.Unexpected_request__d_from_peer
push ecx
push edi
push 0
call fcn.00408200
mov edx, dword [ebp + 0x446c]
push str.Returning_EBADOP_to_Peer
push edx
push edi
push 0
call fcn.00408200
push 4
push ebp
call fcn.004061d0
add esp, 0x2c
mov eax, 0x3ec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
mov eax, dword [0x416b40]
test eax, eax
je 0x404310
call fcn.00407d80
mov eax, dword [ebp + 0x446c]
lea esi, [ebp + 0x426a]
push esi
push str.FileName_is___s_
push eax
push edi
push 9
call fcn.00408200
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
push str.netascii
inc ebx
lea edi, [ebx + ebp + 0x426a]
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4043d8
push str.ascii
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4043d8
push str.mail
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40437c
mov dword [ebp + 0x44], 2
jmp 0x4043df
push str.octet
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4043cf
push str.binary
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x4043cf
mov ecx, dword [ebp + 0x446c]
mov edx, dword [esp + 0x10]
push str.Uncorrect_message
push ecx
push edx
push 0
call fcn.00408200
push 4
push ebp
call fcn.004061d0
add esp, 0x18
mov eax, 0x3ec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
mov dword [ebp + 0x44], 0
jmp 0x4043df
mov dword [ebp + 0x44], 1
mov eax, dword [ebp + 0x446c]
mov ecx, dword [esp + 0x10]
push edi
push str.Mode_is___s_
push eax
push ecx
push 0xc
call fcn.00408200
add esp, 0x14
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebx, [ebx + eax + 1]
mov eax, dword [esp + 0x20]
cmp eax, 1
mov dword [esp + 0x14], ebx
mov eax, str.Read
je 0x40441d
mov eax, str.Write
mov edx, dword [ebp + 0x446c]
push edi
mov edi, dword [esp + 0x14]
push esi
push eax
push str._s_request_for_file___s_._Mode__s
push edx
push edi
push 1
call fcn.00408200
push esi
call fcn.0040a040
mov eax, dword [ebp + 0x446c]
push esi
push str.final_name_:___s_
push eax
push edi
push 0xa
call fcn.00408200
mov edi, dword [esp + 0x54]
push edi
push esi
call fcn.0040a0b0
add esp, 0x3c
test eax, eax
jne 0x40449f
call fcn.00403340
mov ecx, dword [ebp + 0x446c]
mov edx, dword [esp + 0x10]
push eax
push esi
push str.Error_EACCESS_on_file__s._Ext_error__s
push ecx
push edx
push 1
call fcn.00408200
push 2
push ebp
call fcn.004061d0
add esp, 0x20
mov eax, 0x3ec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
mov eax, edi
mov ecx, edi
dec eax
push 0
neg eax
sbb eax, eax
push 0x8000020
add eax, 3
dec ecx
neg ecx
sbb ecx, ecx
push eax
and ecx, 0xc0000000
push 0
add ecx, 0x80000000
push 1
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 0x1c], eax
jne 0x40453b
call fcn.00403340
push eax
push str.CreateFile
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edx, [ebp + 0x426a]
push eax
push edx
lea eax, [esp + 0x38]
push str.File___s__:_error__d_in_system_call__s__s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [ebp + 0x446c]
mov eax, dword [ebp + 0x10]
lea ecx, [esp + 0x40]
push ecx
push edx
push eax
push 0
call fcn.00408200
xor ecx, ecx
cmp edi, 1
setne cl
inc ecx
push ecx
push ebp
call fcn.004061d0
add esp, 0x30
mov eax, 0x3ec
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
lea esi, [ebp + 0x4054]
mov dword [ebp + 0x4478], eax
mov ecx, 0x81
xor eax, eax
mov edi, esi
push 6
rep stosd dword es:[edi], eax
call sub.WSOCK32.dll_htons
mov word [esi], ax
add esi, 2
mov dword [esp + 0x24], esi
jmp 0x404572
mov ebx, dword [esp + 0x14]
mov eax, dword [0x416b34]
test eax, eax
jne 0x404588
mov eax, dword [0x416b38]
test eax, eax
je 0x40487d
cmp ebx, 0x200
jge 0x40487d
mov al, byte [ebx + ebp + 0x426a]
lea edi, [ebx + ebp + 0x426a]
test al, al
jne 0x4045ad
inc ebx
mov dword [esp + 0x14], ebx
jmp 0x404572
mov edx, dword [ebp + 0x446c]
mov eax, dword [esp + 0x10]
push edi
push str.Option_is___s_
push edx
push eax
push 0xc
call fcn.00408200
add esp, 0x14
mov al, byte [ebx + ebp + 0x426a]
test al, al
je 0x4045dd
inc ebx
cmp ebx, 0x200
jl 0x4045c9
mov dword [esp + 0x14], ebx
lea ebx, [ebx + ebp + 0x426b]
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 0x200
mov dword [esp + 0x14], eax
jge 0x40456e
mov eax, dword [esp + 0x14]
mov cl, byte [eax + ebp + 0x426a]
test cl, cl
je 0x40461c
inc eax
cmp eax, 0x200
mov dword [esp + 0x14], eax
jl 0x4045fc
jmp 0x40456e
cmp eax, 0x200
jge 0x40456e
mov ecx, dword [esp + 0x14]
mov al, byte [ecx + ebp + 0x426a]
test al, al
jne 0x40456e
mov edx, dword [ebp + 0x446c]
mov eax, dword [esp + 0x10]
push ebx
push edi
push str.Option___s_:_value___s_
push edx
push eax
push 0xc
call fcn.00408200
mov eax, dword [0x416b38]
add esp, 0x18
test eax, eax
jne 0x4047cc
push str.blksize
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x404748
push ebx
call fcn.0040b8a0
add esp, 4
cmp eax, 8
mov dword [esp + 0x1c], eax
jae 0x4046ab
mov ecx, dword [ebp + 0x446c]
mov edx, dword [esp + 0x10]
push eax
push edi
push str.__s__proposed_by_client__d__refused_by_Tftpd32
push ecx
push edx
push 9
call fcn.00408200
mov eax, dword [esp + 0x34]
add esp, 0x18
cmp eax, 0x4000
jbe 0x4046df
mov ecx, dword [esp + 0x10]
push 0x4000
push eax
mov eax, dword [ebp + 0x446c]
push edi
push str.__s__proposed_by_client__d__reply_with__d
push eax
push ecx
push 2
call fcn.00408200
mov eax, dword [esp + 0x38]
add esp, 0x1c
mov dword [ebp + 0x3c], 0x4000
cmp eax, 8
jb 0x404748
cmp eax, 0x4000
ja 0x40470f
mov edx, dword [ebp + 0x446c]
mov eax, dword [esp + 0x10]
push ebx
push edi
push str.__s__changed_to___s_
push edx
push eax
push 9
call fcn.00408200
mov ecx, dword [esp + 0x34]
add esp, 0x18
mov dword [ebp + 0x3c], ecx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [ebp + 0x3c]
lea esi, [esi + eax + 1]
push edx
push 0x415804
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
mov dword [esp + 0x18], 1
mov eax, dword [0x416b38]
test eax, eax
jne 0x4047cc
push str.timeout
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4047cc
push ebx
call fcn.0040b8a0
add esp, 4
cmp eax, 1
mov dword [esp + 0x1c], eax
jb 0x4047cc
cmp eax, 0xff
ja 0x4047cc
mov eax, dword [ebp + 0x446c]
mov ecx, dword [esp + 0x10]
push ebx
push edi
push str.__s__changed_to___s_
push eax
push ecx
push 9
call fcn.00408200
add esp, 0x18
push edi
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [esp + 0x1c]
lea esi, [esi + eax + 1]
mov dword [esp + 0x18], 1
mov dword [ebp + 0x40], edx
push str.tsize
push edi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40456e
push edi
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
mov eax, dword [esp + 0x20]
cmp eax, 1
jne 0x404828
mov eax, dword [ebp + 0x4478]
push eax
push 0x415804
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp + 0x4478]
lea esi, [esi + eax + 1]
mov dword [ebp + 0x4c], ecx
jmp 0x40484d
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push ebx
lea esi, [esi + eax + 1]
call fcn.0040b8a0
add esp, 4
mov dword [ebp + 0x4478], eax
mov dword [ebp + 0x4c], eax
mov edx, dword [ebp + 0x4478]
mov eax, dword [ebp + 0x446c]
mov ecx, dword [esp + 0x10]
push edx
push edi
push str.__s__changed_to___u_
push eax
push ecx
push 0xa
call fcn.00408200
add esp, 0x18
mov dword [esp + 0x18], 1
jmp 0x40456e
mov ebx, dword [esp + 0x20]
lea eax, [ebp + 0x4054]
sub esi, eax
cmp ebx, 1
lea edx, [esi - 2]
mov dword [ebp + 0x30], edx
jne 0x4048a0
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x4048a0
mov eax, ebx
jmp 0x4048a2
xor eax, eax
mov ecx, dword [ebp + 0x3c]
mov dword [ebp + 0x2c], eax
mov dword [ebp + 0x24], eax
mov eax, dword [ebp + 0x4478]
xor edx, edx
div ecx
xor edx, edx
inc eax
mov dword [ebp + 0x28], eax
mov eax, dword [0x416b24]
div ecx
mov dword [ebp + 0x48], eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x404976
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea eax, [esi - 2]
mov esi, dword [esp + 0x24]
mov ecx, eax
lea edi, [esp + 0x28]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor ecx, ecx
xor esi, esi
test eax, eax
jle 0x404926
mov dl, byte [esp + ecx + 0x28]
test dl, dl
jne 0x404921
mov edx, esi
and dl, 1
inc esi
test dl, dl
mov edx, 0x2c
jne 0x40491d
mov edx, 0x3d
mov byte [esp + ecx + 0x28], dl
inc ecx
cmp ecx, eax
jl 0x404901
mov ecx, dword [ebp + 0x446c]
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x28]
push eax
push str.OACK:___s_
push ecx
push esi
push 3
call fcn.00408200
mov edx, dword [ebp + 0x30]
mov eax, dword [ebp + 0x446c]
push edx
push str.Size_of_OACK_string_:___d_
push eax
push esi
push 0xd
call fcn.00408200
add esp, 0x28
xor eax, eax
cmp ebx, 1
pop edi
pop esi
setne al
pop ebp
add eax, 0x3e8
pop ebx
add esp, 0x418
ret
xor eax, eax
cmp ebx, 1
pop edi
pop esi
setne al
pop ebp
add eax, 0x3ea
pop ebx
add esp, 0x418
ret