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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
push ebx
push esi
push 1
push 0x25
lea eax, [ebp - 0x22c]
push eax
xor ebx, ebx
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov eax, dword [0x422724]
push dword [eax + 0x124]
lea eax, [ebp - 0x22c]
push eax
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push ebx
push ebx
push 4
push ebx
push 1
push 0xc0000000
lea eax, [ebp - 0x22c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 4], esi
cmp esi, 0xffffffff
je 0x40d247
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 8], eax
call fcn.00403db0
mov edi, eax
mov dword [ebp - 0x24], edi
cmp edi, ebx
je 0x40d23d
push ebx
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d235
mov eax, dword [ebp - 8]
lea esi, [ebp - 8]
mov ecx, edi
call fcn.004139c9
mov dword [ebp - 0x14], eax
cmp eax, ebx
je 0x40d235
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
push 1
call fcn.00404753
mov dword [ebp - 0x18], eax
cmp eax, ebx
je 0x40d126
cmp byte [eax], 0x21
jne 0x40d045
inc eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 8], ebx
jbe 0x40d111
mov ecx, dword [ebp - 0x14]
lea eax, [ecx + eax*4]
mov dword [ebp - 0x20], eax
mov eax, dword [eax]
cmp eax, ebx
je 0x40d101
mov esi, eax
mov al, byte [esi]
cmp al, 0x20
je 0x40d072
cmp al, 9
jne 0x40d075
inc esi
jmp 0x40d068
mov al, byte [esi]
cmp al, 0x23
je 0x40d101
cmp al, 0xd
je 0x40d101
cmp al, 0xa
je 0x40d101
test al, al
je 0x40d101
jmp 0x40d09c
cmp al, 0x20
je 0x40d0a0
cmp al, 9
je 0x40d0a0
test al, al
je 0x40d101
inc esi
mov al, byte [esi]
cmp al, 9
jne 0x40d08d
cmp byte [esi], bl
je 0x40d101
mov al, byte [esi]
cmp al, 9
je 0x40d0ae
cmp al, 0x20
jne 0x40d0b1
inc esi
jmp 0x40d0a4
mov al, byte [esi]
cmp al, 0x23
je 0x40d101
cmp al, 0xd
je 0x40d101
cmp al, 0xa
je 0x40d101
test al, al
je 0x40d101
mov ecx, dword [ebp - 0x18]
call fcn.004044ae
mov edi, eax
push ecx
mov edx, edi
mov ecx, esi
call fcn.004044d4
test eax, eax
jne 0x40d101
mov al, byte [edi + esi]
cmp al, 0x20
je 0x40d0f2
cmp al, 0xd
je 0x40d0f2
cmp al, 0xa
je 0x40d0f2
cmp al, 0x23
je 0x40d0f2
test al, al
jne 0x40d101
mov eax, dword [ebp - 0x20]
push dword [eax]
call fcn.00403dc8
mov eax, dword [ebp - 0x20]
mov dword [eax], ebx
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x10], eax
cmp eax, dword [ebp - 8]
jb 0x40d053
mov ecx, dword [ebp - 0x1c]
push 2
call fcn.00404753
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jne 0x40d027
or dword [ebp - 0x10], 0xffffffff
push ebx
push ebx
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
xor edi, edi
cmp dword [ebp - 8], ebx
jbe 0x40d170
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + edi*4]
cmp ecx, ebx
je 0x40d16a
push ebx
lea eax, [ebp - 0xc]
push eax
mov dword [ebp - 0x10], edi
call fcn.004044ae
push eax
push ecx
push dword [ebp - 4]
call esi
inc edi
cmp edi, dword [ebp - 8]
jb 0x40d14c
mov ebx, dword [ebp + 8]
mov edi, 0x401e1c
push 1
mov ecx, ebx
call fcn.00404753
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40d221
cmp byte [eax], 0x21
je 0x40d20e
cmp ebx, dword [ebp + 8]
jne 0x40d1c5
mov eax, dword [ebp - 0x10]
cmp eax, 0xffffffff
je 0x40d1c5
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + eax*4]
call fcn.004044ae
mov dword [ebp - 0xc], eax
test eax, eax
je 0x40d1c5
cmp byte [ecx + eax - 1], 0xa
je 0x40d1c5
push 0
lea eax, [ebp - 0xc]
push eax
push 2
push edi
push dword [ebp - 4]
call esi
push 0
lea eax, [ebp - 0xc]
push eax
mov ecx, ebx
call fcn.004044ae
push eax
push ebx
push dword [ebp - 4]
call esi
push 0
lea eax, [ebp - 0xc]
push eax
push 1
push 0x401e20
push dword [ebp - 4]
call esi
mov ecx, dword [ebp - 0x18]
push 0
lea eax, [ebp - 0xc]
push eax
call fcn.004044ae
push eax
push ecx
push dword [ebp - 4]
call esi
push 0
lea eax, [ebp - 0xc]
push eax
push 2
push edi
push dword [ebp - 4]
call esi
push 2
mov ecx, ebx
call fcn.00404753
mov ebx, eax
test ebx, ebx
jne 0x40d178
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [ebp - 8]
mov edi, dword [ebp - 0x14]
call fcn.00403de4
push dword [ebp - 0x24]
call fcn.00403dc8
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebx
leave
ret 4