Function at 0x4221e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52ccf8
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
mov eax, dword [0x5c6150]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x48], ebx
cmp dword [ebx + 0x38], 0
je 0x4223c7
cmp byte [ebx + 0x3e], 0
je 0x4223c7
push 0xffff
call fcn.004214b0
mov ecx, 0xffff
cmp cx, ax
jne 0x42223f
xor al, al
jmp 0x4223c9
push 0
push 8
lea ecx, [ebp - 0x30]
call fcn.004207d0
lea esi, [ebx + 0x40]
mov dword [ebp - 4], 0
mov dword [ebp - 0x40], esi
mov edx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x1c]
nop
cmp edi, 0x10
lea ecx, [ebp - 0x30]
lea eax, [ebp - 0x30]
cmovae eax, edx
cmovae ecx, edx
mov edx, dword [ebx + 0x38]
add ecx, dword [ebp - 0x20]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x3c], ecx
mov eax, dword [edx]
mov edi, dword [eax + 0x20]
cmp eax, vtable.std::codecvt_wchar_t__char__struct__Mbstatet_.0
jne 0x422300
mov eax, dword [ebp - 0x38]
xor edi, edi
mov dword [ebp - 0x34], eax
mov eax, dword [esi]
mov dword [ebp - 0x38], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x44], eax
lea eax, [edx + 8]
push eax
push esi
lea eax, [ebp - 0x18]
push edi
push eax
call fcn.004d6561
mov esi, dword [ebp - 0x34]
mov ebx, eax
add esp, 0x10
test ebx, ebx
jg 0x4222bf
mov ebx, dword [ebp - 0x48]
mov edi, 2
jmp 0x422313
mov eax, dword [ebp - 0x3c]
dec ebx
sub eax, esi
cmp eax, ebx
jge 0x4222e1
mov eax, dword [ebp - 0x40]
mov edi, 1
mov ecx, dword [ebp - 0x38]
mov ebx, dword [ebp - 0x48]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x44]
mov dword [eax + 4], ecx
jmp 0x422313
test ebx, ebx
jle 0x4222fb
push ebx
lea eax, [ebp - 0x18]
push eax
push esi
call fcn.004d9a60
mov esi, dword [ebp - 0x34]
add esp, 0xc
add esi, ebx
mov dword [ebp - 0x34], esi
mov ebx, dword [ebp - 0x48]
jmp 0x422313
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp - 0x38]
push ecx
push eax
push esi
mov ecx, edx
call edi
mov esi, dword [ebp - 0x34]
mov edi, eax
sub edi, 0
je 0x42232c
sub edi, 1
je 0x422330
mov edx, dword [ebp - 0x30]
sub edi, 2
mov edi, dword [ebp - 0x1c]
je 0x42238a
xor bl, bl
jmp 0x42238c
mov byte [ebx + 0x3e], 0
mov edi, dword [ebp - 0x1c]
lea eax, [ebp - 0x30]
mov edx, dword [ebp - 0x30]
cmp edi, 0x10
cmovae eax, edx
sub esi, eax
je 0x422365
push dword [ebx + 0x4c]
cmp edi, 0x10
lea eax, [ebp - 0x30]
push esi
cmovae eax, edx
push 1
push eax
call fcn.004e45f2
mov edi, dword [ebp - 0x1c]
add esp, 0x10
mov edx, dword [ebp - 0x30]
cmp esi, eax
jne 0x422328
cmp byte [ebx + 0x3e], 0
je 0x42238a
test esi, esi
lea esi, [ebx + 0x40]
jne 0x422260
push 0
push 8
lea ecx, [ebp - 0x30]
call fcn.00421f10
lea esi, [ebx + 0x40]
jmp 0x422258
mov bl, 1
cmp edi, 0x10
jb 0x4223be
lea eax, [edi + 1]
cmp eax, 0x1000
jb 0x4223b5
test dl, 0x1f
jne 0x4223c2
mov eax, dword [edx - 4]
cmp eax, edx
jae 0x4223c2
sub edx, eax
cmp edx, 4
jb 0x4223c2
cmp edx, 0x23
ja 0x4223c2
mov edx, eax
push edx
call fcn.004d6cf8
add esp, 4
mov al, bl
jmp 0x4223c9
call fcn.004e1d90
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004d6cfd
mov esp, ebp
pop ebp
ret