Function at 0x40ea50
Capabilities:
Check if file exists
Clear file content
Create directory
Get common file path
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x41e6aa
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x858
push ebx
push ebp
push esi
push edi
mov ebp, ecx
xor ebx, ebx
push 0x7d000
mov dword [esp + 0x14], ebp
mov dword [esp + 0x1c], ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov esi, eax
add esp, 4
cmp esi, ebx
jne 0x40ea95
xor eax, eax
jmp 0x40f0a2
push 0x58
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov dword [esp + 0x870], ebx
je 0x40eab9
mov ecx, eax
call fcn.00419ea0
mov edi, eax
jmp 0x40eabb
xor edi, edi
cmp edi, ebx
mov dword [esp + 0x870], 0xffffffff
jne 0x40eada
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
jmp 0x40f0a2
mov eax, dword [ebp + 0x181c]
cmp eax, 1
je 0x40eb1d
cmp eax, 3
je 0x40eb1d
cmp eax, 2
je 0x40eaf4
cmp eax, 4
jne 0x40eb55
push 0xe270
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov dword [esp + 0x870], 2
je 0x40eb46
mov ecx, eax
call fcn.00404160
jmp 0x40eb48
push 0xe250
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov dword [esp + 0x870], 1
je 0x40eb46
mov ecx, eax
call fcn.004025b0
jmp 0x40eb48
xor eax, eax
mov dword [esp + 0x870], 0xffffffff
mov ebx, eax
mov ebp, dword [esp + 0x878]
xor eax, eax
cmp ebx, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
je 0x40ec4d
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 4]
mov eax, dword [esp + 0x10]
mov ebp, dword [eax + 0x10]
mov eax, dword [eax + 0x14]
test eax, eax
jl 0x40eba0
jg 0x40eb91
cmp ebp, 0x10000
jb 0x40eba0
sub ebp, 0x10000
sbb eax, 0
mov dword [esp + 0x24], eax
jmp 0x40eba6
xor ebp, ebp
mov dword [esp + 0x24], ebp
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x878]
push 0
push ecx
push ebp
push edx
call fcn.00407150
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x34]
add esp, 0x10
mov dword [esp + 0x14], 0
cmp eax, dword [ecx + 0x14]
jg 0x40ec2d
jl 0x40ebdc
mov edx, ecx
cmp ebp, dword [edx + 0x10]
jae 0x40ec2d
mov ecx, dword [esp + 0x878]
lea eax, [esp + 0x14]
push 0
push eax
push 0x800
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ec2d
mov edx, dword [ebx]
push eax
push esi
mov ecx, ebx
call dword [edx + 0xc]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
add ebp, edx
mov edx, dword [ecx + 0x14]
adc eax, 0
cmp eax, edx
mov dword [esp + 0x24], eax
jl 0x40ebdc
jg 0x40ec2d
mov edx, ecx
cmp ebp, dword [edx + 0x10]
jb 0x40ebdc
mov eax, dword [ebx]
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x28]
push ecx
push edx
mov ecx, ebx
call dword [eax + 0x40]
mov eax, dword [ebx]
push 1
mov ecx, ebx
call dword [eax]
mov ebp, dword [esp + 0x878]
mov ebx, dword [esp + 0x10]
push 0
mov ecx, dword [ebx + 0x14]
mov edx, dword [ebx + 0x10]
push ecx
push edx
push ebp
call fcn.00407150
add esp, 0x10
push ebp
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
push eax
push ecx
push edx
mov ecx, edi
call fcn.0041aaa0
mov ecx, dword [ebx + 0x181c]
mov eax, 2
dec ecx
cmp ecx, 6
ja case.0x40ec92.5
jmp dword [ecx*4 + 0x40f214]
mov eax, 3
jmp case.0x40ec92.5
mov eax, 6
jmp case.0x40ec92.5
mov eax, 1
jmp case.0x40ec92.5
mov eax, 4
jmp case.0x40ec92.5
mov eax, 2
push eax
mov ecx, edi
call fcn.0041a060
push 0xfa
mov ecx, edi
call fcn.0041a0d0
push 0
mov ecx, edi
call fcn.00419f10
mov ebx, dword [esp + 0x10]
mov ecx, dword [ebx + 0x1a54]
call fcn.00407370
mov ecx, dword [ebx + 0x1a54]
push eax
call fcn.00407360
push eax
mov ecx, edi
call fcn.0041a460
push esi
mov ecx, edi
call fcn.0041a9e0
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jbe 0x40ed2c
lea ecx, [esp + 0x18]
push 0
push ecx
push eax
push esi
push ebp
call ebx
test eax, eax
je 0x40ee76
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
ja 0x40ed0c
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 0x1a48]
call fcn.00407650
mov eax, dword [esp + 0x10]
push 0x800
push esi
mov ecx, dword [eax + 0x1a48]
call fcn.00407540
test eax, eax
jle 0x40ed8b
push eax
push esi
mov ecx, edi
call fcn.0041a460
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
jbe 0x40ed3b
lea ecx, [esp + 0x18]
push 0
push ecx
push eax
push esi
push ebp
call ebx
test eax, eax
je 0x40ee76
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
ja 0x40ed69
jmp 0x40ed3b
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 0x1a48]
call fcn.00407670
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x1a4c]
call fcn.00407650
mov ecx, dword [esp + 0x10]
push 0x800
push esi
mov ecx, dword [ecx + 0x1a4c]
call fcn.00407540
test eax, eax
jle 0x40edf9
push eax
push esi
mov ecx, edi
call fcn.0041a460
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
jbe 0x40eda9
lea edx, [esp + 0x18]
push 0
push edx
push eax
push esi
push ebp
call ebx
test eax, eax
je 0x40ee76
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
ja 0x40edd7
jmp 0x40eda9
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x1a4c]
call fcn.00407670
mov ecx, dword [esp + 0x10]
mov ecx, dword [ecx + 0x1a50]
call fcn.00407650
mov edx, dword [esp + 0x10]
push 0x800
push esi
mov ecx, dword [edx + 0x1a50]
call fcn.00407540
test eax, eax
jle 0x40f00e
push eax
push esi
mov ecx, edi
call fcn.0041a460
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
jbe 0x40ee17
lea ecx, [esp + 0x18]
push 0
push ecx
push eax
push esi
push ebp
call ebx
test eax, eax
je 0x40ee67
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
ja 0x40ee49
jmp 0x40ee17
mov edx, dword [esp + 0x10]
mov ecx, dword [edx + 0x1a50]
call fcn.00407670
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, edi
call fcn.00419f00
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push 0
push 0
push 0xc64
push ebp
call fcn.00407150
add esp, 0x14
lea edx, [esp + 0x34]
lea eax, [esp + 0x30]
mov dword [esp + 0x34], 0
push 0
push edx
push 4
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, dword [esp + 0x10]
mov ecx, dword [ebx + 0x1a88]
mov eax, dword [ebx + 0x1a90]
mov edx, dword [ebx + 0x1a8c]
mov dword [esp + 0x648], ecx
mov ecx, dword [ebx + 0x1a94]
mov dword [esp + 0x650], eax
mov dword [esp + 0x654], ecx
lea eax, [ebx + 0x18]
mov dword [esp + 0x64c], edx
mov edx, dword [esp + 0x30]
lea ecx, [esp + 0x440]
push eax
push ecx
mov dword [esp + 0x868], edx
call sub.MSVCRT.dll_wcscpy
mov eax, dword [0x4256f0]
add esp, 8
cmp eax, 1
push 1
push 0x1a
jne 0x40f0bd
lea edx, [esp + 0x40]
push edx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, 0x423d7c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x38]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
and ecx, 3
lea eax, [esp + 0x38]
rep movsb byte es:[edi], byte [esi]
push eax
call ebp
test eax, eax
jne 0x40ef7c
lea ecx, [esp + 0x38]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov edi, 0x423d74
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x38]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x38]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebp
test eax, eax
jne 0x40efc1
lea ecx, [esp + 0x38]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea edx, [esp + 0x240]
lea eax, [esp + 0x38]
push edx
push 0
push 0x423d70
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0x658]
push 0x104
push ecx
lea edi, [esp + 0x248]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x248]
push ecx
push edx
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
jmp 0x40f153
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x1a50]
call fcn.00407670
mov ecx, dword [esp + 0x890]
mov edx, dword [esp + 0x88c]
mov eax, dword [esp + 0x888]
push 0xffffffffffffffff
push 0xffffffffffffffff
push ecx
mov ecx, dword [esp + 0x890]
push edx
mov edx, dword [esp + 0x890]
push eax
mov eax, dword [esp + 0x890]
push ecx
push edx
push eax
mov ecx, edi
call fcn.0041a730
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
jbe 0x40f084
lea ecx, [esp + 0x18]
push 0
push ecx
push eax
push esi
push ebp
call ebx
test eax, eax
je 0x40ee76
push esi
mov ecx, edi
call fcn.0041a9e0
test eax, eax
ja 0x40f064
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, edi
call fcn.00419f00
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x868]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x864
ret 0x1c
lea eax, [esp + 0x40]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea ecx, [esp + 0x38]
push 0x423d58
push ecx
call sub.MSVCRT.dll_wcscat
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 8
lea edx, [esp + 0x38]
push edx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40f0fc
lea eax, [esp + 0x38]
push 0
push eax
call edi
lea ecx, [esp + 0x38]
push 0x423d48
push ecx
call sub.MSVCRT.dll_wcscat
add esp, 8
lea edx, [esp + 0x38]
push edx
call esi
test eax, eax
jne 0x40f121
push eax
lea eax, [esp + 0x3c]
push eax
call edi
lea ecx, [esp + 0x240]
lea edx, [esp + 0x38]
push ecx
push 0
push 0x423d40
push edx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [esp + 0x240]
lea ecx, [esp + 0x658]
push eax
push ecx
call sub.MSVCRT.dll_wcscpy
add esp, 8
mov eax, dword [0x4256f0]
push 0
cmp eax, 1
jne 0x40f1a4
push 0
lea edx, [esp + 0x248]
push 0x104
push edx
lea eax, [esp + 0x668]
push 0xffffffffffffffff
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0
push 0x80
push 2
push 0
push 1
lea ecx, [esp + 0x254]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
jmp 0x40f1c2
push 0x80
push 2
push 0
push 1
lea edx, [esp + 0x66c]
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40f1d0
xor eax, eax
jmp 0x40f0a2
push esi
mov ecx, ebx
call fcn.0040d8e0
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
jne 0x40f1ec
xor eax, eax
jmp 0x40f0a2
sub esp, 0x428
mov ecx, 0x10a
lea esi, [esp + 0x868]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push 0x423cf0
mov ecx, ebx
call fcn.0040f230
jmp 0x40f0a2