Function at 0x406c60
Capabilities:
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x493296
mov eax, dword fs:[0]
push eax
mov eax, 0x202c
call fcn.0047c460
mov eax, dword [0x4c100c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 0xc], 0
mov edi, dword [ebp + 8]
je 0x406ea0
cmp dword [edi + 0x1c], 0
je 0x406ea0
lea ecx, [ebp - 0x2038]
call fcn.004064d0
push ecx
lea eax, [ebp - 0x2014]
mov dword [ebp - 0x2014], 0
push eax
lea ecx, [ebp - 0x2038]
call fcn.004065f0
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x2014]
push dword [eax - 0xc]
push eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov esi, eax
test esi, esi
jne 0x406cf3
call fcn.00407710
push esi
lea eax, [ebp - 0x2010]
push 0x1000
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
add esp, 0xc
push esi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
lea ecx, [ebp - 0x2010]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406d20
sub ecx, edx
lea eax, [ebp + 0x10]
sar ecx, 1
mov edx, 0x1000
push eax
push dword [ebp + 0xc]
lea eax, [ebp - 0x2010]
sub edx, ecx
lea ecx, [eax + ecx*2]
call fcn.00406860
push ecx
lea ecx, [ebp - 0x2010]
call fcn.00406800
lea ebx, [edi + 4]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [edi + 0x1c]
lea eax, [ebp - 0x2010]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputws]
push 2
push 0
push 0
push dword [edi + 0x1c]
mov dword [edi + 0x38], 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fseeki64]
push dword [edi + 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__ftelli64]
xor ecx, ecx
add esp, 0x1c
cmp ecx, edx
jg 0x406e74
jl 0x406da8
cmp dword [edi + 0x3c], eax
ja 0x406e74
push dword [edi + 0x1c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [edi + 0x1c], 0
xor eax, eax
mov dword [ebp - 0x2018], 7
lea esi, [edi + 0x20]
mov dword [ebp - 0x201c], 0
lea ecx, [ebp - 0x202c]
mov word [ebp - 0x202c], ax
push 0xffffffffffffffff
push eax
push esi
call fcn.00404c60
push 4
push str..bak
lea ecx, [ebp - 0x202c]
mov byte [ebp - 4], 1
call fcn.00404550
cmp dword [ebp - 0x2018], 8
lea eax, [ebp - 0x202c]
cmovae eax, dword [ebp - 0x202c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [ebp - 0x2018], 8
lea ecx, [ebp - 0x202c]
cmovae ecx, dword [ebp - 0x202c]
cmp dword [esi + 0x14], 8
jb 0x406e39
mov eax, dword [esi]
jmp 0x406e3b
mov eax, esi
push ecx
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__wrename]
add esp, 8
cmp dword [esi + 0x14], 8
jb 0x406e4e
mov esi, dword [esi]
push 0x20
push 0x4b1870
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfsopen]
add esp, 0xc
mov dword [edi + 0x1c], eax
lea ecx, [ebp - 0x202c]
mov dword [edi + 0x38], 0
call fcn.004041f0
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp - 4], 0xffffffff
or eax, 0xffffffff
mov edx, dword [ebp - 0x2014]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x406ea0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00439578
mov esp, ebp
pop ebp
ret