Function at 0x40c370
Capabilities:
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
lea ecx, [esp + 0x44]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], 1
call fcn.00425b97
lea ecx, [esp + 0x30]
call fcn.004263dd
add esi, 0x16c
push str.rgf.bak
lea eax, [esp + 0x20]
push esi
push eax
mov dword [esp + 0x30], esi
call fcn.0040de20
push str.rgf.bak2
lea eax, [esp + 0x30]
push esi
push eax
call fcn.0040de20
mov edi, dword [esp + 0x34]
add esp, 0x18
lea ecx, [esp + 0x30]
push ebx
push 0x1002
push edi
call fcn.004268d4
mov esi, dword [esp + 0x20]
or edx, 0xffffffff
test eax, eax
je 0x40c5e6
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea ecx, [esp + 0x30]
call fcn.004266a8
push str.temp147
push dword [esp + 0x28]
lea eax, [esp + 0x2c]
push eax
call fcn.0040de20
add esp, 0xc
lea ecx, [esp + 0x44]
push 0
push dword [eax]
call fcn.00425dde
mov edx, dword [esp + 0x24]
test eax, eax
setne byte [esp + 0x13]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c446
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [esp + 0x13], bl
je 0x40c5d8
lea ecx, [esp + 0x44]
call fcn.00425f84
lea ecx, [esp + 0x44]
mov dword [esp + 0x2c], eax
call fcn.00426322
test eax, eax
jne 0x40c5c4
mov edx, dword [esp + 0x44]
push 0x10
lea ecx, [esp + 0x48]
call dword [edx + 0x38]
test eax, eax
je 0x40c497
push ecx
push esp
lea ecx, [esp + 0x4c]
call fcn.00426083
call fcn.00417930
add esp, 4
jmp 0x40c5c4
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x48]
call fcn.00426083
push dword [eax]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [esp + 0x24]
test eax, eax
sete byte [esp + 0x13]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c4d2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [esp + 0x13], 0
je 0x40c5c4
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_CreateHardLinkW]
test eax, eax
je 0x40c513
lea eax, [esp + 0x20]
or ebx, 1
push eax
lea ecx, [esp + 0x48]
mov dword [esp + 0x18], ebx
call fcn.00426083
push 1
push dword [eax]
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x40c513
xor bl, bl
jmp 0x40c515
mov bl, 1
mov eax, dword [esp + 0x14]
test al, 1
je 0x40c542
mov edx, dword [esp + 0x20]
and eax, 0xfffffffe
add edx, 0xfffffff0
mov dword [esp + 0x14], eax
lea eax, [edx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c542
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
je 0x40c58c
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x48]
call fcn.00426083
push 4
push 0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov edx, dword [esp + 0x1c]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c585
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
or dword [esp + 0x18], 2
jmp 0x40c5c0
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x48]
call fcn.00426083
push dword [eax]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edx, dword [esp + 0x28]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c5c0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ebx, dword [esp + 0x14]
cmp dword [esp + 0x2c], 0
jne 0x40c450
lea ecx, [esp + 0x44]
call fcn.00425d92
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ebx, dword [esp + 0x18]
or edx, 0xffffffff
add esi, 0xfffffff0
mov ecx, edx
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40c602
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
or edx, 0xffffffff
add edi, 0xfffffff0
lea eax, [edi + 0xc]
lock xadd dword [eax], edx
dec edx
test edx, edx
jg 0x40c619
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
lea ecx, [esp + 0x30]
call fcn.00426453
lea ecx, [esp + 0x44]
call fcn.00425d42
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret