Function at 0x401e30
Capabilities:
Clear file content
Get graphical window text
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x82c
mov ebx, edx
mov dword [ebp - 0x18], ecx
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextLengthW]
mov edi, eax
lea ecx, [eax*2 + 4]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x401f11
mov esi, eax
inc edi
mov word [eax], 0xfeff
add eax, 2
push edi
mov dword [ebp - 0x10], eax
push eax
push dword [0x408218]
call dword [sym.imp.user32.dll_GetWindowTextW]
lea edi, [eax + 1]
cmp ebx, 1
je 0x401f0a
cmp ebx, 3
je 0x401f1b
cmp ebx, 2
jne 0x401fa4
test edi, edi
je 0x401f0a
mov ebx, edi
and ebx, 3
xor ecx, ecx
cmp eax, 3
jb 0x401eee
mov edx, edi
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
rol word [esi + ecx*2], 8
rol word [esi + ecx*2 + 2], 8
rol word [esi + ecx*2 + 4], 8
rol word [esi + ecx*2 + 6], 8
add ecx, 4
cmp edx, ecx
jne 0x401ed0
test ebx, ebx
je 0x401f0a
lea ecx, [esi + ecx*2]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
rol word [ecx + edx*2], 8
inc edx
cmp ebx, edx
jne 0x401f00
add edi, edi
jmp 0x402172
call sym._ShowLastError
jmp 0x402258
push 0
push 0
push 0
push 0
push edi
push esi
push 0
push 0xfde9
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov ecx, eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
mov dword [ebp - 0x10], ecx
push ecx
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x40221f
mov ebx, eax
push 0
push 0
push dword [ebp - 0x10]
push eax
push edi
push esi
push 0
push 0xfde9
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov esi, ebx
mov edi, dword [ebp - 0x10]
jmp 0x402172
mov dword [ebp - 0x23c], 0
lea edi, [ebp - 0x23c]
push edi
push 0
push 0
push 0
mov dword [ebp - 0x14], eax
push eax
mov ebx, dword [ebp - 0x10]
push ebx
push 0x400
push 0
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
cmp dword [ebp - 0x23c], 0
je 0x4020f6
lea eax, [ebp - 0x43c]
mov ebx, dword [sym.imp.user32.dll_LoadStringW]
push 0xff
push eax
push 0x170
push dword [0x40820c]
call ebx
lea eax, [ebp - 0x838]
push 0xff
push eax
push 0x183
push dword [0x40820c]
call ebx
push edi
push 0
push 0
call dword [sym.imp.kernel32.dll_GetCPInfoExW]
lea ecx, [ebp - 0x224]
mov edx, 0xff
lea eax, [ebp - 0x638]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [ecx]
test bx, bx
je 0x402066
mov word [eax - 2], bx
movzx ebx, word [ecx + 2]
test bx, bx
je 0x402069
add edx, 0xfffffffe
mov word [eax], bx
add eax, 4
add ecx, 4
cmp edx, 1
ja 0x402040
add eax, 0xfffffffe
mov word [eax], 0
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x23c], eax
lea eax, [ebp - 0x63a]
mov dword [ebp - 0x238], eax
lea eax, [ebp - 0x1c]
push edi
push 0
push eax
push 0
push 0
lea eax, [ebp - 0x838]
push eax
push 0x2500
call dword [sym.imp.kernel32.dll_FormatMessageW]
push 0x31
lea eax, [ebp - 0x43c]
push eax
push dword [ebp - 0x1c]
push dword [0x408210]
call dword [sym.imp.user32.dll_MessageBoxW]
mov edi, eax
push dword [ebp - 0x1c]
call dword [sym.imp.kernel32.dll_LocalFree]
cmp edi, 2
mov ebx, dword [ebp - 0x10]
jne 0x4020f6
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, 2
jmp 0x40225d
push 0
push 0
push 0
push 0
push dword [ebp - 0x14]
push ebx
push 0
push 0
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov edi, eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push edi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapAlloc]
test eax, eax
je 0x402232
mov ecx, ebx
mov ebx, eax
push 0
push 0
push edi
push eax
push dword [ebp - 0x14]
push ecx
push 0
push 0
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov esi, ebx
push 0
push 0x80
push 4
push 0
push 2
push 0x40000000
push dword [ebp - 0x18]
call dword [sym.imp.kernel32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x4021f2
mov ebx, eax
lea eax, [ebp - 0x43c]
push 0
push eax
push edi
push esi
push ebx
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x402205
push ebx
call dword [sym.imp.kernel32.dll_SetEndOfFile]
push ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
push 0
push 0
push 0xb9
push dword [0x408218]
call dword [sym.imp.user32.dll_SendMessageW]
xor eax, eax
jmp 0x40225d
call sym._ShowLastError
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
jmp 0x402243
call sym._ShowLastError
push ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
jmp 0x402243
call sym._ShowLastError
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
jmp 0x402243
call sym._ShowLastError
mov eax, dword fs:[0x18]
mov dword [ebp - 0x23c], eax
mov eax, dword [ebp - 0x23c]
mov eax, dword [eax + 0x30]
push esi
push 0
push dword [eax + 0x18]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, 1
add esp, 0x82c
pop esi
pop edi
pop ebx
pop ebp
ret