Function at 0x407586
Capabilities:
Get graphical window text

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x15c8
call fcn.00416b40
call sub.USER32.dll_GetForegroundWindow
mov dword [0x45f0f8], eax
sub esp, 4
push 0x206
push 0
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll_memset
add esp, 0x10
mov dword [0x45f1b8], 0
cmp dword [0x45f0f8], 0
jne 0x40762d
cmp dword [0x45f100], 0
je 0x4075f9
sub esp, 8
push 0x440540
sub esp, 0xc
push str.GetForegroundWindow:_NULL__sending_pid:0
push dword [0x45f10c]
call fcn.004417d8
add esp, 0x14
push eax
call fcn.00430ae0
add esp, 0x10
sub esp, 8
push str.__pid:0__n
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0x10
sub esp, 0xc
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll__strdup
add esp, 0x10
mov dword [ebp - 0x15bc], eax
jmp 0x407871
cmp dword [ebp + 8], 0
je 0x4076d3
sub esp, 4
push 0x200
lea eax, [ebp - 0x1428]
push eax
push dword [0x45f0f8]
call sub.USER32.dll_GetWindowTextW
add esp, 4
mov dword [ebp - 0x15ac], eax
cmp dword [0x45f108], 0
je 0x40767d
sub esp, 0xc
lea eax, [ebp - 0x1428]
push eax
call fcn.004051a2
add esp, 0x10
mov dword [ebp - 0x15b4], eax
jmp 0x407687
mov dword [ebp - 0x15b4], 0xffffffff
sub esp, 8
mov eax, dword [ebp - 0x15ac]
add eax, eax
push eax
lea eax, [ebp - 0x1428]
push eax
call fcn.00406b30
add esp, 0x10
mov dword [ebp - 0x15b0], eax
sub esp, 8
push dword [ebp - 0x15b0]
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll_strcpy
add esp, 0x10
sub esp, 0xc
push dword [ebp - 0x15b0]
call sub.msvcrt.dll_free
add esp, 0x10
jmp 0x4076f6
sub esp, 4
push 0x200
lea eax, [ebp - 0x1428]
push eax
push dword [0x45f0f8]
call sub.USER32.dll_GetWindowTextA
add esp, 4
mov dword [ebp - 0x15ac], eax
sub esp, 4
push dword [ebp - 0x15b4]
push str.__ld
lea eax, [ebp - 0x1528]
push eax
call sub.msvcrt.dll_sprintf
add esp, 0x10
sub esp, 8
lea eax, [ebp - 0x1528]
push eax
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll_strcat
add esp, 0x10
cmp dword [0x45f100], 0
je 0x4077bd
sub esp, 8
push 0x440540
sub esp, 0xc
push str._characters_as_window_text
sub esp, 0xc
push dword [ebp - 0x15ac]
sub esp, 0xc
push str._tgot
push dword [0x45f10c]
call fcn.004417d8
add esp, 0x14
push eax
call fcn.004318b0
add esp, 0x14
push eax
call fcn.004417d8
add esp, 0x14
push eax
call fcn.00430ae0
add esp, 0x10
sub esp, 8
push 0x440540
sub esp, 0xc
lea eax, [ebp - 0x1428]
push eax
sub esp, 0xc
push 0x44696f
push dword [0x45f10c]
call fcn.004417d8
add esp, 0x14
push eax
call fcn.004417d8
add esp, 0x14
push eax
call fcn.00430ae0
add esp, 0x10
sub esp, 8
lea eax, [ebp - 0x15b8]
push eax
push dword [0x45f0f8]
call sub.USER32.dll_GetWindowThreadProcessId
add esp, 8
mov eax, dword [ebp - 0x15b8]
mov dword [0x45f1b8], eax
cmp dword [0x45f100], 0
je 0x407822
sub esp, 8
push 0x440540
sub esp, 0xc
push dword [ebp - 0x15b8]
sub esp, 0xc
push str._tpid:
push dword [0x45f10c]
call fcn.004417d8
add esp, 0x14
push eax
call fcn.00431ca0
add esp, 0x14
push eax
call fcn.00430ae0
add esp, 0x10
push dword [ebp - 0x15b8]
push str.__pid:_lu__n
push 0x78
lea eax, [ebp - 0x15a8]
push eax
call fcn.00417200
add esp, 0x10
sub esp, 4
push 0x78
lea eax, [ebp - 0x15a8]
push eax
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll_strncat
add esp, 0x10
sub esp, 0xc
lea eax, [ebp - 0x1428]
push eax
call sub.msvcrt.dll__strdup
add esp, 0x10
mov dword [ebp - 0x15bc], eax
mov eax, dword [ebp - 0x15bc]
leave
ret