Function at 0x401ae0
Capabilities:
Access peb ldr_data
Clear file content
Get graphical window text
Get kernel32 base address
Get process heap flags
Get process heap force flags
Write file on windows

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff0
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
mov edi, dword fs:[0x18]
sub esp, 0x4c
mov dword [ebp - 0x20], eax
mov eax, dword [0x40c02c]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetWindowTextLengthW]
sub esp, 4
lea edx, [eax + 1]
lea eax, [eax + eax + 4]
mov dword [ebp - 0x24], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x28], eax
call eax
mov edx, dword [ebp - 0x24]
sub esp, 0xc
test eax, eax
je 0x401ffe
mov ecx, 0xfffffeff
mov ebx, eax
lea eax, [eax + 2]
mov word [eax - 2], cx
mov dword [ebp - 0x24], eax
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [0x40c02c]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetWindowTextW]
sub esp, 0xc
mov edx, eax
lea ecx, [eax + 1]
cmp esi, 2
je 0x401e90
cmp esi, 3
je 0x401cd0
cmp esi, 1
je 0x401f58
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
mov dword [esp + 0xc], edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x30], edx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 4], 0x400
mov dword [esp], 0
mov dword [ebp - 0x2c], eax
call eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x30]
sub esp, 0x20
test eax, eax
jne 0x401fb0
mov dword [esp + 0xc], edx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x30], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0
mov eax, dword [ebp - 0x2c]
call eax
sub esp, 0x20
mov esi, eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x28]
call eax
mov edx, dword [ebp - 0x30]
sub esp, 0xc
test eax, eax
je 0x402005
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [ebp - 0x28], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov dword [esp], 0
mov eax, dword [ebp - 0x2c]
call eax
sub esp, 0x20
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x24], eax
call eax
mov ebx, dword [ebp - 0x28]
sub esp, 0xc
jmp 0x401da0
mov eax, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [ebp - 0x2c], ecx
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov dword [ebp - 0x24], eax
call eax
sub esp, 0x20
mov esi, eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x28]
call eax
mov ecx, dword [ebp - 0x2c]
sub esp, 0xc
test eax, eax
je 0x402005
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [ebp - 0x28], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov eax, dword [ebp - 0x24]
call eax
sub esp, 0x20
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x24], eax
call eax
mov ebx, dword [ebp - 0x28]
sub esp, 0xc
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0x40000000
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov edi, eax
cmp eax, 0xffffffff
je 0x401ff0
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x401f70
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_SetEndOfFile]
sub esp, 4
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x24]
call eax
sub esp, 0xc
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xb9
mov eax, dword [0x40c02c]
mov dword [esp], eax
call dword [sym.imp.user32.dll_SendMessageW]
xor eax, eax
sub esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
test ecx, ecx
je 0x401f58
cmp eax, 6
jbe 0x401ff7
mov esi, ecx
mov eax, ebx
shr esi, 3
shl esi, 4
add esi, ebx
lea esi, [esi]
movdqu xmm1, xmmword [eax]
movdqu xmm0, xmmword [eax]
add eax, 0x10
psrlw xmm1, 8
psllw xmm0, 8
por xmm0, xmm1
movups xmmword [eax - 0x10], xmm0
cmp esi, eax
jne 0x401eb0
mov eax, ecx
and eax, 0xfffffff8
test cl, 7
je 0x401f58
mov esi, ecx
sub esi, eax
cmp edx, eax
je 0x401f53
lea edx, [ebx + eax*2]
mov edi, esi
movd xmm0, dword [edx]
shr edi, 1
movdqu xmm1, xmm0
psllw xmm0, 8
psrlw xmm1, 8
por xmm0, xmm1
movd dword [edx], xmm0
cmp edi, 1
je 0x401f46
movd xmm0, dword [edx + 4]
movdqu xmm1, xmm0
psrlw xmm0, 8
psllw xmm1, 8
por xmm0, xmm1
movd dword [edx + 4], xmm0
cmp edi, 2
je 0x401f46
movd xmm0, dword [edx + 8]
movdqu xmm1, xmm0
psllw xmm0, 8
psrlw xmm1, 8
por xmm0, xmm1
movd dword [edx + 8], xmm0
test esi, 1
je 0x401f58
and esi, 0xfffffffe
add eax, esi
rol word [ebx + eax*2], 8
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
lea esi, [ecx + ecx]
mov dword [ebp - 0x24], eax
jmp 0x401da0
call sym._ShowLastError
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x24]
call eax
sub esp, 0xc
mov eax, 1
jmp 0x401e7b
mov eax, dword [ebp - 0x20]
call sym._AlertUnicodeCharactersLost
mov edx, dword [ebp - 0x30]
cmp eax, 2
jne 0x401bf0
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, 2
sub esp, 0xc
jmp 0x401e7b
call sym._ShowLastError
jmp 0x401f81
xor eax, eax
jmp 0x401edb
call sym._ShowLastError
jmp 0x401fa4
call sym._ShowLastError
xor edx, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], edx
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x401fa4