Function at 0x409490
Capabilities:
Delete file
Print debug messages
Timestomp file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x208c
call fcn.00426290
mov eax, dword [0x44dc1c]
xor eax, esp
mov dword [esp + 0x2088], eax
push ebx
mov ebx, edx
test ebx, ebx
push esi
push edi
mov edi, ecx
mov dword [esp + 0x10], ebx
mov byte [esp + 0xf], 0
mov byte [esp + 0xe], 0
jne 0x4094de
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2088]
xor ecx, esp
call fcn.0042397a
mov esp, ebp
pop ebp
ret
push 0x50
lea eax, [esp + 0x44]
push 0
push eax
call fcn.004260b0
add esp, 0xc
push 0x400
lea ecx, [esp + 0x94]
push 0
push ecx
call fcn.004260b0
add esp, 0xc
push 0x400
lea edx, [esp + 0x1494]
push 0
push edx
call fcn.004260b0
add esp, 0xc
push ebx
lea eax, [esp + 0x1494]
lea ecx, [esp + 0x94]
lea esi, [esp + 0x44]
call fcn.0040abf0
add esp, 4
test eax, eax
jne 0x4094c7
test byte [esp + 0x74], 0x10
je 0x409548
mov byte [esp + 0xe], 1
lea eax, [esp + 0x90]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x409552
sub eax, edx
js 0x409577
nop
cmp byte [esp + eax + 0x90], 0x2f
jne 0x409572
mov byte [esp + eax + 0x90], 0x5c
sub eax, 1
jns 0x409560
push 0x800
lea eax, [esp + 0x1894]
push 0
push eax
call fcn.004260b0
add esp, 0xc
push 0x400
lea ecx, [esp + 0x1894]
push ecx
push 0xffffffffffffffff
lea edx, [esp + 0x9c]
push edx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x4095c9
push 0x800
push eax
lea eax, [esp + 0x498]
push eax
call fcn.004260b0
add esp, 0xc
mov eax, edi
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4095d0
sub eax, edx
sar eax, 1
cmp word [edi + eax*2 - 2], 0x5c
jne 0x4095f7
lea ecx, [esp + 0x1890]
push ecx
push edi
push 0x442a28
jmp 0x409605
lea edx, [esp + 0x1890]
push edx
push edi
push str._s_s
lea edx, [esp + 0x49c]
call fcn.004047b0
add esp, 0xc
cmp byte [esp + 0xe], 0
lea ecx, [esp + 0x490]
je 0x40963e
push 1
call fcn.004092e0
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2088]
xor ecx, esp
call fcn.0042397a
mov esp, ebp
pop ebp
ret
push 0
call fcn.004092e0
test al, al
je 0x4094c7
lea eax, [esp + 0x490]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
lea ecx, [esp + 0x4a8]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4096b0
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push str.Fail_to_create_file__
call esi
lea edx, [esp + 0x490]
push edx
call esi
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2088]
xor ecx, esp
call fcn.0042397a
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0040b050
add esp, 4
test eax, eax
jne 0x4097c7
push 0x800
push eax
mov dword [esp + 0x1c], eax
lea eax, [esp + 0xc98]
push eax
call fcn.004260b0
lea ecx, [esp + 0xc9c]
add esp, 0xc
push ecx
mov eax, ebx
call fcn.0040b220
mov esi, eax
add esp, 4
test esi, esi
jle 0x409762
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
lea esp, [esp]
push 0
lea edx, [esp + 0x18]
push edx
push esi
lea eax, [esp + 0xc9c]
push eax
push edi
call ebx
test eax, eax
je 0x4097c3
cmp dword [esp + 0x14], esi
jne 0x4097c3
push 0x800
lea ecx, [esp + 0xc94]
push 0
push ecx
call fcn.004260b0
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0xc9c]
add esp, 0xc
push edx
mov dword [esp + 0x18], 0
call fcn.0040b220
mov esi, eax
add esp, 4
test esi, esi
jg 0x409700
mov ebx, dword [esp + 0x10]
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x40]
push edx
push edi
mov byte [esp + 0x1f], 1
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
je 0x4097c7
lea eax, [esp + 0x20]
push eax
mov eax, dword [esp + 0x54]
push eax
shr eax, 0x10
push eax
call dword [sym.imp.KERNEL32.dll_DosDateTimeToFileTime]
test eax, eax
je 0x4097c7
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFileTimeToFileTime]
test eax, eax
je 0x4097c7
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x2c]
push ecx
mov edx, eax
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
jmp 0x4097c7
mov ebx, dword [esp + 0x10]
test edi, edi
je 0x4097d2
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.0040b4d0
mov bl, byte [esp + 0xf]
test bl, bl
jne 0x4097ed
lea eax, [esp + 0x490]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ecx, dword [esp + 0x2094]
pop edi
pop esi
mov al, bl
pop ebx
xor ecx, esp
call fcn.0042397a
mov esp, ebp
pop ebp
ret