Function at 0x497370
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5e2730
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x1010
call fcn.00521200
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov byte [ebp - 0x11], 0
mov byte [ebp - 0x12], 0
mov dword [ebp - 4], 0
mov ecx, 0x610338
lea edx, [ebp - 0x420]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x4973b3
mov ecx, dword [ebp + 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0x200
lea eax, [ebp - 0x1020]
push eax
push 0xffffffffffffffff
push ecx
push 0
push 0
call ebx
lea eax, [ebp - 0x1020]
mov edx, eax
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4973f0
lea edi, [ebp - 0x420]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x497406
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [ebp - 0x420]
rep movsb byte es:[edi], byte [esi]
lea edx, [eax + 2]
jmp 0x497430
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x497430
push 0x400
sub eax, edx
sar eax, 1
lea edx, [ebp - 0x1020]
push edx
push 0xffffffffffffffff
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x10]
push eax
push 0
push 0
call ebx
lea ecx, [ebp - 0x1020]
lea edx, [ebp - 0x820]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x497466
lea eax, [ebp - 0x820]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x497480
push 0x400
lea ecx, [ebp - 0x1020]
push ecx
sub eax, edx
mov edx, dword [ebp + 0x14]
push 0xffffffffffffffff
push edx
push 0
sar eax, 1
push 0
mov dword [ebp - 0x18], eax
call ebx
mov eax, dword [ebp + 8]
push 0x5f6698
push eax
call dword [sym.imp.msvcrt.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
jne 0x4974ee
push 0x637c4c
lea ecx, [ebp - 0x1c]
push ecx
mov dword [ebp - 0x1c], 0xff67697f
call sub.msvcrt.dll__CxxThrowException
mov eax, 0x4974dd
ret
mov esi, dword [ebp + 0x18]
movzx eax, word [esi]
test ax, ax
je 0x49762c
cmp byte [ebp - 0x11], 0
je 0x4975db
cmp eax, 0x3e
jne 0x497523
mov byte [ebp - 0x11], 0
movzx eax, word [esi]
push edi
push eax
add esi, 2
call dword [sym.imp.msvcrt.dll_fputwc]
add esp, 8
jmp 0x4974f1
cmp byte [ebp - 0x12], 0
je 0x497510
push eax
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
je 0x497510
mov ebx, dword [ebp - 0x18]
push ebx
lea edx, [ebp - 0x820]
push edx
lea eax, [esi + 2]
push eax
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x497510
push edi
push 2
lea ecx, [ebx + 1]
push ecx
push esi
call dword [sym.imp.msvcrt.dll_fwrite]
movzx eax, word [esi + ebx*2 + 2]
lea esi, [esi + ebx*2 + 2]
add esp, 0x10
cmp eax, 0x20
je 0x497577
cmp eax, 0x3d
jne 0x497510
movzx eax, word [esi]
test ax, ax
je 0x497510
cmp eax, 0x22
je 0x497594
push edi
push eax
add esi, 2
call dword [sym.imp.msvcrt.dll_fputwc]
add esp, 8
jmp 0x497577
cmp word [esi], 0
je 0x497510
push edi
push 0x22
call dword [sym.imp.msvcrt.dll_fputwc]
lea edx, [ebp - 0x1020]
push edi
push edx
add esi, 2
call dword [sym.imp.msvcrt.dll_fputws]
add esp, 0x10
jmp 0x4975c0
movzx eax, word [esi]
test ax, ax
je 0x4975d2
cmp eax, 0x22
je 0x4975d2
add esi, 2
jmp 0x4975c0
mov byte [ebp - 0x12], 0
jmp 0x4974f1
mov ebx, dword [ebp - 0x20]
push ebx
lea eax, [ebp - 0x420]
push eax
push esi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x497510
movzx ecx, word [esi + ebx*2]
push ecx
call dword [sym.imp.msvcrt.dll_iswspace]
add esp, 4
test eax, eax
je 0x497510
push edi
push 2
push ebx
push esi
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
lea esi, [esi + ebx*2]
mov byte [ebp - 0x11], 1
mov byte [ebp - 0x12], 1
jmp 0x4974f1
push edi
call dword [sym.imp.msvcrt.dll_fclose]
mov ecx, dword [ebp - 0xc]
add esp, 4
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret