Function at 0x40e7c3
Capabilities:
Check if file exists
Clear file content
Delete file
Get file attributes
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x46c
mov eax, dword [0x421148]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x422c94]
and dword [ebp - 0x460], 0
push ebx
push esi
push edi
mov edi, edx
mov dword [ebp - 0x45c], eax
xor ebx, ebx
call fcn.0041cbed
xor esi, esi
inc esi
cmp byte [ebp + 8], bl
je 0x40e82f
push 3
pop esi
push dword [0x422800]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40e82f
test eax, 0x4000
je 0x40e82f
push ebx
push 0x80
push 2
push dword [edi]
push dword [0x422800]
call dword [sym.imp.ADVAPI32.dll_DuplicateEncryptionInfoFile]
push dword [edi]
call dword [sym.imp.api_ms_win_core_shlwapi_legacy_l1_1_0.dll_PathFileExistsW]
push 0
push 0x80
push 4
push 0
push esi
push 0xc0000000
push dword [edi]
mov dword [ebp - 0x464], eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
mov dword [0x421cc0], eax
cmp eax, 0xffffffff
jne 0x40e880
cmp byte [ebp + 8], bl
jne 0x40e874
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 5
je 0x40eae6
mov ecx, dword [edi]
call fcn.0040f81b
jmp 0x40eae6
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
xor ecx, ecx
cmp eax, 0xb7
setne cl
mov dword [ebp - 0x468], ecx
cmp dword [0x422a78], ebx
je 0x40e8a3
call fcn.0040e73e
xor esi, esi
push esi
push esi
push 0xe
push dword [0x422c8c]
call dword [sym.imp.USER32.dll_SendMessageW]
push esi
push esi
push 0xbd
push dword [0x422c8c]
mov dword [ebp - 0x454], eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov esi, eax
test esi, esi
je 0x40ea96
push esi
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalLock]
mov dword [ebp - 0x44c], eax
test eax, eax
je 0x40ea96
mov ecx, dword [0x421ccc]
lea eax, [ecx - 1]
sub eax, 1
je 0x40ea46
sub eax, 1
je 0x40e9d2
sub eax, 1
jne 0x40e92e
push eax
lea eax, [ebp - 0x458]
push eax
push 3
push 0x421254
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
mov ecx, dword [0x421ccc]
cmp ecx, 4
je 0x40e94b
cmp ecx, 5
je 0x40e94b
call dword [sym.imp.api_ms_win_core_localization_l1_2_0.dll_GetACP]
lea ecx, [ebp - 0x460]
mov ebx, 0x400
jmp 0x40e954
xor ecx, ecx
mov eax, 0xfde9
xor ebx, ebx
push ecx
push 0
push 0
push 0
push dword [ebp - 0x454]
mov dword [ebp - 0x450], eax
push dword [ebp - 0x44c]
push ebx
push eax
call dword [sym.imp.api_ms_win_core_string_l1_1_0.dll_WideCharToMultiByte]
cmp dword [ebp - 0x460], 0
mov edx, eax
jne 0x40e98e
mov eax, dword [ebp - 0x454]
test eax, eax
je 0x40e9ba
test edx, edx
jne 0x40e9ba
mov edx, dword [0x421220]
mov ecx, dword [ebp - 0x45c]
push 0x31
push dword [edi]
push dword [0x4211d0]
call fcn.0040cf46
cmp eax, 2
je 0x40ea9d
mov eax, dword [ebp - 0x454]
xor ebx, ebx
mov edx, dword [ebp - 0x450]
push eax
push dword [ebp - 0x44c]
push ebx
call fcn.0040e68d
jmp 0x40ea86
push 0
lea eax, [ebp - 0x458]
push eax
push 2
push 0x42124c
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
mov edx, dword [ebp - 0x44c]
mov ecx, edx
push dword [ebp - 0x454]
call fcn.0040e65b
push 0
lea eax, [ebp - 0x458]
push eax
mov eax, dword [ebp - 0x454]
add eax, eax
push eax
push dword [ebp - 0x44c]
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
mov edx, dword [ebp - 0x44c]
mov ecx, edx
push dword [ebp - 0x454]
mov dword [ebp - 0x45c], eax
call fcn.0040e65b
mov eax, dword [ebp - 0x45c]
jmp 0x40ea86
push 0
lea eax, [ebp - 0x458]
push eax
push 2
push 0x421250
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
push 0
lea eax, [ebp - 0x458]
push eax
mov eax, dword [ebp - 0x454]
add eax, eax
push eax
push dword [ebp - 0x44c]
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
jne 0x40eaf9
push dword [0x421dcc]
call dword [sym.imp.USER32.dll_SetCursor]
mov ecx, dword [edi]
call fcn.0040f81b
push dword [0x421dcc]
call dword [sym.imp.USER32.dll_SetCursor]
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
or dword [0x421cc0], 0xffffffff
test esi, esi
je 0x40eac7
push esi
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalUnlock]
cmp dword [ebp - 0x468], 0
je 0x40ead8
push dword [edi]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_DeleteFileW]
cmp dword [0x422a78], 0
je 0x40eae6
call fcn.0040e789
xor al, al
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041fb30
leave
ret 8
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetEndOfFile]
push esi
call dword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalUnlock]
mov eax, dword [0x421ccc]
xor esi, esi
push esi
push esi
push 0xb9
push dword [0x422c8c]
mov dword [0x421d4c], eax
call dword [sym.imp.USER32.dll_SendMessageW]
cmp dword [0x421ccc], 1
mov dword [0x421244], esi
jne 0x40eb48
test ebx, ebx
jne 0x40eb48
xor edx, edx
mov ecx, edi
inc edx
call fcn.0040edca
push dword [0x421cc0]
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
or dword [0x421cc0], 0xffffffff
lea eax, [ebp - 0x448]
push 0x218
push esi
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
cmp byte [ebp + 8], 0
je 0x40ebca
push dword [edi]
call dword [sym.imp.api_ms_win_shcore_path_l1_1_0.dll_Ordinal_170]
push dword [edi]
mov dword [ebp - 0x444], eax
call dword [sym.imp.api_ms_win_core_shlwapi_legacy_l1_1_0.dll_PathFindExtensionW]
mov dword [ebp - 0x440], eax
lea eax, [ebp - 0x22c]
push eax
push esi
push dword [edi]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesExW]
mov ecx, dword [edi]
lea edx, [ebp - 0x43c]
neg eax
sbb eax, eax
and eax, dword [ebp - 0x20c]
mov dword [ebp - 0x448], eax
call fcn.0040ed48
mov eax, dword [0x421ccc]
mov dword [ebp - 0x234], eax
cmp dword [0x422a78], esi
je 0x40ebd7
call fcn.0040e789
mov ebx, esi
cmp word [0x422850], bx
je 0x40ec49
mov dword [ebp - 0x450], esi
cmp dword [ebp - 0x464], ebx
jne 0x40ebf5
xor ebx, ebx
inc ebx
jmp 0x40ec49
push ecx
mov ecx, dword [edi]
lea edx, [ebp - 0x450]
call fcn.0040f9ef
mov esi, dword [ebp - 0x450]
test eax, eax
js 0x40ec3c
and dword [ebp - 0x450], ebx
lea eax, [ebp - 0x450]
push eax
push ecx
lea edx, [ebp - 0x208]
mov ecx, esi
call fcn.0041db90
test eax, eax
js 0x40ec3a
cmp dword [ebp - 0x450], 2
je 0x40ec3a
xor ebx, ebx
inc ebx
jmp 0x40ec3c
xor ebx, ebx
test esi, esi
je 0x40ec47
push esi
call dword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
xor esi, esi
cmp dword [ebp + 0xc], 0
jne 0x40ec57
test ebx, ebx
je 0x40ed21
push ecx
mov ecx, dword [edi]
lea edx, [ebp - 0x44c]
mov dword [ebp - 0x44c], esi
call fcn.0040f9ef
mov esi, dword [ebp - 0x44c]
test eax, eax
js 0x40ed16
push 0x1fa
lea eax, [ebp - 0x208]
push 0
push eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp + 0xc]
add esp, 0xc
test eax, eax
jne 0x40ec9b
mov eax, 0x422850
push eax
mov edx, 0xfd
lea ecx, [ebp - 0x208]
call fcn.0040577c
test eax, eax
jns 0x40ecce
cmp dword [ebp - 0x44c], 0
je 0x40eae6
push dword [ebp - 0x44c]
call dword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
jmp 0x40eae6
lea edx, [ebp - 0x208]
mov ecx, esi
call fcn.0041e65c
test eax, eax
js 0x40ed16
cmp word [ebp - 0x208], 0
je 0x40ed0e
lea ecx, [ebp - 0x208]
call fcn.0040d459
test eax, eax
jne 0x40ed05
mov edx, dword [0x421d4c]
mov ecx, edi
call fcn.0040edca
inc word [0x421cb4]
jmp 0x40ed16
xor ecx, ecx
inc ecx
call fcn.0040d4b7
test esi, esi
je 0x40ed21
push esi
call dword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
push dword [0x421dcc]
call dword [sym.imp.USER32.dll_SetCursor]
call fcn.0040c567
movzx edx, byte [ebp + 8]
lea ecx, [ebp - 0x448]
call fcn.0041cc6e
mov al, 1
jmp 0x40eae8