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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5f1f06
mov eax, dword fs:[0]
push eax
mov eax, 0x1738
call fcn.00478eb0
mov eax, dword [0x67f4f4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1738], eax
mov dword [ebp - 0x1734], edi
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
jne 0x408792
xor eax, eax
jmp 0x408b93
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40878b
call fcn.00409110
mov ecx, eax
test ecx, ecx
je 0x408bae
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x1744], esi
push 0x208
lea eax, [ebp - 0x318]
mov dword [ebp - 4], 0
push 0
push eax
call fcn.0053dd00
push 0x208
lea eax, [ebp - 0x720]
push 0
push eax
call fcn.0053dd00
add esp, 0x18
lea eax, [ebp - 0x720]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [ebp - 0x720]
push eax
call fcn.005757a6
mov eax, dword [edi]
add esp, 4
cmp dword [eax - 0xc], 0
jl 0x408bb8
movzx eax, word [eax]
push eax
call fcn.00562d4e
movzx eax, ax
add esp, 4
cmp word [ebp - 0x720], ax
jne 0x408845
lea eax, [ebp - 0x318]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
jmp 0x4088a4
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
jl 0x408bc2
movzx eax, word [eax]
lea ecx, [ebp - 0x1739]
push eax
call fcn.00408250
push eax
lea eax, [ebp - 0x318]
push 0x104
push eax
call fcn.00409cf0
add esp, 0x10
lea eax, [ebp - 0x318]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4088a4
lea eax, [ebp - 0x318]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push 2
lea eax, [ebp - 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea eax, [ebp - 0x318]
push eax
lea ecx, [ebp - 0x1740]
call fcn.00407f10
mov edi, dword [ebp - 0x1740]
mov byte [ebp - 4], 1
cmp dword [edi - 0xc], 0x104
jg 0x408a7e
push 0x800
lea eax, [ebp - 0x1720]
push 0
push eax
call fcn.0053dd00
push 0x800
lea eax, [ebp - 0xf20]
push 0
push eax
call fcn.0053dd00
push edi
lea eax, [ebp - 0x1720]
push 0x400
push eax
call fcn.00561957
push 0xfe
lea eax, [ebp - 0x10e]
push 0
push eax
call fcn.0053dd00
add esp, 0x30
xor edi, edi
nop dword [eax]
xor eax, eax
xorps xmm0, xmm0
mov word [ebp - 0x110], ax
lea eax, [ebp - 0x1730]
push eax
movups xmmword [ebp - 0x1730], xmm0
call dword [sym.imp.ole32.dll_CoCreateGuid]
push 0x200
lea eax, [ebp - 0x518]
push 0
push eax
call fcn.0053dd00
movzx eax, byte [ebp - 0x1721]
push eax
movzx eax, byte [ebp - 0x1722]
push eax
movzx eax, byte [ebp - 0x1723]
push eax
movzx eax, byte [ebp - 0x1724]
push eax
movzx eax, byte [ebp - 0x1725]
push eax
movzx eax, byte [ebp - 0x1726]
push eax
movzx eax, byte [ebp - 0x1727]
push eax
movzx eax, byte [ebp - 0x1728]
push eax
movzx eax, word [ebp - 0x172a]
push eax
movzx eax, word [ebp - 0x172c]
push eax
push dword [ebp - 0x1730]
lea eax, [ebp - 0x518]
push str._08X__04X__04x__02X_02X__02X_02X_02X_02X_02X_02X
push eax
call fcn.00407ee0
lea eax, [ebp - 0x518]
add esp, 0x40
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4089c6
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x518]
push eax
lea eax, [ebp - 0x110]
push 0x80
push eax
call fcn.00561a89
add esp, 0x10
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x1720]
push eax
lea eax, [ebp - 0xf20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push str..tmp
lea eax, [ebp - 0xf20]
push 0x400
push eax
call fcn.00561884
add esp, 0xc
lea eax, [ebp - 0xf20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x408a42
inc edi
cmp edi, 0xa
jl 0x408920
jmp 0x408a78
lea ecx, [ebp - 0xf20]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x408a50
sub ecx, edx
lea eax, [ebp - 0xf20]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x1744]
call fcn.004098e0
mov esi, dword [ebp - 0x1744]
mov edi, dword [ebp - 0x1740]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 0
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x408a9c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x1734]
push esi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x408adb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp - 0x1734]
push esi
push dword [eax]
push str.move__s_to__s__failed__error_d
call fcn.004302a0
add esp, 0x10
mov dword [ebp - 0x1738], 0
jmp 0x408b71
mov eax, dword [ebp - 0x1734]
push dword [eax]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x408b02
push esi
call fcn.00409a10
add esp, 4
mov dword [ebp - 0x1738], 0
jmp 0x408b71
mov edx, dword [ebp - 0x1738]
lea ecx, [esi - 0x10]
mov edi, dword [edx]
sub edi, 0x10
cmp ecx, edi
je 0x408b64
cmp dword [edi + 0xc], 0
jl 0x408b59
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x408b59
push ecx
call fcn.00408620
add esp, 4
mov dword [ebp - 0x1734], eax
or ecx, 0xffffffff
lea edx, [edi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408b4c
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1734]
mov ecx, dword [ebp - 0x1738]
add eax, 0x10
mov dword [ecx], eax
jmp 0x408b64
push dword [esi - 0xc]
mov ecx, edx
push esi
call fcn.004098e0
mov dword [ebp - 0x1738], 1
or edi, 0xffffffff
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x408b8d
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1738]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00478a88
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.004084c0
push 0x80070057
call fcn.004084c0
push 0x80070057
call fcn.004084c0
int3