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

Disassembly:
sub esp, 0x460
mov edx, dword [esp + 0x464]
push ebx
push ebp
xor ebx, ebx
push esi
push edi
test edx, edx
mov dword [esp + 0x10], ebx
je 0x40e07d
cmp byte [edx], 0
je 0x40e07d
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 0x40e07d
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.0040ce70
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.0040cdb0
mov esi, eax
add esp, 8
test esi, esi
jbe 0x40e055
lea edx, [esi + 0x64]
push edx
call fcn.0041b345
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x40e055
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 0x40e048
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 0x40e041
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.0041bb90
mov esi, eax
add esp, 8
test esi, esi
je 0x40e03d
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x20]
push edx
push eax
push esi
call fcn.00423630
add esp, 0xc
test eax, eax
jne 0x40e030
mov ecx, dword [esp + 0x18]
mov al, byte [esi + ecx + 1]
lea esi, [esi + ecx + 1]
cmp al, 0xd
jne 0x40dfac
inc esi
cmp byte [esi], 0xa
jne 0x40dfb2
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 0x42b590
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 0x40e031
inc esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40df67
mov ebx, dword [esp + 0x10]
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push ebp
call fcn.0041b272
add esp, 4
test ebx, ebx
jne 0x40e07d
lea edx, [esp + 0x60]
lea eax, [esp + 0x164]
push edx
push eax
push 0x42b590
push str.rename
call dword [sym.imp.KERNEL32.DLL_WritePrivateProfileStringA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x460
ret
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x460
ret