Function at 0x406be0
Capabilities:
Delete file
Move file

Disassembly:
mov eax, 0x1014
call fcn.00408450
mov eax, dword [0x40c548]
push ebx
push ebp
push esi
cmp eax, 1
push edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x20], 0xa
mov byte [esp + 0x13], 0
je 0x407083
test eax, eax
jne 0x406c1f
mov dword [0x40c548], 1
mov esi, dword [0x40c50c]
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
mov ecx, 0x100
lea edi, [esp + 0x824]
rep stosd dword es:[edi], eax
mov ecx, dword [esi - 8]
lea edi, [esp + 0x24]
mov eax, ecx
lea edx, [esp + 0xc24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x40c518]
push ecx
push str.user_s
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
mov edi, dword [sym.imp.MSVCRT.dll__mbsstr]
add esp, 0xc
lea eax, [esp + 0x24]
inc eax
push 0x40c328
push eax
mov esi, eax
call edi
add esp, 8
test eax, eax
jne 0x406c7c
or ecx, 0xffffffff
lea edi, [esp + 0x24]
mov byte [esi], al
lea esi, [esp + 0x24]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x824]
mov eax, ecx
lea edx, [esp + 0x824]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push 0x40bad4
rep movsb byte es:[edi], byte [esi]
mov edi, str.tmp_quick.dat
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x28]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.quick.dat
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x28]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.MSVCRT.dll_fopen]
call esi
lea ecx, [esp + 0x82c]
mov edi, eax
push 0x40be10
push ecx
mov dword [esp + 0x2c], edi
call esi
add esp, 0x10
mov ebp, eax
mov dword [esp + 0x18], ebp
push 4
push 0x1000
push 0x2800
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test edi, edi
mov ebx, eax
je 0x407083
test ebp, ebp
je 0x407083
test ebx, ebx
je 0x407083
push edi
push 0x3ff
push ebx
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
je 0x407035
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
lea edx, [eax - 1]
cmp edx, ecx
jne 0x406dd5
lea esi, [eax + eax]
push 4
mov eax, esi
push 0x1000
shl eax, 0xa
push eax
push 0
mov dword [esp + 0x30], esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebp, eax
mov eax, esi
cdq
sub eax, edx
mov esi, ebx
mov ecx, eax
mov edi, ebp
sar ecx, 1
shl ecx, 0xa
mov edx, ecx
mov ebx, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x14]
mov ecx, 0xff
shl eax, 0xa
lea edi, [esp + 0x424]
lea edx, [eax + ebx]
mov al, byte [esp + 0x13]
mov esi, edx
mov byte [edx + 0x3ff], 0
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
test al, al
movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x424]
jne 0x406e20
cmp byte [esp + 0x424], 0x5b
jne 0x406e17
mov byte [esp + 0x13], 1
inc dword [esp + 0x14]
jmp 0x406fbf
cmp al, 2
jne 0x406e88
mov al, byte [esp + 0x424]
cmp al, 0x5b
jne 0x406e5f
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
mov esi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov edx, ecx
mov byte [esp + 0x13], 1
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov dword [esp + 0x14], 1
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x406fbf
cmp al, 0x20
je 0x406f1d
cmp al, 9
je 0x406f1d
cmp al, 0xd
je 0x406f1d
cmp al, 0xa
je 0x406f1d
inc dword [esp + 0x14]
jmp 0x406fbf
cmp al, 1
mov al, byte [esp + 0x424]
jne 0x406f2f
cmp al, 0x5b
je 0x406eb1
cmp al, 0x20
je 0x406eca
cmp al, 9
je 0x406eca
cmp al, 0xd
je 0x406eca
cmp al, 0xa
jne 0x406f2f
jmp 0x406eca
mov ax, word [0x40c308]
mov word [edx], ax
mov cl, byte [0x40c30a]
mov byte [edx + 2], cl
mov al, byte [esp + 0x424]
mov edi, dword [esp + 0x14]
test edi, edi
jl 0x406ef9
mov esi, ebx
inc edi
mov edx, dword [esp + 0x18]
push esi
push 0x40b11c
push edx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
add esi, 0x400
dec edi
jne 0x406ed5
mov al, byte [esp + 0x424]
cmp al, 0x5b
jne 0x406f1d
mov ecx, 0xff
lea esi, [esp + 0x424]
mov edi, ebx
mov dword [esp + 0x14], 1
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
jmp 0x406fbf
mov dword [esp + 0x14], 0
mov byte [esp + 0x13], 0
jmp 0x406fbf
test al, al
je 0x406f4b
cmp al, 0x20
je 0x406f4b
cmp al, 9
je 0x406f4b
cmp al, 0xd
je 0x406f4b
cmp al, 0xa
je 0x406f4b
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x406f33
mov al, byte [ecx]
test al, al
je 0x406f6c
cmp al, 0x20
je 0x406f61
cmp al, 9
je 0x406f61
cmp al, 0xd
je 0x406f61
cmp al, 0xa
jne 0x406f6c
mov byte [ecx], 0
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x406f51
mov ebp, dword [esp + 0x14]
lea eax, [esp + 0xc24]
lea ecx, [esp + 0x424]
inc ebp
push eax
push ecx
mov dword [esp + 0x1c], ebp
call dword [sym.imp.MSVCRT.dll__mbsicmp]
add esp, 8
test eax, eax
jne 0x406fbf
mov edx, ebp
mov byte [esp + 0x13], 2
lea edi, [edx - 1]
test edi, edi
jle 0x406fbf
mov esi, ebx
mov eax, dword [esp + 0x18]
push esi
push 0x40b11c
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
add esi, 0x400
dec edi
jne 0x406fa2
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
shl edx, 0xa
push ecx
add edx, ebx
push 0x3ff
push edx
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x406d88
cmp byte [esp + 0x13], 1
jne 0x40702d
mov edi, dword [esp + 0x14]
mov cx, word [0x40c308]
mov eax, edi
shl eax, 0xa
add eax, ebx
test edi, edi
mov word [eax], cx
mov dl, byte [0x40c30a]
mov byte [eax + 2], dl
jl 0x40702d
mov esi, ebx
inc edi
mov eax, dword [esp + 0x18]
push esi
push 0x40b11c
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
add esi, 0x400
dec edi
jne 0x407010
mov edi, dword [esp + 0x1c]
mov ebp, dword [esp + 0x18]
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
push edi
call esi
push ebp
call esi
add esp, 8
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea edx, [esp + 0x24]
lea eax, [esp + 0x824]
push edx
push eax
call dword [sym.imp.MSVCRT.dll_rename]
add esp, 8
push 0x8000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1014
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1014
ret