申明:本程序参看了"非安全"的QQ性别修改器的汇编代码.表示感谢.
主要代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;//下面要调用非托管代码
namespace QQ性别修改器
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr parentHandle, int childAfter, string className, int windowTitle);
[DllImport("user32.dll", EntryPoint = "SendMessage")]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, string lParam);
IntPtr hwnd, hwnd1, hwnd2, hwnd3, hwnd4, hwnd5,idx;
public Form1()
{
InitializeComponent();
}
unsafe private void button1_Click(object sender, EventArgs e)//修改性别按钮
{
if (this.textBox1.Text.Length != 1)
{
MessageBox.Show("必须是一个汉字","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
if (FindWindow("#32770", "QQ2007设置").ToInt32() == 0)
{
MessageBox.Show("请先打开QQ个人设置窗口", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
byte[] ls = new byte[10];
hwnd = FindWindow("#32770", "QQ2007设置");
hwnd1 = FindWindowEx(hwnd, 0, "#32770", 0);
hwnd2 = FindWindowEx(hwnd1, 0, "#32770", 0);
hwnd3 = GetDlgItem(hwnd2, 1356);
hwnd4 = GetDlgItem(hwnd2, 1345);
hwnd5 = GetDlgItem(hwnd1, 1343);
idx = SendMessage(hwnd3, 323, 0, this.textBox1.Text);
SendMessage(hwnd3, 334, idx.ToInt32(), Convert.ToString(0));
SendMessage(hwnd4,13,10,this.textBox1.Text);
SendMessage(hwnd4,12,0,this.textBox1.Text);
SendMessage(hwnd5, 245, 0, Convert.ToString(0));
}
}
}
}
}
[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法