Function at 0x417388
Capabilities:
Check if file exists
Get common file path
Get file attributes
Get file size
Move file

Disassembly:
push ebx
push ebp
push esi
mov esi, dword [esp + 0x14]
push edi
push 5
push esi
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
je 0x4173a9
push 1
pop eax
jmp 0x41750e
mov eax, dword [0x500af8]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
mov dword [0x508020], eax
test esi, esi
mov ebp, 0x400
je 0x417412
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x41750c
xor ecx, ecx
push ecx
push eax
push 1
push ecx
push 1
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x4173f9
push eax
call ebx
test eax, eax
je 0x41750c
push ebp
push 0x508020
push esi
call edi
test eax, eax
je 0x41750c
cmp eax, ebp
jg 0x41750c
mov esi, 0x507820
push ebp
push esi
push dword [esp + 0x1c]
call edi
xor edi, edi
cmp eax, edi
je 0x41750c
cmp eax, ebp
jg 0x41750c
push esi
push 0x508020
push str._s_s_r_n
push 0x507c20
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov dword [esp + 0x14], eax
push 0x3f0
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x41750c
push str.wininit.ini
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
test eax, eax
je 0x41750c
push edi
push 0x8000080
push 4
push edi
push edi
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x41750c
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
je 0x417509
mov eax, dword [esp + 0x14]
xor esi, esi
push esi
lea eax, [edi + eax + 0xa]
push eax
push esi
push 4
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, esi
mov dword [esp + 0x18], eax
je 0x417509
push esi
push esi
push esi
push 2
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
test esi, esi
je 0x417503
push str._Rename__r_n
push esi
call dword [sym.imp.MSVCRT.dll__mbsstr]
pop ecx
test eax, eax
pop ecx
jne 0x41756a
lea eax, [esi + edi]
push str._Rename__r_n
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
test eax, eax
jne 0x417513
push esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [esp + 0x18]
call ebx
push ebp
call ebx
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
add edi, 0xa
mov eax, edi
push dword [esp + 0x14]
add eax, esi
push 0x507c20
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
push dword [esp + 0x18]
je 0x417507
call ebx
test eax, eax
je 0x417509
mov eax, dword [esp + 0x14]
xor esi, esi
push esi
add edi, eax
push esi
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
push ebp
je 0x41750a
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x4175a2
push ebp
call ebx
mov eax, esi
jmp 0x41750e
add eax, 0xa
push 0x500ad0
push eax
call dword [sym.imp.MSVCRT.dll__mbsstr]
pop ecx
test eax, eax
pop ecx
je 0x417516
lea ecx, [esi + edi]
inc eax
cmp ecx, eax
jb 0x41759b
mov ebx, dword [esp + 0x14]
mov dl, byte [ecx]
mov byte [ecx + ebx], dl
dec ecx
cmp ecx, eax
jae 0x417587
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
sub eax, esi
jmp 0x417518
push 1
pop esi
jmp 0x417563