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

Disassembly:
sub esp, 0x518
push ebx
push ebp
push esi
mov esi, dword [esp + 0x528]
test esi, esi
push edi
je 0x403088
mov ebx, dword [esp + 0x530]
test ebx, ebx
je 0x403088
mov al, byte [0x41778c]
test al, al
jne 0x402e21
push 0x104
push 0x41778c
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push str.wininit.ini
push 0x41778c
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x119]
mov byte [esp + 0x118], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x21d]
mov byte [esp + 0x21c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x15]
mov byte [esp + 0x14], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x118]
push 0x104
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
call esi
test eax, eax
je 0x403088
lea ecx, [esp + 0x21c]
push 0x104
push ecx
push ebx
call esi
test eax, eax
je 0x403088
lea edx, [esp + 0x118]
lea eax, [esp + 0x21c]
push edx
push eax
push str._s_s_n
lea ecx, [esp + 0x20]
push 0x103
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
mov edi, dword [sym.imp.MSVCRT.dll_fopen]
push 0x4142f0
push 0x41778c
call edi
mov esi, eax
add esp, 0x1c
test esi, esi
jne 0x402efb
push 0x4142ec
push 0x41778c
call edi
mov esi, eax
add esp, 8
test esi, esi
je 0x403088
push esi
call dword [sym.imp.MSVCRT.dll_rewind]
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x325]
mov byte [esp + 0x324], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [sym.imp.MSVCRT.dll_fgets]
push esi
lea edx, [esp + 0x328]
push 0x208
push edx
call edi
add esp, 0x10
test eax, eax
je 0x402f7d
mov ebx, dword [sym.imp.MSVCRT.dll__strlwr]
mov ebp, dword [sym.imp.MSVCRT.dll_strstr]
lea eax, [esp + 0x320]
push eax
call ebx
lea ecx, [esp + 0x324]
push str._rename_
push ecx
call ebp
add esp, 0xc
test eax, eax
push esi
jne 0x402fb0
lea edx, [esp + 0x324]
push 0x208
push edx
call edi
add esp, 0xc
test eax, eax
jne 0x402f46
mov edi, dword [sym.imp.MSVCRT.dll_fputs]
push esi
push str._rename__n
call edi
lea eax, [esp + 0x1c]
push esi
push eax
call edi
add esp, 0x10
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x518
ret
mov edi, dword [sym.imp.MSVCRT.dll_ftell]
call edi
push 2
push 0
push esi
mov ebx, eax
call dword [sym.imp.MSVCRT.dll_fseek]
push esi
call edi
add esp, 0x14
cmp ebx, eax
jne 0x402ff8
lea ecx, [esp + 0x14]
push esi
push ecx
call dword [sym.imp.MSVCRT.dll_fputs]
add esp, 8
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x518
ret
sub eax, ebx
dec eax
mov edi, eax
push edi
mov dword [esp + 0x14], edi
call dword [sym.imp.MSVCRT.dll_malloc]
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x403088
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebp
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
push ebx
rep stosb byte es:[edi], al
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esp + 0x1c]
push esi
push eax
push 1
push ebp
call dword [sym.imp.MSVCRT.dll_fread]
push 0
push ebx
push esi
mov edi, eax
call dword [sym.imp.MSVCRT.dll_fseek]
lea ecx, [esp + 0x3c]
push esi
push ecx
call dword [sym.imp.MSVCRT.dll_fputs]
push esi
push 1
push edi
push ebp
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x40
push ebp
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x518
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x518
ret