Function at 0x407570
Capabilities:
Read file on windows
Set file attributes
Write file on windows

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x20]
push 0
mov dword [esp + 0x18], ecx
push edi
mov dword [esp + 0x18], 0
call dword [sym.imp.MSVCRT.dll__access]
add esp, 8
cmp eax, 0xffffffff
je 0x4075a4
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4075ea
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.CreateSomFile:_CreateError__FileName:__s___x_
push 0x418244
call fcn.00401710
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x18
mov ebp, dword [esp + 0x28]
lea edi, [ebp + 0x10]
push edi
call sub.MFC42.DLL_operatornew
mov ecx, edi
mov ebx, eax
mov edx, ecx
xor eax, eax
mov edi, ebx
push 0
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x24]
push eax
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0x10
test eax, eax
je 0x407639
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 0x18
push edi
push ebp
push 1
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0x10
lea ecx, [esp + 0x10]
mov byte [ebx + ebp], 0
push 0
push ecx
push 0xa
push str.SCDSSS02
push esi
call edi
test eax, eax
jne 0x407690
mov edx, dword [esp + 0x20]
push edx
push str.CreateSomFile:_WriteError_HEADER_FileName:__s_
push 0x418244
call fcn.00401710
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 0x18
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x10]
push 0
push eax
push 0x10
push ecx
push esi
call edi
test eax, eax
jne 0x4076cf
mov edx, dword [esp + 0x20]
push edx
push str.CreateSomFile:_WriteError_HEADER_SIZE_FileName:__s_
push 0x418244
call fcn.00401710
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 0x18
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x10]
push 0
push eax
push 0x10
push ecx
push esi
call edi
test eax, eax
jne 0x40770e
mov edx, dword [esp + 0x20]
push edx
push str.CreateSomFile:_WriteError_Key_FileName:__s_
push 0x418244
call fcn.00401710
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 0x18
lea eax, [esp + 0x10]
push 0
push eax
push ebp
push ebx
push esi
call edi
test eax, eax
jne 0x407748
mov ecx, dword [esp + 0x20]
push ecx
push str.CreateSomFile:_WriteError_Data_FileName:__s_
push 0x418244
call fcn.00401710
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 0x18
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call sub.MFC42.DLL_operatordelete
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x24]
add esp, 4
add edx, 4
push esi
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push esi
push str.CreateSomFile:_Success__FileName:__s_
push 0x418244
call fcn.00401710
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x18