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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x628
mov eax, dword [0x41b050]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [str._rename_]
mov ecx, dword [0x4139c4]
mov dl, byte [0x4139c8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
push 0x103
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x113]
push 0
push eax
mov dword [ebp - 0x624], 0xffffffff
mov dword [ebp - 0xc], ecx
mov byte [ebp - 8], dl
mov byte [ebp - 0x114], 0
call fcn.00403140
mov edi, dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x114]
push ecx
push esi
call edi
test eax, eax
jne 0x40207a
test ebx, ebx
jne 0x402063
push eax
push 0x80
push 1
push eax
push eax
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x40203c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x104
lea edx, [ebp - 0x114]
push edx
push esi
call edi
test eax, eax
jne 0x40207a
lea ecx, [ebp - 0x114]
sub ecx, esi
mov al, byte [esi]
mov byte [ecx + esi], al
inc esi
test al, al
jne 0x402057
jmp 0x40207a
lea ecx, [ebp - 0x114]
sub ecx, esi
jmp 0x402070
mov al, byte [esi]
mov byte [ecx + esi], al
inc esi
test al, al
jne 0x402070
push 0x400
lea eax, [ebp - 0x618]
push 0
push eax
call fcn.00403140
add esp, 0xc
test ebx, ebx
jne 0x4020ae
lea ecx, [ebp - 0x114]
push ecx
push 0x4139bc
push str._hs_hs
lea edx, [ebp - 0x618]
push edx
jmp 0x4020c2
lea eax, [ebp - 0x114]
push eax
push ebx
push str._hs_hs
lea ecx, [ebp - 0x618]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [ebp - 0x618]
add esp, 0x10
push edx
call fcn.00403d20
add esp, 4
push 0x104
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea eax, [ebp - 0x218]
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4020f3
mov ecx, dword [str.wininit.ini]
mov edx, dword [0x4139a8]
push 0
push 0x80
mov dword [eax], ecx
mov ecx, dword [0x4139ac]
push 4
mov dword [eax + 4], edx
mov dl, byte [0x4139b0]
push 0
mov dword [eax + 8], ecx
push 0
mov byte [eax + 0xc], dl
push 0xc0000000
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x628], edi
cmp edi, 0xffffffff
je 0x40240f
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x402408
lea ebx, [esi + 1]
push ebx
mov dword [ebp - 0x61c], 0
call fcn.00402693
push ebx
push 0
push eax
mov dword [ebp - 0x620], eax
call fcn.00403140
lea eax, [esi + 0x1000]
push eax
call fcn.00402693
mov ebx, eax
lea eax, [esi + 0x1000]
push eax
push 0
push ebx
call fcn.00403140
mov edx, dword [ebp - 0x620]
add esp, 0x20
push 0
lea ecx, [ebp - 0x61c]
push ecx
push esi
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4023ed
cmp dword [ebp - 0x61c], esi
jne 0x4023ed
mov esi, dword [ebp - 0x620]
mov edx, ebx
mov eax, esi
sub edx, esi
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4021e0
push esi
call fcn.00403d20
lea eax, [ebp - 0x10]
push eax
push esi
call fcn.004032b0
add esp, 0xc
test eax, eax
je 0x4022ed
inc eax
push 0x5b
push eax
call fcn.00403a90
add esp, 8
test eax, eax
je 0x4022ab
mov ecx, eax
sub ecx, esi
mov byte [ecx + ebx], 0
lea ecx, [ebp - 0x618]
mov esi, ecx
lea esp, [esp]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x402230
sub ecx, esi
mov edx, ecx
lea edi, [ebx - 1]
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402240
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebx - 1]
lea esp, [esp]
mov dl, byte [ecx + 1]
inc ecx
test dl, dl
jne 0x402260
mov dx, word [0x4139a0]
mov word [ecx], dx
mov dl, byte [0x4139a2]
mov byte [ecx + 2], dl
mov esi, eax
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402280
sub eax, esi
lea edi, [ebx - 1]
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402290
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40238b
lea eax, [ebp - 0x618]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4022b3
sub eax, esi
lea edi, [ebx - 1]
nop
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4022c0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
lea esp, [esp]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4022e0
jmp 0x402378
lea eax, [ebp - 0x10]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4022f2
sub eax, esi
lea edi, [ebx - 1]
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402300
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
lea esp, [esp]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x402320
mov cx, word [0x4139a0]
mov word [eax], cx
mov dl, byte [0x4139a2]
mov byte [eax + 2], dl
lea eax, [ebp - 0x618]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402343
sub eax, esi
lea edi, [ebx - 1]
nop
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x402350
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebx - 1]
lea esp, [esp]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x402370
mov cx, word [0x4139a0]
mov word [eax], cx
mov dl, byte [0x4139a2]
mov byte [eax + 2], dl
mov eax, ebx
mov dword [ebp - 0x61c], 0
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4023a0
mov esi, dword [ebp - 0x628]
push 0
push 0
push 0
sub eax, edx
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [ebp - 0x61c]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4023ed
cmp dword [ebp - 0x61c], edi
jne 0x4023ed
mov dword [ebp - 0x624], 0
push ebx
call fcn.00402483
mov ecx, dword [ebp - 0x620]
push ecx
call fcn.00402483
mov edi, dword [ebp - 0x628]
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x624]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040248e
mov esp, ebp
pop ebp
ret