Function at 0x4051b0
Capabilities:
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x730
mov eax, dword [0x417174]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
test ebx, ebx
je 0x4051da
push 6
push ebx
call fcn.00401180
add esp, 8
cmp byte [0x417fac], 0
je 0x405227
test ebx, ebx
jne 0x405207
push 4
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
neg eax
sbb eax, eax
pop esi
neg eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040658e
mov esp, ebp
pop ebp
ret
push 5
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
neg eax
sbb eax, eax
pop esi
neg eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040658e
mov esp, ebp
pop ebp
ret
push 0x104
lea eax, [ebp - 0x518]
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
call esi
test ebx, ebx
je 0x40524f
push 0x104
lea eax, [ebp - 0x720]
push eax
push ebx
call esi
push edi
push 0x104
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea edi, [ebp - 0x20c]
add edi, 0xfffffffe
jmp 0x405270
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x405270
mov ecx, 6
mov esi, 0x410994
rep movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x518]
movsw word es:[edi], word [esi]
mov esi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push eax
test ebx, ebx
je 0x4052c4
lea eax, [ebp - 0x720]
push eax
push str.Rename
call esi
lea eax, [ebp - 0x20c]
push eax
push 0
push 0
push 0
call esi
jmp 0x40544d
push 0x4109c0
push str.Rename
call esi
lea eax, [ebp - 0x20c]
push eax
push 0
push 0
push 0
call esi
lea eax, [ebp - 0x20c]
push 0xc0000000
push eax
call fcn.00401270
mov ebx, eax
add esp, 8
mov dword [ebp - 0x72c], ebx
cmp ebx, 0xffffffff
je 0x40544d
lea ecx, [ebp - 0x518]
lea edx, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405310
push 0
push 0
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x310]
push eax
push ecx
lea eax, [ebp - 0x518]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push ebx
call fcn.00401200
mov esi, eax
lea eax, [ebp - 0x728]
push eax
lea ecx, [esi + 0x200]
push ecx
mov dword [ebp - 0x730], esi
call fcn.004028b0
add esp, 0xc
test eax, eax
je 0x405444
push esi
push dword [ebp - 0x728]
push ebx
call fcn.004012a0
add esp, 0xc
test eax, eax
jne 0x405435
mov edi, dword [ebp - 0x728]
lea eax, [esi - 4]
mov dword [ebp - 0x724], eax
test eax, eax
je 0x405435
mov ebx, 0xfffffffe
sub ebx, edi
mov ecx, eax
cmp byte [edi], 0x78
jne 0x405421
cmp byte [edi + 1], 0x79
jne 0x405421
cmp byte [edi + 2], 0x7a
jne 0x405421
cmp byte [edi + 3], 0x3d
jne 0x405421
lea eax, [ebp - 0x310]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4053c1
sub eax, edx
lea edx, [edi + 4]
lea esi, [ebp - 0x310]
sub eax, 4
jb 0x4053e9
mov ecx, dword [edx]
cmp ecx, dword [esi]
jne 0x4053ee
add edx, 4
add esi, 4
sub eax, 4
jae 0x4053d8
cmp eax, 0xfffffffc
je 0x405463
mov cl, byte [edx]
cmp cl, byte [esi]
jne 0x40541b
cmp eax, 0xfffffffd
je 0x405463
mov cl, byte [edx + 1]
cmp cl, byte [esi + 1]
jne 0x40541b
cmp eax, 0xfffffffe
je 0x405463
mov cl, byte [edx + 2]
cmp cl, byte [esi + 2]
jne 0x40541b
cmp eax, 0xffffffff
je 0x405463
mov al, byte [edx + 3]
cmp al, byte [esi + 3]
je 0x405463
mov ecx, dword [ebp - 0x724]
inc edi
lea eax, [ebx + 2]
add eax, edi
cmp eax, ecx
jb 0x4053a1
mov ebx, dword [ebp - 0x72c]
lea eax, [ebp - 0x728]
push eax
call fcn.00402930
add esp, 4
push ebx
call fcn.004011f0
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0040658e
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x72c]
push 0
push 0
push ebx
mov word [edi], 0x554e
mov byte [edi + 2], 0x4c
call fcn.00401370
push dword [ebp - 0x730]
push dword [ebp - 0x728]
push ebx
call fcn.004013a0
add esp, 0x18
jmp 0x405435