Function at 0x403d70
Capabilities:
Delete file
Move file
Set file attributes
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x1404]
mov eax, 0x1404
call fcn.00506e40
push 0xffffffffffffffff
push 0x5201a0
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x576fe4]
xor eax, ebp
mov dword [ebp + 0x1400], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x1410]
mov esi, dword [ebp + 0x140c]
push 0x530041
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x1c], eax
call fcn.00403850
push esi
lea ecx, [ebp - 0x14]
xor edi, edi
push 0x52fde0
mov dword [ebp - 4], edi
push ecx
mov byte [ebp - 4], 1
call fcn.00402f20
add esp, 0xc
mov dword [ebp - 4], edi
jmp 0x403dff
push 0xfff
lea edx, [ebp + 0x401]
push 0
push edx
mov byte [ebp + 0x400], 0
call fcn.00505810
push esi
lea eax, [ebp + 0x400]
push str.DoWriteFile_FileName____s_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x405
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x24
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x403f46
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
push 0x1000
lea edx, [ebp + 0x400]
push 0
push edx
mov edi, eax
call fcn.00505810
push edi
push esi
lea eax, [ebp + 0x400]
push str.DoWriteFile_DeleteFile_Fail____s_____d_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x412
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x28
cmp edi, 5
jne 0x403f8a
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
test eax, eax
jne 0x403efc
push 0x1000
push eax
lea edx, [ebp + 0x400]
push edx
call fcn.00505810
add esp, 0xc
call ebx
push eax
lea eax, [ebp + 0x400]
push str.Attribute_Set_Error____d__n
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x41c
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x18
jmp 0x403f8a
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0x1000
lea edx, [ebp + 0x400]
push 0
push edx
mov edi, eax
call fcn.00505810
push edi
push esi
lea eax, [ebp + 0x400]
push str.DoWriteFile_2_DeleteFile_Fail____s_____d_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x424
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x28
jmp 0x403f8a
push 0x1000
lea edx, [ebp + 0x400]
push 0
push edx
call fcn.00505810
push esi
lea eax, [ebp + 0x400]
push str.DoWriteFile_DeleteFile_Success____s_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x431
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0x24
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0x1000
lea edx, [ebp + 0x400]
push 0
push edx
mov edi, eax
call fcn.00505810
push esi
lea eax, [ebp + 0x400]
push str.DoWriteFile_CreateFile____s_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x440
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x24
cmp edi, 0xffffffff
jne 0x40438b
call ebx
push 0x1000
lea edx, [ebp + 0x400]
push 0
push edx
mov dword [ebp - 0x18], eax
call fcn.00505810
mov eax, dword [ebp - 0x18]
push eax
lea ecx, [ebp + 0x400]
push str.DoWriteFile_CreateFile_Error____d_
push ecx
call fcn.00506b3f
lea edx, [ebp + 0x400]
push edx
push 0x44c
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x24
cmp dword [ebp - 0x18], 0xb7
jne 0x404329
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edi, eax
call ebx
push 0x1000
mov ebx, eax
lea eax, [ebp + 0x400]
push 0
push eax
call fcn.00505810
push ebx
push edi
lea ecx, [ebp + 0x400]
push str.DoWriteFile_DeleteValue____d_____d_
push ecx
call fcn.00506b3f
lea edx, [ebp + 0x400]
push edx
push 0x461
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
add esp, 0x28
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push esi
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x404329
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x1000
mov edi, eax
lea eax, [ebp + 0x400]
push 0
push eax
call fcn.00505810
push edi
push esi
lea ecx, [ebp + 0x400]
push str.CreateFile_2_Error_Return____s____d_
push ecx
call fcn.00506b3f
lea edx, [ebp + 0x400]
push edx
push 0x46d
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
push str.DoWriteFile_Return_0_ZR_NOFILE
push 0x470
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x34
push 0
push 0xffffffffffffffff
push 0
lea ecx, [ebp - 0x44]
call fcn.004037a0
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 3
call fcn.00419579
lea eax, [ebp - 0x44]
push eax
push 0x1001
push esi
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 4
call fcn.004199b5
test eax, eax
je 0x4041a9
push str.CFile_Open_Success
push 0x478
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov ecx, dword [ebp + 0x1414]
mov edx, dword [ebp - 0x1c]
add esp, 0xc
push ecx
push edx
lea ecx, [ebp - 0x30]
call fcn.004192af
lea ecx, [ebp - 0x30]
call fcn.00419513
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 3
call fcn.0041967b
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 0
call fcn.00402320
lea ecx, [ebp - 0x14]
call fcn.00401be0
jmp 0x40440f
push 0
push 0x400
lea eax, [ebp]
push eax
lea ecx, [ebp - 0x44]
call fcn.00418910
push 0x1000
lea ecx, [ebp + 0x400]
push 0
push ecx
call fcn.00505810
lea edx, [ebp]
push edx
lea eax, [ebp + 0x400]
push str.CFile_Open_Fail_Return____s_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x486
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x24
push 0x530041
lea ecx, [ebp - 0x18]
call fcn.00403850
push esi
lea edx, [ebp - 0x18]
push 0x5300c0
push edx
mov byte [ebp - 4], 5
call fcn.00402f20
mov eax, dword [ebp - 0x18]
add esp, 0xc
push eax
push esi
call dword [sym.imp.KERNEL32.dll_MoveFileA]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push esi
call ebx
mov esi, eax
push 0x1000
push 0
cmp esi, 0xffffffff
je 0x4042b7
lea ecx, [ebp + 0x400]
push ecx
call fcn.00505810
lea edx, [ebp]
push edx
lea eax, [ebp + 0x400]
push str.CFile_Open_Fail_Return____s_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x493
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov eax, dword [ebp + 0x1414]
mov ecx, dword [ebp - 0x1c]
add esp, 0x24
push 0
lea edx, [ebp + 0x1418]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x18]
call fcn.00401be0
jmp 0x404184
lea edx, [ebp + 0x400]
push edx
call fcn.00505810
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp + 0x400]
push str.LAST_CreateFile_Fail_Return____d_
push eax
call fcn.00506b3f
lea ecx, [ebp + 0x400]
push ecx
push 0x49d
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
add esp, 0x18
lea ecx, [ebp - 0x18]
call fcn.00401be0
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 3
call fcn.0041967b
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 0
call fcn.00402320
lea ecx, [ebp - 0x14]
call fcn.00401be0
mov eax, 0x200
jmp 0x404411
cmp dword [ebp + 0x141c], 0
je 0x404344
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push str.DoWriteFile_Return_ZR_NOFILE
push 0x4bc
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x404381
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0x200
jmp 0x404411
push str.DoWriteFile_NOT_INVALID_HANDLE_VALUE
push 0x4c0
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov edx, dword [ebp + 0x1414]
mov eax, dword [ebp - 0x1c]
add esp, 0xc
push 0
lea ecx, [ebp + 0x1418]
push ecx
push edx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xe
push str.write_complete
lea ecx, [ebp - 0x14]
call fcn.00402560
mov ecx, dword [ebp - 0x14]
push ecx
push 0x4cd
push str.CI3GSvcManagerApp::DoWriteFile
call fcn.00403910
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40440f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x1400]
xor ecx, ebp
call fcn.0050534a
add ebp, 0x1404
mov esp, ebp
pop ebp
ret 0x14