Function at 0x40d555
Capabilities:
Check if file exists
Delete file
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x618
push ebx
push esi
push edi
xor ebx, ebx
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x30a]
mov word [ebp - 0x30c], bx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov esi, 0x104
lea eax, [ebp - 0x30c]
push esi
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
jne 0x40d5a6
push esi
lea eax, [ebp - 0x30c]
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
cmp dword [ebp + 0xc], ebx
je 0x40d5c4
lea eax, [ebp - 0x30c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x40d5c4
push 1
pop eax
jmp 0x40d80a
lea eax, [ebp - 0x30c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d5bc
call fcn.0041414c
test eax, eax
je 0x40d606
lea eax, [ebp - 0x30c]
push eax
call fcn.0040d815
pop ecx
lea eax, [ebp - 0x30c]
push 4
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
neg eax
sbb eax, eax
neg eax
jmp 0x40d80a
cmp byte [0x45d338], bl
jne 0x40d627
mov edi, 0x45d338
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x458598
push edi
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x103]
mov byte [ebp - 0x104], bl
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x40f]
mov byte [ebp - 0x410], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x30c]
test eax, eax
jne 0x40d661
xor edi, edi
jmp 0x40d69c
lea eax, [ebp - 0x30c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea esi, [eax + eax + 2]
mov eax, esi
add eax, 3
and al, 0xfc
call fcn.0042d380
mov edi, esp
push ebx
push ebx
push esi
push edi
lea eax, [ebp - 0x30c]
push 0xffffffffffffffff
push eax
push ebx
push ebx
mov byte [edi], bl
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, 0x104
lea eax, [ebp - 0x104]
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
je 0x40d808
lea eax, [ebp - 0x104]
test eax, eax
jne 0x40d6c1
xor edi, edi
jmp 0x40d6f6
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
inc esi
lea eax, [esi + esi]
add eax, 3
and al, 0xfc
call fcn.0042d380
mov edi, esp
push esi
push edi
lea eax, [ebp - 0x104]
push 0xffffffffffffffff
push eax
push ebx
push ebx
mov word [edi], bx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push edi
call fcn.0040d815
lea eax, [ebp - 0x104]
push eax
push str.NUL_s_n
lea eax, [ebp - 0x410]
push 0x103
push eax
call dword [sym.imp.MSVCRT.dll__snprintf]
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x45858c
push 0x45d338
call edi
mov esi, eax
add esp, 0x1c
cmp esi, ebx
jne 0x40d74d
push 0x458588
push 0x45d338
call edi
mov esi, eax
pop ecx
cmp esi, ebx
pop ecx
je 0x40d808
push esi
call dword [sym.imp.MSVCRT.dll_rewind]
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x617]
mov byte [ebp - 0x618], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [sym.imp.MSVCRT.dll_fgets]
push esi
lea eax, [ebp - 0x618]
push 0x208
push eax
call edi
add esp, 0x10
test eax, eax
je 0x40d7c3
lea eax, [ebp - 0x618]
push eax
call dword [sym.imp.MSVCRT.dll__strlwr]
lea eax, [ebp - 0x618]
mov dword [esp], str._rename_
push eax
call dword [sym.imp.MSVCRT.dll_strstr]
pop ecx
test eax, eax
pop ecx
jne 0x40d7e0
push esi
lea eax, [ebp - 0x618]
push 0x208
push eax
call edi
add esp, 0xc
jmp 0x40d784
mov edi, dword [sym.imp.MSVCRT.dll_fputs]
push esi
push str._rename__n
call edi
lea eax, [ebp - 0x410]
push esi
push eax
call edi
add esp, 0x10
jmp 0x40d7fb
push 2
push ebx
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
lea eax, [ebp - 0x410]
push esi
push eax
call dword [sym.imp.MSVCRT.dll_fputs]
add esp, 0x14
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
jmp 0x40d5bc
xor eax, eax
lea esp, [ebp - 0x624]
pop edi
pop esi
pop ebx
leave
ret