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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x93c
mov eax, dword [0x46b0b4]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x104
lea eax, [ebp - 0x108]
mov dword [ebp - 0x934], edx
push 0
push eax
mov dword [ebp - 0x930], ecx
call fcn.0042fef0
add esp, 0xc
lea eax, [ebp - 0x108]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
jne 0x404079
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042d012
mov esp, ebp
pop ebp
ret
push ebx
push esi
push edi
push ecx
lea eax, [ebp - 0x92c]
mov esi, 0x104
push eax
mov edx, esi
lea ecx, [ebp - 0x108]
call fcn.00403ea0
test eax, eax
js 0x4040ba
sub esi, dword [ebp - 0x92c]
push ecx
push str.WinInit.Ini
push ecx
lea ecx, [ebp - 0x108]
mov edx, esi
add ecx, dword [ebp - 0x92c]
call fcn.00403f10
push 0
push 0x8000080
push 4
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4040e7
xor ebx, ebx
jmp 0x404207
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
test ebx, ebx
je 0x404188
xor esi, esi
lea eax, [ebx + 1]
xor ecx, ecx
ja 0x4042c8
jb 0x404112
cmp eax, 0xffffffff
ja 0x4042c8
push eax
call fcn.00435775
mov esi, eax
add esp, 4
test esi, esi
je 0x4042c8
push 0
lea eax, [ebp - 0x92c]
mov dword [ebp - 0x92c], 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4042c8
mov eax, dword [ebp - 0x92c]
push str._Rename_
push esi
mov byte [eax + esi], 0
call fcn.0042f650
add esp, 8
test eax, eax
jne 0x404221
push str._rename_
push esi
call fcn.0042f650
add esp, 8
test eax, eax
jne 0x404221
push esi
call fcn.004353e2
add esp, 4
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x410
lea eax, [ebp - 0x928]
push 0
push eax
call fcn.0042fef0
push dword [ebp - 0x930]
lea eax, [ebp - 0x928]
push dword [ebp - 0x934]
push str._r_n_rename__r_n_s_s_r_n
push 0x410
push eax
call fcn.00403fa0
lea ecx, [ebp - 0x928]
mov dword [ebp - 0x93c], 0
add esp, 0x20
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4041e0
push 0
lea eax, [ebp - 0x93c]
sub ecx, edx
push eax
push ecx
lea eax, [ebp - 0x928]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebx, eax
test edi, edi
je 0x40420e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042d012
mov esp, ebp
pop ebp
ret
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x410
lea eax, [ebp - 0x518]
push 0
push eax
call fcn.0042fef0
add esp, 0xc
lea eax, [ebp - 0x518]
cmp byte [esi + ebx - 1], 0xa
push dword [ebp - 0x930]
push dword [ebp - 0x934]
jne 0x404264
push str._s_s_r_n
jmp 0x404269
push str._r_n_s_s_r_n
push 0x410
push eax
call fcn.00403fa0
lea ecx, [ebp - 0x518]
mov dword [ebp - 0x938], 0
add esp, 0x14
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404290
push 0
lea eax, [ebp - 0x938]
sub ecx, edx
push eax
push ecx
lea eax, [ebp - 0x518]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4042c8
push esi
mov ebx, 1
call fcn.004353e2
add esp, 4
jmp 0x404203
push esi
xor ebx, ebx
call fcn.004353e2
add esp, 4
jmp 0x404203