Function at 0x40697a
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [0x422830]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
mov ecx, dword [ebp + 8]
push ebx
xor ebx, ebx
cmp dword [eax + 0x50], ebx
mov dword [ebp - 0x124], eax
mov dword [ebp - 0x128], ecx
je 0x406c28
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push edi
push ebx
push 0x80
push 4
push ebx
push 1
push 0x40000000
mov edi, 0x401318
push edi
call esi
cmp eax, 0xffffffff
mov dword [ebp - 0x12c], eax
jne 0x406a01
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
push 0x80
push 4
push ebx
push 1
push 0x40000000
push edi
call esi
cmp eax, 0xffffffff
mov dword [ebp - 0x12c], eax
je 0x406c26
mov eax, dword [ebp - 0x124]
cmp dword [eax + 4], ebx
mov dword [ebp - 0x120], ebx
je 0x406a1c
mov dword [ebp - 0x120], 1
cmp dword [eax + 8], ebx
je 0x406a28
add dword [ebp - 0x120], 2
cmp dword [eax + 0xc], ebx
je 0x406a34
add dword [ebp - 0x120], 4
cmp dword [eax + 0x10], ebx
je 0x406a40
add dword [ebp - 0x120], 8
lea eax, [ebp - 0x140]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push 0x28
lea eax, [ebp - 0x54]
push eax
push 0x401308
lea eax, [ebp - 0x140]
push eax
push ebx
mov esi, 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetDateFormatW]
lea eax, [ebp - 0x54]
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x406a72
mov edi, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push ebx
push 0x401304
sub eax, ecx
push 0x14
sar eax, 1
lea ecx, [ebp - 0x2c]
push ecx
inc eax
push eax
lea eax, [ebp - 0x54]
push eax
push esi
push ebx
call edi
push 0x28
lea eax, [ebp - 0x54]
push eax
push 0x4012f0
lea eax, [ebp - 0x140]
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetTimeFormatW]
lea eax, [ebp - 0x54]
lea ecx, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
cmp dx, bx
jne 0x406abc
push ebx
push 0x401304
sub eax, ecx
push 0x14
sar eax, 1
lea ecx, [ebp - 0x18]
push ecx
inc eax
push eax
lea eax, [ebp - 0x54]
push eax
push esi
push ebx
call edi
cmp dword [ebp + 0xc], 0xffffffff
jne 0x406b37
cmp dword [ebp + 0x10], 0xffffffff
jne 0x406b84
push dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
push dword [eax + 0x18]
movzx ecx, word [ebp - 0x132]
push dword [ebp - 0x128]
add eax, 0x60
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x2c]
push ecx
push eax
push 0x4012d4
lea eax, [ebp - 0x11c]
push 0xc8
push eax
call sub.msvcrt.dll_sprintf_s
add esp, 0x28
jmp 0x406bcc
cmp dword [ebp + 0x10], 0xffffffff
jne 0x406b84
push dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
push dword [eax + 0x18]
movzx ecx, word [ebp - 0x132]
push dword [ebp + 0xc]
add eax, 0x60
push dword [ebp - 0x128]
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x2c]
push ecx
push eax
push 0x4012b0
lea eax, [ebp - 0x11c]
push 0xc8
push eax
call sub.msvcrt.dll_sprintf_s
add esp, 0x2c
jmp 0x406bcc
push dword [ebp - 0x120]
mov eax, dword [ebp - 0x124]
push dword [eax + 0x18]
movzx ecx, word [ebp - 0x132]
push dword [ebp + 0x10]
add eax, 0x60
push dword [ebp + 0xc]
push dword [ebp - 0x128]
push ecx
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x2c]
push ecx
push eax
push 0x401288
lea eax, [ebp - 0x11c]
push 0xc8
push eax
call sub.msvcrt.dll_sprintf_s
add esp, 0x30
mov edi, dword [ebp - 0x12c]
push 2
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp + 0x14], ebx
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x406bfa
push ebx
lea eax, [ebp - 0x130]
push eax
push 2
push 0x401284
push edi
call esi
lea eax, [ebp - 0x11c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x406c03
push ebx
lea ecx, [ebp - 0x130]
push ecx
sub eax, edx
push eax
lea eax, [ebp - 0x11c]
push eax
push edi
call esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0040de61
leave
ret 0x10