Function at 0x401840
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x234
mov eax, dword [0x49b3e4]
xor eax, esp
mov dword [esp + 0x230], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x401885
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x230]
xor ecx, esp
call fcn.00457d74
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x40186b
call fcn.00401410
test eax, eax
je 0x401b7c
mov edx, dword [eax]
cmp edx, vtable.ATL::CAtlStringMgr.0
jne 0x401b86
lock inc dword [eax + 0x14]
add eax, 8
add eax, 0x10
push 0x208
mov dword [esp + 0x20], eax
lea eax, [esp + 0x34]
push 0
push eax
call fcn.00459940
add esp, 0xc
lea eax, [esp + 0x30]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov edx, eax
test edx, edx
jne 0x4018ee
xor ecx, ecx
jmp 0x401902
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4018f3
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [esp + 0x24]
call fcn.004027a0
call fcn.00401410
test eax, eax
je 0x401b90
mov edx, dword [eax]
cmp edx, vtable.ATL::CAtlStringMgr.0
jne 0x401b9a
lock inc dword [eax + 0x14]
add eax, 8
add eax, 0x10
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], eax
xorps xmm0, xmm0
lea eax, [esp + 0x20]
movq qword [esp + 0x24], xmm0
push eax
mov dword [esp + 0x30], 0
call dword [sym.imp.ole32.dll_CoCreateGuid]
lea eax, [esp + 0x28]
push eax
movzx eax, word [esp + 0x2a]
push eax
movzx eax, word [esp + 0x2c]
push eax
push dword [esp + 0x2c]
lea eax, [esp + 0x28]
push str._u__u__u__u
push eax
call fcn.00402ae0
add esp, 0x18
call fcn.00401410
test eax, eax
je 0x401ba4
mov edx, dword [eax]
cmp edx, vtable.ATL::CAtlStringMgr.0
jne 0x401bae
lock inc dword [eax + 0x14]
add eax, 8
mov edi, dword [esp + 0x18]
add eax, 0x10
push edi
push dword [esp + 0x20]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x18]
push str._s._s.del
push eax
call fcn.00402ae0
mov esi, dword [esp + 0x20]
lea eax, [esp + 0x40]
add esp, 0x10
push esi
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
push 1
lea eax, [esp + 0x34]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov dword [esp + 0x14], eax
test eax, eax
jne 0x401a56
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x11
jne 0x401a56
movzx eax, word [ebx]
push edi
push eax
lea eax, [esp + 0x18]
push str._c:_s.del
push eax
call fcn.00402ae0
mov esi, dword [esp + 0x20]
add esp, 0x10
push 1
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov dword [esp + 0x14], eax
test eax, eax
je 0x401a56
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401a3e
test al, 1
jne 0x401a3e
or eax, 2
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push esi
push 0x490ebc
lea eax, [esp + 0x38]
push 0x104
push eax
call fcn.004036c0
add esp, 0x10
cmp dword [esp + 0x14], 0
lea eax, [esp + 0x30]
push 4
push 0
cmove eax, ebx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
or ebx, 0xffffffff
mov dword [esp + 0x10], eax
add esi, 0xfffffff0
mov ecx, ebx
lock xadd dword [esi + 0xc], ecx
dec ecx
mov edx, dword [sym.imp.KERNEL32.dll_HeapFree]
test ecx, ecx
jg 0x401acc
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edi, dword [eax + 4]
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x1c]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x401bc1
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov edi, dword [eax + 4]
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x1c]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x401bb8
push 0
push dword [ecx + 4]
call edx
mov edx, dword [sym.imp.KERNEL32.dll_HeapFree]
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x401b08
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x401bca
mov ecx, dword [ecx + 4]
mov eax, dword [ecx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x401bca
push 0
push dword [ecx + 4]
call edx
mov ecx, dword [esp + 0x1c]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x401b63
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x401bd1
mov edx, dword [edx + 4]
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CWin32Heap.0
jne 0x401bd1
push 0
push dword [edx + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x230]
xor ecx, esp
call fcn.00457d74
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x23c]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00457d74
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.004012a0
mov ecx, eax
call dword [edx + 0xc]
jmp 0x4018b2
push 0x80004005
call fcn.004012a0
mov ecx, eax
call dword [edx + 0xc]
jmp 0x40192f
push 0x80004005
call fcn.004012a0
mov ecx, eax
call dword [edx + 0xc]
jmp 0x4019a3
call dword [esp + 0x18]
jmp 0x401ac6
call dword [esp + 0x18]
jmp 0x401ac6
call esi
jmp 0x401b08
mov ecx, edx
call esi
jmp 0x401b63