Function at 0x411f70
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x460
push ebx
push ebp
push esi
mov esi, dword [esp + 0x474]
xor ebx, ebx
push edi
mov ecx, esi
mov dword [esp + 0x10], ebx
call fcn.0040b440
mov edx, dword [esp + 0x474]
test edx, edx
je 0x4121ed
cmp byte [edx], 0
je 0x4121ed
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x165]
mov byte [esp + 0x164], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x164]
push 0x104
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
test eax, eax
je 0x4121cb
lea ecx, [esp + 0x60]
push 0x104
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea edx, [esp + 0x60]
push 0x104
push edx
call fcn.0040dd40
add esp, 8
lea eax, [esp + 0x60]
push str.Wininit.ini
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x60]
push ebx
push ecx
call fcn.0040dc80
mov esi, eax
add esp, 8
test esi, esi
jbe 0x4121a3
lea edx, [esi + 0x64]
push edx
call fcn.004205ed
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x4121a3
push ebx
push 0x80
push 4
push ebx
push ebx
lea eax, [esp + 0x74]
push 0xc0000000
push eax
mov byte [ebp], bl
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x412196
lea ecx, [esp + 0x1c]
push ebx
push ecx
push esi
push ebp
push edi
mov dword [esp + 0x30], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x1c]
cmp eax, esi
jne 0x41218f
push str.rename
lea edx, [esp + 0x24]
push str.__s_
push edx
mov byte [eax + ebp], bl
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x18], eax
mov esi, ebp
movsx ecx, byte [esp + 0x20]
push ecx
push esi
call fcn.00420be0
mov esi, eax
add esp, 8
test esi, esi
je 0x41218b
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x20]
push edx
push eax
push esi
call fcn.0042a2d0
add esp, 0xc
test eax, eax
jne 0x41217e
mov ecx, dword [esp + 0x18]
mov al, byte [esi + ecx + 1]
lea esi, [esi + ecx + 1]
cmp al, 0xd
jne 0x4120fa
inc esi
cmp byte [esi], 0xa
jne 0x412100
inc esi
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, esi
lea edx, [esp + 0x14]
push 0
sub eax, ebp
push edx
push eax
push ebp
push edi
call ebx
lea ecx, [esp + 0x164]
lea edx, [esp + 0x268]
push ecx
push 0x43b970
push str._s_s_r_n
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [esp + 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x270]
push eax
push edx
push edi
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
push esi
push edi
call ebx
mov dword [esp + 0x10], 1
jmp 0x41217f
inc esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4120b5
mov ebx, dword [esp + 0x10]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.004203d7
add esp, 4
test ebx, ebx
jne 0x4121f9
lea edx, [esp + 0x60]
lea eax, [esp + 0x164]
push edx
push eax
push 0x43b970
push str.rename
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x460
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetShortPathName_failed__err__d_
push esi
call fcn.0040c040
add esp, 0xc
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x460
ret
push str.NULL_Empty_filespec
mov ecx, esi
call fcn.0040b700
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x460
ret