Function at 0x40918c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, edx
push 0x4018b0
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], ecx
push dword [edi]
call dword [sym.imp.VCRUNTIME140.dll_wcsstr]
mov byte [ebp - 1], 0
pop ecx
pop ecx
push 0xa
pop ecx
test eax, eax
je 0x4092ae
cmp eax, dword [edi]
je 0x4091cc
cmp word [eax - 2], cx
jne 0x4092ae
lea ebx, [eax + 4]
push ecx
push ebx
call dword [sym.imp.VCRUNTIME140.dll_wcschr]
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x4091e4
xor eax, eax
mov word [esi], ax
mov ecx, ebx
call fcn.0040e267
mov dword [ebp - 0x14], eax
test esi, esi
je 0x4091f8
push 0xa
pop ecx
mov word [esi], cx
and dword [ebp - 0x10], 0
lea ecx, [ebp - 0x10]
push ecx
push 0x40193c
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcstok_s]
mov esi, eax
add esp, 0xc
test esi, esi
je 0x409286
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
mov edi, dword [ebp + 0x10]
push 0x401904
push esi
call ebx
pop ecx
pop ecx
test eax, eax
jne 0x409231
mov byte [edi], 1
jmp 0x409269
push 0x401910
push esi
call ebx
pop ecx
pop ecx
test eax, eax
jne 0x409243
mov byte [edi], al
jmp 0x409269
push 0x401920
push esi
call ebx
pop ecx
pop ecx
test eax, eax
jne 0x409257
mov byte [ebp - 1], 1
jmp 0x409269
push 0x446
push dword [0x4216a4]
call fcn.004053f6
pop ecx
pop ecx
lea eax, [ebp - 0x10]
push eax
push 0x40193c
push 0
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcstok_s]
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x40921e
mov edi, dword [ebp + 8]
push dword [ebp - 0x14]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp byte [ebp - 1], 0
pop ecx
je 0x4092ab
push dword [ebp - 8]
push 1
push 2
push 0x401938
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
mov esi, dword [ebp - 0xc]
push 2
push 0x4018b0
push dword [edi]
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncmp]
add esp, 0xc
test eax, eax
je 0x4093a6
mov byte [ebp + 0x10], 0
push 0xa
pop eax
push eax
push dword [edi]
call dword [sym.imp.VCRUNTIME140.dll_wcschr]
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x4093a9
cmp byte [ebp + 0xc], 0
je 0x409301
push dword [ebp + 0x10]
mov ecx, dword [edi]
xor eax, eax
mov edx, esi
mov word [ebx], ax
call fcn.0040901b
push 0xa
pop eax
mov word [ebx], ax
cmp byte [ebp - 1], 0
mov esi, dword [edi]
je 0x409331
push dword [ebp - 8]
mov eax, ebx
sub eax, esi
push 2
sar eax, 1
push eax
push esi
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
call esi
push dword [ebp - 8]
push 1
push 4
push 0x401934
call esi
add esp, 0x20
jmp 0x409381
cmp esi, ebx
jae 0x40936c
mov edi, dword [ebp - 8]
xor ecx, ecx
lea eax, [ebp - 0x14]
push ecx
push ecx
push 4
push eax
push 1
push esi
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x409362
push edi
push 1
push eax
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
add esi, 2
cmp esi, ebx
jb 0x409338
mov edi, dword [ebp + 8]
push dword [ebp - 8]
push 1
push 2
push 0x401930
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
push 2
lea eax, [ebx + 2]
mov byte [ebp + 0x10], 1
push 0x4018b0
push eax
mov dword [edi], eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncmp]
mov esi, dword [ebp - 0xc]
add esp, 0xc
test eax, eax
jne 0x4092cc
add dword [edi], 4
pop edi
pop esi
pop ebx
leave
ret 0xc