Function at 0x4022f0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x180
mov eax, dword [0x5ed284]
xor eax, esp
mov dword [esp + 0x17c], eax
push ebp
mov ebp, dword [esp + 0x18c]
push esi
push edi
mov edi, dword [esp + 0x190]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x16c]
push 0x20
push ecx
mov dword [esp + 0x18], 0
call sub.api_ms_win_crt_time_l1_1_0.dll__ctime64_s
push 0
mov esi, eax
call sub.api_ms_win_crt_time_l1_1_0.dll__time64
mov dword [esp + 0x20], eax
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
mov dword [esp + 0x14], edx
je 0x4023ba
test esi, esi
jne 0x4023ba
mov edx, dword [esp + 0xc]
push edx
lea eax, [esp + 0x1c]
push 0x1c
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcpy_s
lea ecx, [esp + 0x24]
push 0x20
push ecx
call sub.VCRUNTIME140.dll_strchr
add esp, 0x14
test eax, eax
jne 0x402391
pop edi
pop esi
mov eax, 1
pop ebp
mov ecx, dword [esp + 0x17c]
xor ecx, esp
call fcn.0052bfb9
add esp, 0x180
ret
add eax, 1
push eax
lea edx, [esp + 0x1c]
push 0x1c
push edx
call sub.api_ms_win_crt_string_l1_1_0.dll_strcpy_s
lea eax, [esp + 0x24]
push 0x20
push eax
call sub.VCRUNTIME140.dll_strrchr
add esp, 0x14
test eax, eax
je 0x402374
mov byte [eax + 1], 0
jmp 0x4023bf
mov byte [esp + 0x18], 0
test edi, edi
je 0x4023c9
mov dword [esp + 0xc], edi
jmp 0x4023ef
cmp byte [0x802240], 0
je 0x4023ef
push 0x58a190
lea ecx, [esp + 0x10]
push 0x802240
push ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esp + 0xc], 0
je 0x402374
lea edx, [esp + 0x34]
push 0x32
push edx
call fcn.00403200
add esp, 8
cmp eax, 0xffffffff
je 0x4024ad
mov edi, str.NONAME
lea esi, [esp + 0x34]
mov ecx, 7
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40246a
call sub.api_ms_win_crt_runtime_l1_1_0.dll__getpid
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x70]
push str._n_s___lu_
push edx
call fcn.00410db0
lea eax, [esp + 0x78]
add esp, 0x10
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x402450
mov ecx, dword [esp + 0xc]
push ecx
sub eax, edx
push 1
push eax
lea edx, [esp + 0x74]
push edx
jmp 0x4024e9
call sub.api_ms_win_crt_runtime_l1_1_0.dll__getpid
push eax
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x74]
push str._n_s___s:_lu_
push edx
call fcn.00410db0
lea eax, [esp + 0x7c]
add esp, 0x14
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x402493
mov ecx, dword [esp + 0xc]
push ecx
sub eax, edx
push 1
push eax
lea edx, [esp + 0x74]
push edx
jmp 0x4024e9
call sub.api_ms_win_crt_runtime_l1_1_0.dll__getpid
push eax
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x70]
push str._n_s___lu_
push ecx
call fcn.00410db0
lea eax, [esp + 0x78]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4024d1
sub eax, edx
mov edx, dword [esp + 0xc]
push edx
push 1
push eax
lea eax, [esp + 0x74]
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
add esp, 0x10
test ebp, ebp
je 0x40251c
cmp byte [ebp], 0
je 0x40251c
mov eax, ebp
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x402500
mov ecx, dword [esp + 0xc]
push ecx
sub eax, edx
push 1
push eax
push ebp
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
add esp, 0x10
mov edx, dword [esp + 0xc]
push edx
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fclose
mov ecx, dword [esp + 0x18c]
add esp, 4
pop edi
pop esi
pop ebp
xor ecx, esp
xor eax, eax
call fcn.0052bfb9
add esp, 0x180
ret