Function at 0x404970
Capabilities:
Get graphical window text
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x20
mov esi, dword [ebp + 8]
mov edx, dword [esi + 0x10]
cmp word [edx], 0
je 0x404bf0
mov eax, edx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x404990
sub eax, edx
sar eax, 1
mov dword [ebp - 0x14], eax
mov eax, dword [0x40c02c]
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetWindowTextLengthW]
lea ebx, [eax + 1]
sub esp, 4
lea edx, [ebx + ebx]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov edi, eax
test eax, eax
je 0x404ac7
mov dword [esp + 4], eax
mov eax, dword [0x40c02c]
mov dword [esp + 8], ebx
mov dword [esp], eax
call dword [sym.imp.user32.dll_GetWindowTextW]
lea eax, [ebp - 0x10]
sub esp, 0xc
mov dword [esp + 0xc], eax
mov eax, dword [0x40c02c]
mov dword [esp + 8], 0
mov dword [esp], eax
mov eax, dword [sym.imp.user32.dll_SendMessageW]
mov dword [esp + 4], 0xb0
mov dword [ebp - 0x1c], eax
call eax
mov eax, dword [esi + 0xc]
sub esp, 0x10
and eax, 5
cmp eax, 4
je 0x404ad0
cmp eax, 5
je 0x404b40
test eax, eax
je 0x404b60
cmp eax, 1
jne 0x404ac7
mov eax, dword [esi + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
lea eax, [edi + eax*2]
mov dword [esp], eax
call dword [sym.imp.shlwapi.dll_StrStrIW]
sub esp, 8
mov ebx, eax
mov eax, ebx
mov dword [esp + 8], edi
sub eax, edi
mov dword [esp + 4], 0
sar eax, 1
mov dword [ebp - 0x10], eax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
test ebx, ebx
je 0x404bc0
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], 0xb1
add eax, edx
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov eax, dword [0x40c02c]
mov dword [esp], eax
mov eax, dword [ebp - 0x1c]
call eax
sub esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [esi + 0x10]
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
add eax, eax
cmp word [ecx], 0
mov ebx, ecx
je 0x404af1
lea esi, [esi]
nop
add ebx, 2
cmp word [ebx], 0
jne 0x404ae8
sub ebx, ecx
sar ebx, 1
mov dword [ebp - 0x18], ebx
lea ebx, [edi + eax - 2]
cmp edi, ebx
ja 0x404b93
mov dword [ebp + 8], esi
mov esi, ecx
jmp 0x404b17
sub ebx, 2
cmp edi, ebx
ja 0x404b90
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 8], eax
call dword [sym.imp.shlwapi.dll_StrCmpNW]
sub esp, 0xc
test eax, eax
jne 0x404b10
mov esi, dword [ebp + 8]
jmp 0x404a6a
mov eax, dword [esi + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
lea eax, [edi + eax*2]
mov dword [esp], eax
call dword [sym.imp.shlwapi.dll_StrStrW]
sub esp, 8
mov ebx, eax
jmp 0x404a6a
mov eax, dword [esi + 0x10]
mov dword [esp], edi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
lea eax, [edi + eax*2]
mov dword [esp + 4], eax
call dword [sym.imp.shlwapi.dll_StrRStrIW]
sub esp, 0xc
mov ebx, eax
jmp 0x404a6a
mov esi, dword [ebp + 8]
mov eax, edi
mov dword [esp + 8], edi
neg eax
mov dword [esp + 4], 0
sar eax, 1
mov dword [ebp - 0x10], eax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov dword [esp + 0xc], 0x40
mov eax, dword [esi + 0x10]
mov dword [esp + 4], 0x17b
mov dword [esp + 8], eax
mov eax, dword [0x40c028]
mov dword [esp], eax
call fcn.00402120
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x14], 0
jmp 0x4049a0