Function at 0x4064b0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov esi, dword [eax]
push 0x22
call fcn.004079f0
mov edx, dword [ebp + 0xc]
add esp, 4
cmp dword [ebp + 0x10], 0
jbe 0x406712
xor esi, esi
jmp 0x4064e4
mov edx, dword [esp + 0x18]
movzx eax, word [edx]
mov ecx, eax
mov ebx, 0x100
cmp cx, bx
jae 0x406654
movzx ebx, cl
cmp byte [ebx + 0x42aea0], 0
je 0x406654
mov ecx, dword [edi]
add esi, 2
mov dword [esp + 0x10], esi
mov esi, dword [ecx]
mov eax, dword [esi + 0xc]
add edx, 2
mov dword [esp + 0x18], edx
cmp eax, dword [esi + 8]
jb 0x406544
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x406544
mov edx, dword [esi]
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
jmp 0x40654a
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0x5c
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x406576
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x406576
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov byte [ecx], 0
inc dword [esi + 0xc]
movsx dx, byte [ebx + 0x42aea0]
mov ecx, dword [ebp + 8]
movzx eax, dx
mov edx, dword [ecx]
mov esi, dword [edx]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4065b8
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4065b8
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
mov dl, byte [esp + 0x14]
mov byte [ecx], dl
inc dword [esi + 0xc]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jb 0x4065e7
mov ecx, dword [esi + 4]
cmp eax, ecx
je 0x4065e7
mov edx, dword [esi]
push edx
sub eax, ecx
push eax
push 1
push ecx
call edi
mov eax, dword [esi + 4]
add esp, 0x10
mov dword [esi + 0xc], eax
mov ecx, dword [esp + 0x14]
mov edx, dword [esi + 0xc]
shr ecx, 8
mov byte [edx], cl
inc dword [esi + 0xc]
cmp byte [ebx + 0x42aea0], 0x75
jne 0x4066fe
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov esi, dword [eax]
push 0x30
call fcn.004079f0
mov ecx, dword [edi]
mov esi, dword [ecx]
push 0x30
call fcn.004079f0
mov edx, ebx
shr edx, 4
movsx eax, byte [edx + str.0123456789ABCDEFuuuuuuuubtnufruuuuuuuuuuuuuuuuuu]
mov edx, dword [edi]
mov esi, dword [edx]
movzx ecx, ax
push ecx
call fcn.004079f0
mov edx, dword [edi]
mov esi, dword [edx]
and ebx, 0xf
movsx eax, byte [ebx + str.0123456789ABCDEFuuuuuuuubtnufruuuuuuuuuuuuuuuuuu]
movzx ecx, ax
push ecx
call fcn.004079f0
add esp, 0x10
jmp 0x4066fe
mov ebx, dword [edi]
add edx, 2
mov dword [esp + 0x18], edx
add esi, 2
lea ecx, [eax + 0x2800]
mov edx, 0x7ff
mov dword [esp + 0x10], esi
cmp cx, dx
ja 0x4066bd
mov ecx, 0xdbff
cmp ax, cx
ja 0x4066fe
add dword [esp + 0x10], 2
and eax, 0x3ff
shl eax, 0xa
mov edx, eax
mov eax, dword [esp + 0x18]
movzx ecx, word [eax]
add eax, 2
mov dword [esp + 0x18], eax
mov eax, ecx
and eax, 0x3ff
or eax, edx
add ecx, 0x2400
mov edx, 0x3ff
add eax, 0x10000
cmp cx, dx
ja 0x4066fe
mov esi, dword [ebx]
cmp eax, 0xffff
ja 0x4066d1
push eax
call fcn.004079f0
add esp, 4
jmp 0x4066fe
lea edi, [eax - 0x10000]
mov eax, edi
shr eax, 0xa
or eax, 0xd800
push eax
call fcn.004079f0
mov esi, dword [ebx]
and edi, 0x3ff
or edi, 0xdc00
push edi
call fcn.004079f0
add esp, 8
mov esi, dword [esp + 0x10]
mov edi, dword [ebp + 8]
mov ecx, esi
sar ecx, 1
cmp ecx, dword [ebp + 0x10]
jb 0x4064e0
mov edx, dword [edi]
mov esi, dword [edx]
push 0x22
call fcn.004079f0
add esp, 4
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 0xc