Function at 0x40ca90
Capabilities:
Get graphical window text

Disassembly:
sub esp, 0x854
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x14]
mov ebx, ecx
push eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x2c], ebx
push eax
push dword [esp + 0x874]
call fcn.0040c458
mov esi, dword [esp + 0x868]
mov byte [esp + 0x13], al
lea eax, [esp + 0x34]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowRect]
lea eax, [esp + 0x54]
push eax
push esi
call dword [sym.imp.USER32.dll_GetClientRect]
mov ecx, dword [esp + 0x3c]
sub ecx, dword [esp + 0x34]
mov edi, dword [esp + 0x40]
inc ecx
sub edi, dword [esp + 0x38]
mov edx, ecx
mov eax, dword [esp + 0x5c]
inc edi
mov ebp, edi
mov dword [esp + 0x2c], 0x64
sub ebp, dword [esp + 0x60]
sub edx, eax
cmp byte [esp + 0x13], 0
mov dword [esp + 0x30], edx
je 0x40cbb9
cmp byte [esp + 0x870], 0
jne 0x40cbfb
imul eax, dword [esp + 0x18]
push 0x64
pop ebx
cdq
idiv ebx
mov ebx, eax
mov eax, dword [esp + 0x60]
imul eax, dword [esp + 0x14]
add ebx, dword [esp + 0x30]
sub ecx, ebx
mov dword [esp + 0x1c], ebx
cdq
idiv dword [esp + 0x2c]
add eax, ebp
mov dword [esp + 0x20], eax
mov eax, ecx
sub edi, dword [esp + 0x20]
cdq
sub eax, edx
mov ecx, eax
mov eax, edi
cdq
sub eax, edx
sar ecx, 1
add ecx, dword [esp + 0x34]
mov edi, eax
sar edi, 1
add edi, dword [esp + 0x38]
mov dword [esp + 0x24], ecx
test ecx, ecx
jns 0x40cb74
and dword [esp + 0x24], 0
test edi, edi
jns 0x40cb7a
xor edi, edi
push 0xfffffffffffffff0
push esi
mov ebx, 0x204
call dword [sym.imp.USER32.dll_GetWindowLongW]
test eax, 0x800
jne 0x40cb92
add ebx, 2
push ebx
push dword [esp + 0x24]
push dword [esp + 0x24]
push edi
push dword [esp + 0x34]
push 0
push esi
call dword [sym.imp.USER32.dll_SetWindowPos]
lea eax, [esp + 0x34]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowRect]
mov ebx, dword [esp + 0x28]
cmp byte [esp + 0x870], 0
jne 0x40cbfb
push 0x400
lea eax, [esp + 0x68]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowTextW]
push dword [esp + 0x86c]
lea eax, [esp + 0x68]
mov ecx, ebx
push 1
push 0x400
push eax
push eax
call fcn.0040c4e9
lea eax, [esp + 0x64]
push eax
push esi
call dword [sym.imp.USER32.dll_SetWindowTextW]
push 8
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push 5
push esi
sub ebp, eax
call dword [sym.imp.USER32.dll_GetWindow]
mov edi, eax
xor ebx, ebx
mov dword [esp + 0x1c], edi
jmp 0x40ccf4
cmp ebx, 0x200
jge 0x40ccfc
mov esi, 0x400
lea eax, [esp + 0x64]
push esi
push eax
push edi
call dword [sym.imp.USER32.dll_GetWindowTextW]
cmp word [esp + 0x64], 0
je 0x40cc66
push dword [esp + 0x86c]
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x68]
push 1
push esi
push eax
push eax
call fcn.0040c4e9
lea eax, [esp + 0x64]
push eax
push edi
call dword [sym.imp.USER32.dll_SetWindowTextW]
cmp byte [esp + 0x13], 0
je 0x40cce2
lea eax, [esp + 0x44]
push eax
push edi
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x48]
sub eax, ecx
inc eax
sub ecx, ebp
imul eax, dword [esp + 0x14]
push 0x204
push 0x64
pop esi
sub ecx, dword [esp + 0x3c]
cdq
idiv esi
mov esi, dword [esp + 0x48]
push eax
mov eax, dword [esp + 0x54]
sub eax, esi
imul ecx, dword [esp + 0x1c]
inc eax
imul eax, dword [esp + 0x20]
cdq
idiv dword [esp + 0x34]
push eax
push 0x64
mov eax, ecx
cdq
pop ecx
idiv ecx
push eax
mov eax, dword [esp + 0x40]
cdq
sub eax, edx
sar eax, 1
sub esi, eax
sub esi, dword [esp + 0x44]
imul esi, dword [esp + 0x28]
mov eax, esi
cdq
idiv ecx
push eax
push 0
push edi
call dword [sym.imp.USER32.dll_SetWindowPos]
push 2
push edi
call dword [sym.imp.USER32.dll_GetWindow]
mov edi, eax
cmp edi, dword [esp + 0x1c]
je 0x40ccfc
inc ebx
test edi, edi
jne 0x40cc1b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x854
ret 0xc