Function at 0x40b066
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 0x40b087
push 1
pop eax
jmp 0x40b1ec
mov eax, dword [0x422864]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
mov dword [0x4233e8], eax
test esi, esi
mov ebp, 0x400
je 0x40b0f0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov edx, eax
xor ecx, ecx
inc edx
push ecx
neg edx
sbb edx, edx
and edx, eax
push edx
push 1
push ecx
push 1
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x40b0d7
push eax
call ebx
test eax, eax
je 0x40b1ea
push ebp
push 0x4233e8
push esi
call edi
test eax, eax
je 0x40b1ea
cmp eax, ebp
jg 0x40b1ea
mov esi, 0x422be8
push ebp
push esi
push dword [esp + 0x1c]
call edi
xor edi, edi
cmp eax, edi
je 0x40b1ea
cmp eax, ebp
jg 0x40b1ea
push esi
push 0x4233e8
push str._s_s_r_n
push 0x422fe8
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 0x40b1ea
push str.wininit.ini
push esi
call dword [sym.imp.KERNEL32.dll_lstrcatA]
test eax, eax
je 0x40b1ea
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 0x40b1ea
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
je 0x40b1e7
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 0x40b1e7
push esi
push esi
push esi
push 2
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
test esi, esi
je 0x40b1e1
push str._Rename__r_n
push esi
call dword [sym.imp.MSVCRT.dll__mbsstr]
pop ecx
test eax, eax
pop ecx
jne 0x40b248
lea eax, [esi + edi]
push str._Rename__r_n
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
test eax, eax
jne 0x40b1f1
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 0x422fe8
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 0x40b1e5
call ebx
test eax, eax
je 0x40b1e7
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 0x40b1e8
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x40b280
push ebp
call ebx
mov eax, esi
jmp 0x40b1ec
add eax, 0xa
push 0x42283c
push eax
call dword [sym.imp.MSVCRT.dll__mbsstr]
pop ecx
test eax, eax
pop ecx
je 0x40b1f4
lea ecx, [esi + edi]
inc eax
cmp ecx, eax
jb 0x40b279
mov ebx, dword [esp + 0x14]
mov dl, byte [ecx]
mov byte [ecx + ebx], dl
dec ecx
cmp ecx, eax
jae 0x40b265
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
sub eax, esi
jmp 0x40b1f6
push 1
pop esi
jmp 0x40b241