Function at 0x40cc51
Capabilities:
Get graphical window text

Disassembly:
sub esp, 0x850
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x14]
mov ebx, ecx
push eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x28], ebx
push eax
push dword [esp + 0x870]
call fcn.0040c61a
mov esi, dword [esp + 0x864]
mov byte [esp + 0x13], al
lea eax, [esp + 0x30]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowRect]
lea eax, [esp + 0x50]
push eax
push esi
call dword [sym.imp.USER32.dll_GetClientRect]
mov ecx, dword [esp + 0x38]
sub ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x3c]
inc ecx
sub edi, dword [esp + 0x34]
mov edx, ecx
mov eax, dword [esp + 0x58]
inc edi
mov ebp, edi
mov dword [esp + 0x28], 0x64
sub ebp, dword [esp + 0x5c]
sub edx, eax
cmp byte [esp + 0x13], 0
mov dword [esp + 0x2c], edx
je 0x40cd6c
cmp byte [esp + 0x86c], 0
jne 0x40cdae
imul eax, dword [esp + 0x18]
push 0x64
pop ebx
cdq
idiv ebx
mov ebx, eax
mov eax, dword [esp + 0x5c]
imul eax, dword [esp + 0x14]
add ebx, dword [esp + 0x2c]
sub ecx, ebx
mov dword [esp + 0x1c], ebx
cdq
idiv dword [esp + 0x28]
add eax, ebp
mov dword [esp + 0x20], eax
mov eax, ecx
sub edi, dword [esp + 0x20]
cdq
sub eax, edx
mov ebx, eax
mov eax, edi
cdq
sub eax, edx
sar ebx, 1
mov edi, eax
sar edi, 1
add edi, dword [esp + 0x34]
add ebx, dword [esp + 0x30]
jns 0x40cd2c
xor ebx, ebx
test edi, edi
jns 0x40cd32
xor edi, edi
push 0xfffffffffffffff0
push esi
call dword [sym.imp.USER32.dll_GetWindowLongW]
shr eax, 0xa
not eax
and eax, 2
or eax, 0x204
push eax
push dword [esp + 0x24]
push dword [esp + 0x24]
push edi
push ebx
push 0
push esi
call dword [sym.imp.USER32.dll_SetWindowPos]
lea eax, [esp + 0x30]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowRect]
mov ebx, dword [esp + 0x24]
cmp byte [esp + 0x86c], 0
jne 0x40cdae
push 0x400
lea eax, [esp + 0x64]
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowTextW]
push dword [esp + 0x868]
lea eax, [esp + 0x64]
mov ecx, ebx
push 1
push 0x400
push eax
push eax
call fcn.0040c6ab
lea eax, [esp + 0x60]
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 0x40cea7
cmp ebx, 0x200
jge 0x40ceaf
mov esi, 0x400
lea eax, [esp + 0x60]
push esi
push eax
push edi
call dword [sym.imp.USER32.dll_GetWindowTextW]
cmp word [esp + 0x60], 0
je 0x40ce19
push dword [esp + 0x868]
mov ecx, dword [esp + 0x28]
lea eax, [esp + 0x64]
push 1
push esi
push eax
push eax
call fcn.0040c6ab
lea eax, [esp + 0x60]
push eax
push edi
call dword [sym.imp.USER32.dll_SetWindowTextW]
cmp byte [esp + 0x13], 0
je 0x40ce95
lea eax, [esp + 0x40]
push eax
push edi
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x44]
sub eax, ecx
inc eax
sub ecx, ebp
imul eax, dword [esp + 0x14]
push 0x204
push 0x64
pop esi
sub ecx, dword [esp + 0x38]
cdq
idiv esi
mov esi, dword [esp + 0x44]
push eax
mov eax, dword [esp + 0x50]
sub eax, esi
imul ecx, dword [esp + 0x1c]
inc eax
imul eax, dword [esp + 0x20]
cdq
idiv dword [esp + 0x30]
push eax
push 0x64
mov eax, ecx
cdq
pop ecx
idiv ecx
push eax
mov eax, dword [esp + 0x3c]
cdq
sub eax, edx
sar eax, 1
sub esi, eax
sub esi, dword [esp + 0x40]
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 0x40ceaf
inc ebx
test edi, edi
jne 0x40cdce
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x850
ret 0xc