Function at 0x40112b
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor ebx, ebx
mov ax, word [esi + 0x224c]
mov dword [ebp - 8], ebx
push eax
mov dword [ebp - 0xc], ebx
call sub.WSOCK32.dll_ntohs
movzx edi, ax
cmp edi, 1
mov dword [ebp - 0x14], edi
je 0x40119a
cmp edi, 2
je 0x4011a7
lea ebx, [esi + 0x245c]
push edi
push str.Unexpected_request__d_from_peer
xor edi, edi
push dword [ebx]
push dword [ebp + 0xc]
push edi
call fcn.00402409
push str.Returning_EBADOP_to_Peer
push dword [ebx]
push dword [ebp + 0xc]
push edi
call fcn.00402409
push 4
push esi
call fcn.0040237a
add esp, 0x2c
push edi
push edi
jmp 0x4013c6
cmp dword [0x40b98c], ebx
je 0x4011a7
call fcn.00402600
lea eax, [esi + 0x224e]
mov cl, byte [eax + ebx]
test cl, cl
je 0x4011c6
cmp cl, 0x2f
jne 0x4011bd
mov byte [eax + ebx], 0x5c
inc ebx
cmp ebx, 0x200
jl 0x4011ad
push eax
push str.FileName_is___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 9
call fcn.00402409
mov eax, 0x200
add esp, 0x14
cmp ebx, eax
jge 0x4012c5
cmp byte [ebx + esi + 0x224e], 0
jne 0x4012c5
inc ebx
cmp ebx, eax
mov dword [ebp + 8], ebx
lea ecx, [ebx + esi + 0x224e]
mov dword [ebp - 4], ecx
jge 0x4012a4
cmp byte [esi + ebx + 0x224e], 0
je 0x401222
inc ebx
cmp ebx, eax
mov dword [ebp + 8], ebx
jl 0x401210
cmp ebx, eax
jge 0x4012a4
cmp byte [ebx + esi + 0x224e], 0
jne 0x4012a4
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
push str.netascii
push ecx
mov dword [ebp - 8], 1
call ebx
test eax, eax
je 0x40129d
push str.ascii
push dword [ebp - 4]
call ebx
test eax, eax
je 0x40129d
push str.mail
push dword [ebp - 4]
call ebx
test eax, eax
jne 0x40126e
mov dword [esi + 0x10], 2
jmp 0x4012a4
push str.octet
push dword [ebp - 4]
call ebx
test eax, eax
je 0x401297
push str.binary
push dword [ebp - 4]
call ebx
test eax, eax
je 0x401297
and dword [ebp - 8], 0
mov dword [ebp - 4], str.Unknown
jmp 0x4012a4
and dword [esi + 0x10], 0
jmp 0x4012a4
mov dword [esi + 0x10], 1
push dword [ebp - 4]
push str.Mode_is___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 0xc
call fcn.00402409
add esp, 0x14
cmp dword [ebp - 8], 0
jne 0x4012eb
push str.Uncorrect_message
xor edi, edi
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push edi
call fcn.00402409
push 4
push esi
call fcn.0040237a
add esp, 0x18
jmp 0x401193
cmp edi, 1
mov eax, str.Read
je 0x4012fa
mov eax, str.Write
push dword [ebp - 4]
lea ebx, [esi + 0x224e]
push ebx
push eax
push str._s_request_for_file___s_._Mode__s
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 1
call fcn.00402409
push ebx
call fcn.0040399b
push edi
push ebx
call fcn.004039cd
add esp, 0x28
test eax, eax
jne 0x401356
call fcn.00402543
push eax
push str.Error_:_EACCESS._Ext_error__s
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 1
call fcn.00402409
push 2
push esi
call fcn.0040237a
add esp, 0x1c
jmp 0x4013c2
mov eax, edi
push 0
dec eax
push 0x8000020
neg eax
sbb eax, eax
add eax, 3
push eax
mov eax, edi
dec eax
push 0
neg eax
sbb eax, eax
push 1
and eax, 0xc0000000
add eax, 0x80000000
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0x1c], eax
jne 0x4013d8
call fcn.00402543
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_:_EACCESS._CreateFile_returns__d:___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 1
call fcn.00402409
xor eax, eax
cmp edi, 1
setne al
inc eax
push eax
push esi
call fcn.0040237a
add esp, 0x20
push 0
push 0
push 0x10
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_PostMessageA]
xor eax, eax
jmp 0x401769
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
lea ebx, [esi + 0x2038]
push 0x204
push 0
push ebx
mov dword [esi + 0x2458], eax
call fcn.00403e00
add esp, 0xc
push 6
call sub.WSOCK32.dll_htons
mov word [ebx], ax
xor ecx, ecx
add ebx, 2
cmp dword [0x40b984], ecx
mov dword [ebp - 0x18], ebx
je 0x401687
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [ebp + 8], 0x200
jge 0x401682
mov eax, dword [ebp + 8]
cmp byte [esi + eax + 0x224e], 0
lea eax, [esi + eax + 0x224e]
mov dword [ebp - 8], eax
jne 0x40144d
inc dword [ebp + 8]
jmp 0x401675
push eax
push str.Option_is___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 0xc
call fcn.00402409
add esp, 0x14
mov eax, dword [ebp + 8]
lea edx, [esi + 0x224e]
cmp byte [edx + eax], 0
je 0x401480
inc eax
cmp eax, 0x200
mov dword [ebp + 8], eax
jl 0x401466
lea ecx, [eax + esi + 0x224f]
inc eax
mov dword [ebp - 4], ecx
mov ecx, 0x200
cmp eax, ecx
mov dword [ebp + 8], eax
jge 0x401675
cmp byte [edx + eax], 0
je 0x4014a9
inc eax
cmp eax, ecx
mov dword [ebp + 8], eax
jl 0x40149b
cmp eax, ecx
jge 0x401675
cmp byte [edx + eax], 0
jne 0x401675
push dword [ebp - 4]
push dword [ebp - 8]
push str.Option___s_:_value___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 0xc
call fcn.00402409
add esp, 0x18
push str.blksize
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x401554
push dword [ebp - 4]
call fcn.00404290
cmp eax, 8
pop ecx
mov dword [ebp - 0x10], eax
jb 0x401554
cmp eax, 0x2000
ja 0x401554
push dword [ebp - 4]
push dword [ebp - 8]
push str.__s__changed_to___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 9
call fcn.00402409
add esp, 0x18
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 8]
call edi
push dword [ebp - 4]
lea ebx, [ebx + eax + 1]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 4]
call edi
lea ebx, [ebx + eax + 1]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], 1
mov dword [esi + 8], eax
push str.timeout
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4015cf
push dword [ebp - 4]
call fcn.00404290
cmp eax, 1
pop ecx
mov dword [ebp - 0x10], eax
jb 0x4015cf
cmp eax, 0xff
ja 0x4015cf
push dword [ebp - 4]
push dword [ebp - 8]
push str.__s__changed_to___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 9
call fcn.00402409
add esp, 0x18
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 8]
call edi
push dword [ebp - 4]
lea ebx, [ebx + eax + 1]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 4]
call edi
lea ebx, [ebx + eax + 1]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], 1
mov dword [esi + 0xc], eax
push str.tsize
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x401675
push dword [ebp - 8]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 8]
call edi
cmp dword [ebp - 0x14], 1
lea ebx, [ebx + eax + 1]
jne 0x401625
push 0
push dword [esi + 0x1c]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
push 0x40b14c
push ebx
mov dword [ebp - 4], eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebx
call edi
lea ebx, [ebx + eax + 1]
jmp 0x40164a
push dword [ebp - 4]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push dword [ebp - 4]
call edi
push dword [ebp - 4]
lea ebx, [ebx + eax + 1]
call fcn.00404290
pop ecx
mov dword [ebp - 4], eax
mov dword [esi + 0x2458], eax
push dword [ebp - 4]
push dword [ebp - 8]
push str.__s__changed_to___u_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 9
call fcn.00402409
mov eax, dword [ebp - 4]
add esp, 0x18
mov dword [ebp - 0xc], 1
mov dword [esi + 0x18], eax
cmp dword [0x40b984], 0
jne 0x401421
mov edi, dword [ebp - 0x14]
xor ecx, ecx
lea eax, [esi + 0x2038]
sub ebx, eax
xor eax, eax
cmp edi, 1
mov dword [esi + 0x28], ebx
sete al
mov dword [esi + 0x24], eax
mov dword [esi + 0x20], eax
mov eax, dword [0x40b974]
xor edx, edx
div dword [esi + 8]
cmp dword [ebp - 0xc], ecx
mov dword [esi + 0x14], eax
je 0x40174c
push 0x200
lea eax, [ebp - 0x218]
push ecx
push eax
call fcn.00403e00
lea eax, [ebx - 2]
push eax
lea eax, [ebp - 0x218]
push dword [ebp - 0x18]
push eax
call fcn.00403ed0
xor edx, edx
add ebx, 0xfffffffe
add esp, 0x18
cmp ebx, edx
mov dword [ebp + 8], edx
jle 0x401719
mov eax, dword [ebp + 8]
cmp byte [ebp + eax - 0x218], 0
lea eax, [ebp + eax - 0x218]
jne 0x401711
mov ecx, edx
and cl, 1
inc edx
test cl, cl
je 0x40170c
push 0x2c
jmp 0x40170e
push 0x3d
pop ecx
mov byte [eax], cl
inc dword [ebp + 8]
cmp dword [ebp + 8], ebx
jl 0x4016ea
lea eax, [ebp - 0x218]
push eax
push str.OACK:___s_
push dword [esi + 0x245c]
push dword [ebp + 0xc]
push 3
call fcn.00402409
add esp, 0x14
xor eax, eax
cmp edi, 1
setne al
push 0
add eax, 0x8008
push 0
push eax
jmp 0x40175d
dec edi
push ecx
neg edi
sbb edi, edi
push ecx
and edi, 5
add edi, 0x8007
push edi
push dword [ebp + 0xc]
call dword [sym.imp.USER32.dll_PostMessageA]
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret