分类: 源码

利用Nvidia的API设置数字振动数值源码_显示器亮度、对比度等设置源码

开始是一位朋友有这个需求,他给了我一个英伟达官网的开发包,名字是:R410-developer.zip(诸位可以自己到英伟达官网下载),里面提供了一些示例,包含自定义分辨率、显示器颜色设置等,但是显示器色彩设置的例子一致没有跑通,而且我也没有找到哪个参数是可以设置数字振动值的,所以憋屈了很多天。但直到看到了一个 AHK 版本实现的设置工具通过代码发现,其实实现方法是通过 nvapi.dll 动态库导出的一个查询函数地址的方法,将指定接口导出来执行具体业务。在加上在 github 上搜索的各类示例,最终实现了这个功能,下面详细介绍实现步骤。 需要的方法和结构设置数字振动数值需要先通过 nvapi.dll 导出的 NvAPI_QueryInterface_t 方法获取 NvAPI_Initialize_t 方法来初始化 NvAPI。然后依次获取显示器句柄、获取当前显示器数字振动值、设置数字振动值的函数地址,他们的声明分别对应如下:12345678910// 查询在 nvapi.dll 中函数的地址方法函数声明typedef int*(*NvAPI_QueryInterface_t)(unsigned int offset);// 初始化 NvAPI 的方法typedef int(*NvAPI_Initialize_t)();// 根据 ID 枚举显示器句柄的方法typedef int(*NvAPI_EnumNvidiaDisplayHandle_t)(int thisEnum, int* pNvDispHandle);// 获取数字振动当前值typedef int(*NvAPI_GetDVCInfoEx_t)(int hNvDisplay, int outputId, NV_DISPLAY_DVC_INFO_EX* pDVCInfo);// 设置数字振动值typedef int(*NvAPI_SetDVCLevelEx_t)(int hNvDisplay, int outputId, NV_DISPLAY_DVC_INFO_EX* pDVCInfo); 其中设置和获取数字振动值需要一个结构体 NV_DISPLAY_DVC_INFO_EX,其声明如下:12345678typedef struct{ unsigned int version; // 结构体版本 int currentLevel; // 当前级别 int minLevel; // 最低级别 int maxLevel; // 最高级别 int defaultLevel; // 默认级别} NV_DISPLAY_DVC_INFO_EX, *PNV_DISPLAY_DVC_INFO_EX; 获取各个接口地址我们首先 Load nvapi.dll 然后得到 nvapi_QueryInterface 方法的地址,然后通过 nvapi_QueryInterface 方法查询另外一些接口的地址。如下所示:123456789101112131415161718192021222324bool NvController::Initialize(){ hModule = LoadLibraryW(TEXT("nvapi.dll")); if (hModule == nullptr) { std::cerr << "Failed to load nvapi.dll." << std::endl; return false; } NvAPI_QueryInterface = (NvAPI_QueryInterface_t)GetProcAddress(hModule, "nvapi_QueryInterface"); NvAPI_Initialize = (NvAPI_Initialize_t)(*NvAPI_QueryInterface)(_NvAPI_Initialize); NvAPI_EnumNvidiaDisplayHandle = (NvAPI_EnumNvidiaDisplayHandle_t)(*NvAPI_QueryInterface)(_NvAPI_EnumNvidiaDisplayHandle); NvAPI_GetDVCInfoEx = (NvAPI_GetDVCInfoEx_t)(*NvAPI_QueryInterface)(_NvAPI_GetDVCInfoEx); NvAPI_SetDVCLevelEx = (NvAPI_SetDVCLevelEx_t)(*NvAPI_QueryInterface)(_NvAPI_SetDVCLevelEx); _NvAPI_Status status = (_NvAPI_Status)(*NvAPI_Initialize)(); if (status != NVAPI_OK) { std::cerr << "NvAPI initialization failed." << std::endl; return false; } return true;} 其中以下划线开头的枚举名字是每个函数在 dll 中的对应地址,这些是写死的,如下所示:12345678enum NvAPIs{ _NvAPI_Initialize = 0x150E828, _NvAPI_EnumNvidiaDisplayHandle = 0x9ABDD40D, _NvAPI_GetAssociatedNvidiaDisplayName = 0x22A78B05, _NvAPI_GetDVCInfoEx = 0x0E45002D, _NvAPI_SetDVCLevelEx = 0x4A82C2B1}; 你可能会问,你怎么知道这些函数地址的?其实我也是搜索到的,也看了以前 NvAPI 老版本提供的代码,可以搜索到相关痕迹。点击查看此文件里面有完整的所有函数地址。 获取和设置数字振动得到了各个函数的地址,我们就可以设置数字振动值了,代码如下:12345678910111213141516171819202122232425bool NvController::SetDVCLevelEx(int nDisp, int level){ int NvDispHandle; if (EnumNvidiaDisplayHandle(nDisp, &NvDispHandle) != 0) { NV_DISPLAY_DVC_INFO_EX oldInfo = GetDvcInfoEx(nDisp); NV_DISPLAY_DVC_INFO_EX info; info.version = oldInfo.version; info.currentLevel = level; info.minLevel = oldInfo.minLevel; info.maxLevel = oldInfo.maxLevel; info.defaultLevel = oldInfo.defaultLevel; _NvAPI_Status status = (_NvAPI_Status)(*NvAPI_SetDVCLevelEx)(NvDispHandle, 0, &info); if (status != NVAPI_OK) { return false; } return true; } return false;} 我们首先获得用户传入的显示器编号所对应的句柄,然后根据这个句柄获取当前数字振动的数值,然后修改其 currentLevel 成员数值来设置数字振动效果。这样处理后就可以使用了。完整代码参考地址:https://github.com/nmgwddj/nvapi-example 转载自https://cloud.tencent.com/developer/article/13715644. 屏幕亮度,对比度获取和调节 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960bool set_screen_brightness(long val){ HWND hDesktopWnd = GetDesktopWindow(); HMONITOR hMonitor = MonitorFromWindow(hDesktopWnd, MONITOR_DEFAULTTOPRIMARY); DWORD cPhysicalMonitors = 0; if (!GetNumberOfPhysicalMonitorsFromHMONITOR(hMonitor, &cPhysicalMonitors)) return false; LPPHYSICAL_MONITOR pPhysicalMonitors = (LPPHYSICAL_MONITOR)malloc(cPhysicalMonitors* sizeof(PHYSICAL_MONITOR)); if (pPhysicalMonitors) { GetPhysicalMonitorsFromHMONITOR(hMonitor, cPhysicalMonitors, pPhysicalMonitors); //设置屏幕亮度 SetMonitorBrightness(pPhysicalMonitors->hPhysicalMonitor, val); //设置屏幕对比度 //SetMonitorContrast(pPhysicalMonitors->hPhysicalMonitor, val); // Close the monitor handles. DestroyPhysicalMonitors(cPhysicalMonitors, pPhysicalMonitors); // Free the array. free(pPhysicalMonitors); } return true;}long get_screen_brightness(){ long lret = -1; HWND hDesktopWnd = GetDesktopWindow(); HMONITOR hMonitor = MonitorFromWindow(hDesktopWnd, MONITOR_DEFAULTTOPRIMARY); DWORD dwMin = 0, dwMax = 0, dwCur = 0; DWORD cPhysicalMonitors = 0; if (!GetNumberOfPhysicalMonitorsFromHMONITOR(hMonitor, &cPhysicalMonitors)) return false; LPPHYSICAL_MONITOR pPhysicalMonitors = (LPPHYSICAL_MONITOR)malloc(cPhysicalMonitors* sizeof(PHYSICAL_MONITOR)); if (pPhysicalMonitors) { GetPhysicalMonitorsFromHMONITOR(hMonitor, cPhysicalMonitors, pPhysicalMonitors); //获取屏幕对比度 //if (GetMonitorContrast(pPhysicalMonitors->hPhysicalMonitor, &dwMin, &dwCur, &dwMax)) //获取屏幕亮度 if (GetMonitorBrightness(pPhysicalMonitors->hPhysicalMonitor, &dwMin, &dwCur, &dwMax)) { lret = dwCur; } //SetMonitorContrast(pPhysicalMonitors->hPhysicalMonitor, val); // Close the monitor handles. DestroyPhysicalMonitors(cPhysicalMonitors, pPhysicalMonitors); // Free the array. free(pPhysicalMonitors); } return lret;} 屏幕色彩灰度调节(Gamma调节)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// #pragma pack(push, 4)// typedef struct _tagD3dGammaramp_t// {// WORD red[256];// WORD green[256];// WORD blue[256];// }D3DGAMMARAMP, *LPD3DGAMMARAMP;// #pragma pack(pop)class CScreenDC{public: CScreenDC(){ m_hdc = GetDC(NULL); } ~CScreenDC(){ if (m_hdc) ReleaseDC(NULL, m_hdc); m_hdc = NULL; } operator HDC(){ return m_hdc; }private: HDC m_hdc;};bool set_screen_gray(long val){ //HDC的对比度 val = min(100, val); val = max(0, val); val = val*128.0 / 100; /* bright >=0 && bright <= 128 */ CScreenDC hScreenDc; D3DGAMMARAMP Ramp = { 0 }; BOOL bret = GetDeviceGammaRamp(hScreenDc, &Ramp); if (!bret) return false; for (int iIndex = 0; iIndex < 256; iIndex++) { //bright 为什么需要+128,因为当 bring < 128 的时候效果同bright = 0 Ramp.red[iIndex] = min(65535, iIndex * (val + 128)); Ramp.green[iIndex] = min(65535, iIndex * (val + 128)); Ramp.blue[iIndex] = min(65535, iIndex * (val + 128)); } bret = SetDeviceGammaRamp(hScreenDc, &Ramp); return bret ? true:false;}long get_screen_gray(){ CScreenDC hScreenDc; D3DGAMMARAMP Ramp = { 0 }; BOOL bret = GetDeviceGammaRamp(hScreenDc, &Ramp); if (!bret) return -1; long bright = Ramp.red[1] - 128; bright = bright * 100.0 / 128; bright = min(100, bright); bright = max(0, bright); return bright;} 鼠标移动速度调节123456789101112131415161718bool set_mousemove_speed(long val){ //其接收范围在1(最慢)和20(最快)之间的值。值为10是 val = min(20, val); val = max(1, val); BOOL bret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (LPVOID)val, SPIF_UPDATEINIFILE || SPIF_SENDCHANGE || SPIF_SENDWININICHANGE); if (!bret) return false; return true;}long get_mousemove_speed(){ int nSpeed = 0; BOOL bret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &nSpeed, 0); if (!bret) return -1; return nSpeed;} 鼠标双击速度调节1234567891011121314151617181920//方法1:SystemParametersInfo(SPI_SETDOUBLECLICKTIME....bool set_mousedbclick_speed(long val){ //最快200ms 最慢 900ms 间隔70ms //SPI_SETDOUBLECLICKTIME val = 550 - (val - 10) * 35; val = min(900, val); val = max(200, val); BOOL bret = SetDoubleClickTime(val); if (!bret) return false; return true;}UINT get_mousedbclick_speed(){ UINT ival = GetDoubleClickTime(); ival = (ival - 550) / 35 + 10; return ival;} 转自 https://blog.csdn.net/CAir2/article/details/103897288 华夏网盟的成品下载 链接:https://share.weiyun.com/GJUzRJLE 密码:6jaisr

实现QQ8.0和QQ9.0登录界面动态背景效果

QQ8.0和QQ9.0登录界面的头部动态背景非常有个性,如何实现的呢? QQ8.0的登录界面效果,使用的JS和html5实现!就是QQ登录界面的这张图片最终的效果如下:123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229<!DOCTYPE html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>html5背景</title> <style type="text/css"> *{margin:0;padding:0;list-style-type:none;} a,img{border:0;} </style> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script></head><body><div id="container" style="width:100%;height:700px;"> <div id="anitOut"></div></div><script type="text/javascript">$(function () { if (!window.ActiveXObject && !!document.createElement("canvas").getContext) { $.getScript("cav.js", function () { var t = { width: 1.5, height: 1.5, depth: 10, segments: 12, slices: 6, xRange: 0.8, yRange: 0.1, zRange: 1, ambient: "#525252", diffuse: "#FFFFFF", speed: 0.0002 }; var G = { count: 2, xyScalar: 1, zOffset: 100, ambient: "#002c4a", diffuse: "#005584", speed: 0.001, gravity: 1200, dampening: 0.95, minLimit: 10, maxLimit: null, minDistance: 20, maxDistance: 400, autopilot: false, draw: false, bounds: CAV.Vector3.create(), step: CAV.Vector3.create(Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1)) }; var m = "canvas"; var E = "svg"; var x = { renderer: m }; var i, n = Date.now(); var L = CAV.Vector3.create(); var k = CAV.Vector3.create(); var z = document.getElementById("container"); var w = document.getElementById("anitOut"); var D, I, h, q, y; var g; var r; function C() { F(); p(); s(); B(); v(); K(z.offsetWidth, z.offsetHeight); o() } function F() { g = new CAV.CanvasRenderer(); H(x.renderer) } function H(N) { if (D) { w.removeChild(D.element) } switch (N) { case m: D = g; break } D.setSize(z.offsetWidth, z.offsetHeight); w.appendChild(D.element) } function p() { I = new CAV.Scene() } function s() { I.remove(h); D.clear(); q = new CAV.Plane(t.width * D.width, t.height * D.height, t.segments, t.slices); y = new CAV.Material(t.ambient, t.diffuse); h = new CAV.Mesh(q, y); I.add(h); var N, O; for (N = q.vertices.length - 1; N >= 0; N--) { O = q.vertices[N]; O.anchor = CAV.Vector3.clone(O.position); O.step = CAV.Vector3.create(Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1), Math.randomInRange(0.2, 1)); O.time = Math.randomInRange(0, Math.PIM2) } } function B() { var O, N; for (O = I.lights.length - 1; O >= 0; O--) { N = I.lights[O]; I.remove(N) } D.clear(); for (O = 0; O < G.count; O++) { N = new CAV.Light(G.ambient, G.diffuse); N.ambientHex = N.ambient.format(); N.diffuseHex = N.diffuse.format(); I.add(N); N.mass = Math.randomInRange(0.5, 1); N.velocity = CAV.Vector3.create(); N.acceleration = CAV.Vector3.create(); N.force = CAV.Vector3.create() } } function K(O, N) { D.setSize(O, N); CAV.Vector3.set(L, D.halfWidth, D.halfHeight); s() } function o() { i = Date.now() - n; u(); M(); requestAnimationFrame(o) } function u() { var Q, P, O, R, T, V, U, S = t.depth / 2; CAV.Vector3.copy(G.bounds, L); CAV.Vector3.multiplyScalar(G.bounds, G.xyScalar); CAV.Vector3.setZ(k, G.zOffset); for (R = I.lights.length - 1; R >= 0; R--) { T = I.lights[R]; CAV.Vector3.setZ(T.position, G.zOffset); var N = Math.clamp(CAV.Vector3.distanceSquared(T.position, k), G.minDistance, G.maxDistance); var W = G.gravity * T.mass / N; CAV.Vector3.subtractVectors(T.force, k, T.position); CAV.Vector3.normalise(T.force); CAV.Vector3.multiplyScalar(T.force, W); CAV.Vector3.set(T.acceleration); CAV.Vector3.add(T.acceleration, T.force); CAV.Vector3.add(T.velocity, T.acceleration); CAV.Vector3.multiplyScalar(T.velocity, G.dampening); CAV.Vector3.limit(T.velocity, G.minLimit, G.maxLimit); CAV.Vector3.add(T.position, T.velocity) } for (V = q.vertices.length - 1; V >= 0; V--) { U = q.vertices[V]; Q = Math.sin(U.time + U.step[0] * i * t.speed); P = Math.cos(U.time + U.step[1] * i * t.speed); O = Math.sin(U.time + U.step[2] * i * t.speed); CAV.Vector3.set(U.position, t.xRange * q.segmentWidth * Q, t.yRange * q.sliceHeight * P, t.zRange * S * O - S); CAV.Vector3.add(U.position, U.anchor) } q.dirty = true } function M() { D.render(I) } function J(O) { var Q, N, S = O; var P = function (T) { for (Q = 0, l = I.lights.length; Q < l; Q++) { N = I.lights[Q]; N.ambient.set(T); N.ambientHex = N.ambient.format() } }; var R = function (T) { for (Q = 0, l = I.lights.length; Q < l; Q++) { N = I.lights[Q]; N.diffuse.set(T); N.diffuseHex = N.diffuse.format() } }; return { set: function () { P(S[0]); R(S[1]) } } } function v() { window.addEventListener("resize", j) } function A(N) { CAV.Vector3.set(k, N.x, D.height - N.y); CAV.Vector3.subtract(k, L) } function j(N) { K(z.offsetWidth, z.offsetHeight); M() } C(); }) } else { alert('调用cav.js失败'); }});</script></body></html> 其中的cav.js下载地址:链接:https://share.weiyun.com/KDUzFY4R 密码:b5gvk3就这个cav.js,以前是腾讯官方的地址,即http://im-img.qq.com/pcqq/js/200/cav.js?_=1428576021379 但现在已经失效了,百度搜索,到处是积分下载!拿着腾讯的东西赚积分!!! QQ9.0的登录界面梦幻的动画,实际为视频!QQ9.5登录界面的动态素材如下您的浏览器不支持HTML5的 video 标签,无法为您播放!

编程实现关闭显示器等的python源代码-等同于按显示器的电源键

可实现功能通过显示器的 DDC/CI 来直接操作显示器,拯救可怜的显示器按键。 支持的操作: 调整亮度 调整对比度 设置色温 / 颜色预设 设置RGB颜色的比例 OSD语言 开关机 切换输入源 自动调整图像 (VGA输入需要) 恢复出厂设置 系统需求Windows Vista +Python3 (建议安装时选上Python Launcher)支持DDC/CI的外接显示器,不支持笔记本内置显示器 使用参考GUI 模式不附加参数启动 monitor_ctrl.py 即可启动GUI,直接拖动滑条设置显示器的参数。 由于显示器应用VCP指令可能需要一定时间,为避免出错,GUI模式将忽略命令行指定的操作。 GUI中显示的配置不会自动刷新,要查看新的配置目前需要重启应用程序。 将文件后缀修改为 .pyw, 直接双击打开,可以避免显示conhost黑窗口 命令行模式当指定 -c 选项或者 tkinter import失败就会使用CLI模式。 py monitor_ctrl.py [-h] [-m Model_string] [-s Settings_string] [-r] [-t] [-c] [-l] [-v] -h 显示帮助 -m 指定要应用到的Monitor Model,不指定则应用到所有可操作的显示器 -s property1=value1:property2=”value 2” 应用多项设置 -r 将显示器恢复出厂设置 -t 对输入执行自动调整(仅VGA输入需要) -c 不启用GUI -l 显示可操作的显示器model -v Verbose logging

实现GiteePages自动部署的aardio源码

问题的由来github提供开源项目管理,同时提供静态网站github page,但国内访问速度很慢,经常打不开,gitee码云在国内,提供和github一样的功能,但gitee page每次推送文件后,不会自动刷新(免费版),必须手动刷新!网上已有提供python自动刷新Gitee Pages的源码! python自动部署Gitee Pages源码 python环境要求python3 + selenium + chromedrive.exe。 先安装好python3(最好设置好国内镜像源,不然安装库,因墙的缘故可能失败) 再安装好selenium库pip install seleniumpip install Alert 下载chrome对应的chromedriver 2.python源码 123456789101112131415161718192021222324252627import timefrom selenium import webdriverfrom selenium.webdriver.common.alert import Alertoption = webdriver.ChromeOptions()#指定chrome浏览器option.binary_location=r'D:\Program Files\CentBrowser64\chrome.exe'#指定chromedriver和chrome版本要匹配driver = webdriver.Chrome(r'D:\Program Files\CentBrowser64\chromedriver.exe')driver.get('https://gitee.com/login')driver.maximize_window()time.sleep(2)user_login = driver.find_element_by_id('user_login')user_login.send_keys("gitee的用户名")driver.find_element_by_id('user_password').send_keys("gitee的登录密码")driver.find_element_by_xpath('/html/body/div[2]/div[2]/div/div[1]/div[2]/div[1]/form[1]/div/div/div/div[4]/input').click()time.sleep(2)driver.get('https://gitee.com/此处改为you_gitee_id/此处改为you_gitee_id/pages')driver.find_element_by_xpath('/html/body/div[3]/div[2]/div/div[2]/div/form/div[6]').click()Alert(driver).accept()time.sleep(5)print("成功")driver.quit()fp = open("D:\log.txt", "a+")now_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())fp.write("部署时间:{0}\n".format(now_time))fp.close() 提供此代码的开源项目地址:https://github.com/witmy/my-giteepages上面的代码修改了一下,指定了chrome浏览器地址和chromedriver的地址,这样就不会运行不了!特别适合小白! aardio自动部署Gitee Pages的源码python的代码,如果是新手,安装python,然后直接运行上面的源码,成功的机率很小,因为Chrome driver是需要浏览器和driver版本匹配的!上面的python源码,如果你不熟悉python,基本上调试不会成功!不过不要紧,下面我讲的,小白也会的aardio教程,一步一步复杂粘贴就能实现,你不需要会python,不需要会aardio,一样可以编译一个自动更新gitee pages的执行文件!

发现网卡变百兆自动发送邮件通知的AutoIt源码

问题的出现网吧维护中,由于交换机或水晶机或工艺上的问题,有些机器网卡正常的千兆会变成百兆,在无盘系统中启动机器或启动游戏变得很慢,用户体验相当不好!出现这个问题时,网管或维护却很难第一时间发现1000M变成100M的问题机器。以下是使用autoit3写的,发现任意网卡是100M,就会按mail.ini配置文件中指定的邮件发送邮件通知,让你第一时间发现这种网卡变100M的问题机器,及时进行处理! 把以下代码保存为au3脚本或编译为可执行文件后,需要在同目录下建一个mail.ini文件,内容如下[setup]FromAddress=发件人@qq.comtoaddress=收件人@qq.comusername=qq号password=QQ的smtp服务器提供的邮件授权码body=邮件正文内容 其中password内容,应该进入你的QQ邮箱开通smtp和取得授权码 使用方法设置好mainl.ini中的qq的smtp服务器的用户名及授权码等一切信息后,开机执行一次此代码就行,检测完成自动退出程序 autoit源码如下以下为autoit3实现发现任意一网卡是100M,自动根据设置的邮件发送邮件通知! 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #Include<file.au3>#NoTrayIcon$badlan=false$a = _GetAdaptersInfo() For $i = 1 To $a[0][0] $lSpeed=GetIfEntry($a[$i][3])if $lSpeed=100 then $badlan=true ExitLoopendifNextif $badlan=true then $SmtpServer = "smtp.qq.com" ; address for the smtp-server to use - REQUIRED $FromName = "发送人" ; name from who the email was sent $FromAddress = IniRead(@WorkingDir&"\mail.ini","setup","FromAddress","") $ToAddress = IniRead(@WorkingDir&"\mail.ini","setup","toaddress","") $Subject = @ComputerName&"号机器网卡为100M,请检查!" ; subject from the email - can be anything you want it to be ;$Body = "邮件正文" ; the messagebody from the mail - can be left blank but then you get a blank mail $Body = IniRead(@WorkingDir&"\mail.ini","setup","body","") $AttachFiles = "" ; the file you want to attach- leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = IniRead(@WorkingDir&"\mail.ini","setup","Username","") $Password = IniRead(@WorkingDir&"\mail.ini","setup","Password","") $IPPort = 465 ; port used for sending the mail $ssl = 1 $rc = _INetSmtpMailCom ( $SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl )endif;msgbox(0,"",$ToAddress)Func SetListView() $a = _GetAdaptersInfo() $index = ($a[1][3]) For $i = 1 To $a[0][0] GUICtrlCreateListViewItem($a[$i][1] & '|' & _ StringLeft(Hex($a[$i][2]), 12) & '|' & _ $a[$i][6] & '|' & _ GetIfEntry($a[$i][3]) & ' MB', $ListView1) Next EndFunc ;==>SetListView Func GetIfEntry($ifIndex) Local $tagBuffer, $tBuffer, $pBuffer, $iResult, $iSpeed, $sDescr $tagBuffer = "wchar[256];dword[5];byte[8];dword[16];char[256]" $tBuffer = DllStructCreate($tagBuffer) $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, 2, $ifIndex, 1) $iResult = DllCall("iphlpapi.dll", "long", "GetIfEntry", "ptr", $pBuffer) $iSpeed = DllStructGetData($tBuffer, 2, 4) / 1000 / 1000 $sDescr = DllStructGetData($tBuffer, 5) $tBuffer = 0 Return SetError($iResult[0], $iSpeed, $iSpeed) EndFunc ;==>GetIfEntry Func _GetAdaptersInfo() Local $iResult, $tBuffer, $pBuffer, $aResult[1][9], $tagADPTINFO, $tAdpt ; 第一次调用传递空值,pOutBufLen ( $iResult[2] ) 设为结构所需大小,单位byte。 $iResult = DllCall("iphlpapi.dll", "dword", "GetAdaptersInfo", "ptr", 0, "ulong*", 0) $tBuffer = DllStructCreate("byte[" & $iResult[2] & "]") ; 定义$iResult[2] 字节的缓存区域 (分配内存空间)。 $pBuffer = DllStructGetPtr($tBuffer) ; 获取内存指针。 ; 第二次调用,GetAdaptersInfo把网卡信息复制到指定的内存空间 ($tBuffer) 中。 $iResult = DllCall("iphlpapi.dll", "dword", "GetAdaptersInfo", "ptr", $pBuffer, "ulong*", $iResult[2]) ; $iResult[0]值为0则调用成功,否则为系统错误号。 ; 数据转换, byte --> IP_ADAPTER_INFO $tagADPTINFO = "ptr NextAdpt; dword ComboIndex; char AdptName[260]; char AdptDescr[132];uint AddrLength;byte MacAddr[8];dword Index;uint Type; uint DhcpEnabled;ptr CurrentIpAddr;ptr NextIpAddr; char IpAddr[16];char IpAddrMask[16]; dword IpAddrCxt; ptr NextGateway; char GatewayAddr[16]; char GatewayAddrMask[16];dword GatewayCxt; ptr NextDhcp; char DhcpAddr[16]; char DhcpAddrMask[16];dword DhcpCxt; int HaveWins; ptr NextPriWinsServer; char PriWinsServerAddr[16]; char PriWinsServerAddrMask[16]; dword PriWinsServerCxt; ptr NextSecWinsServer; char SecWinsServerAddr[16]; char SecWinsServerAddrMask[16]; dword LeaseObtained; dword LeaseExpires" While $pBuffer $tAdpt = DllStructCreate($tagADPTINFO, $pBuffer) $aResult[0][0] += 1 ReDim $aResult[$aResult[0][0] + 1][9] $aResult[$aResult[0][0]][0] = DllStructGetData($tAdpt, "AdptName") ; 网卡名称 $aResult[$aResult[0][0]][1] = DllStructGetData($tAdpt, "AdptDescr") ; 网卡描述 $aResult[$aResult[0][0]][2] = DllStructGetData($tAdpt, "MacAddr") ; 网卡MAC $aResult[$aResult[0][0]][3] = DllStructGetData($tAdpt, "Index") ; 网卡索引号 $aResult[$aResult[0][0]][4] = DllStructGetData($tAdpt, "Type") ; 类型 $aResult[$aResult[0][0]][5] = DllStructGetData($tAdpt, "DhcpEnabled") ; DHCP是否启用 true = 启用, false = 禁用 $aResult[$aResult[0][0]][6] = DllStructGetData($tAdpt, "IpAddr") ; IP 地址 $aResult[$aResult[0][0]][7] = DllStructGetData($tAdpt, "GatewayAddr") ; 网关地址 $aResult[$aResult[0][0]][8] = DllStructGetData($tAdpt, "DhcpAddr") ; DHCP地址, 只有DhcpEnabled为true时,此值才有效。 $pBuffer = DllStructGetData($tAdpt, "NextAdpt") ; [下一张网卡信息的内存地址。] $tAdpt = 0 WEnd $tBuffer = 0 Return SetError($iResult[0], 0, $aResult) EndFunc ;==>_GetAdaptersInfo; The UDFFunc _INetSmtpMailCom ( $s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance= "Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0 ) Local $objEmail = ObjCreate ( "CDO.Message" ) $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr ( $as_Body, "<" ) And StringInStr ( $as_Body, ">" ) Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit ( $s_AttachFiles, ";" ) For $x = 1 To $S_Files2Attach [ 0 ] $S_Files2Attach [ $x ] = _PathFull ( $S_Files2Attach [ $x ] ) ConsoleWrite ( '@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF ) ;### Debug Console If FileExists ( $S_Files2Attach [ $x ] ) Then $objEmail.AddAttachment ( $S_Files2Attach [ $x ] ) Else ConsoleWrite ( '!> File not found to attach: ' & $S_Files2Attach [ $x ] & @LF ) SetError ( 1 ) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 2 $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = $s_SmtpServer If Number ( $IPPort ) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ) = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ) = 1 $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendusername" ) = $s_Username $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ) = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item ( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ) = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ( "urn:schemas:mailheader:Importance" ) = "High" Case "Normal" $objEmail.Fields.Item ( "urn:schemas:mailheader:Importance" ) = "Normal" Case "Low" $objEmail.Fields.Item ( "urn:schemas:mailheader:Importance" ) = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError ( 2 ) Return $oMyRet [ 1 ] EndIf $objEmail= ""EndFunc ;==>_INetSmtpMailCom; 成品下载地址

显示器亮度,对比度,色温缩放调节,笔记本亮度调节AUTOIT源码

通过调用dxva2.dll文件,修改显示器的设置,和按显示器上的物理按钮效果一样,有效的解决显示器上按钮不好设置,按钮功能不明的问题,有些显示器不支持,如果你使用的无效果,说明你显示器不支持此调节功能!下载地址:源码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407#include <WinAPI.au3>#include <WinAPIFiles.au3>#include <WinAPIGdi.au3>#include <GUIConstantsEx.au3>#include <GuiSlider.au3>#include <Array.au3>Opt("GUIOnEventMode", 1)$g_szVersion = "RU1Y2-D59U9"If WinExists($g_szVersion) Then ExitAutoItWinSetTitle($g_szVersion)Global Const $Dxva2 = DllOpen("Dxva2.dll")If @error Then Exit 1Global Const $tagSTRUCT = "HANDLE hPhysicalMonitor;WCHAR szPhysicalMonitorDescription[128];"Global Const $tag_MC_TIMING_REPORT = "BYTE bTimingStatusByte; DWORD dwHorizontalFrequencyInHZ; DWORD dwVerticalFrequencyInHZ"Global Const $tag_DISPLAY_BRIGHTNESS = "byte ucDisplayPolicy; byte ucACBrightness; byte ucDCBrightness"Global Const $IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS = _WinAPI_IOCTL($FILE_DEVICE_VIDEO, 0x125, $METHOD_BUFFERED, $FILE_ANY_ACCESS)Global Const $IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS = _WinAPI_IOCTL($FILE_DEVICE_VIDEO, 0x126, $METHOD_BUFFERED, $FILE_ANY_ACCESS)Global Const $IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS = _WinAPI_IOCTL($FILE_DEVICE_VIDEO, 0x127, $METHOD_BUFFERED, $FILE_ANY_ACCESS)Global $idSlider1, $idSlider2, $idButton1, $idButton2, $idLabel1, $idLabel2Global $hMonitor, $brightness, $contrast, $switch1, $switch2, $VCPReplyGlobal $idLabel3, $idSlider3, $hDevice, $BRIGHTNESS_LCD_Array$hDevice = LCD()If Not @error Then LCD_Set($hDevice) If $hDevice Then _WinAPI_CloseHandle($hDevice) DllClose($Dxva2) ExitEndIf$hMonitor = _WinAPI_MonitorFromWindow(_WinAPI_GetDesktopWindow(), $MONITOR_DEFAULTTOPRIMARY) ;返回主显示器句柄$hMonitor = _GetPhysicalMonitorsFromHMONITOR($hMonitor) ;获取物理显示器句柄$StringLength = CapabilitiesRequestAndCapabilitiesReply($hMonitor)$Gui = GUICreate("显示器设置", 262, 220, -1, -1)GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")$idSlider1 = GUICtrlCreateSlider(10, 30, 240, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS))GUICtrlSetOnEvent($idSlider1, "Brightness")GUICtrlSetLimit($idSlider1, 100)$idSlider2 = GUICtrlCreateSlider(10, 82, 240, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS))GUICtrlSetOnEvent($idSlider2, "Contrast")GUICtrlSetLimit($idSlider2, 100)$idButton1 = GUICtrlCreateButton("宽屏切换", 16, 160, 85, 25)GUICtrlSetOnEvent($idButton1, "Button1")$idButton2 = GUICtrlCreateButton("恢复默认", 158, 160, 85, 25)GUICtrlSetOnEvent($idButton2, "Button2")$idLabel1 = GUICtrlCreateLabel(" 亮度调节:不可用", 10, 10, 140, 20)$idLabel2 = GUICtrlCreateLabel("对比度调节:不可用", 10, 60, 140, 20)$Combo1 = GUICtrlCreateCombo("", 102, 120, 100, 25, 0x0003)GUICtrlSetOnEvent($Combo1, "Color")GUICtrlCreateLabel("色温调节", 32, 124, 48, 20)_GUICtrlSlider_SetTipSide($idSlider1, $TBTS_TOP)_GUICtrlSlider_SetTipSide($idSlider2, $TBTS_TOP)If $StringLength <> "" Then $VCP_Array = Manage_vcp($StringLength) $VCPReply = _GetVCPFeatureAndVCPFeatureReply($hMonitor, 0x86) If $VCPReply[0] = 0 Then GUICtrlSetState($idButton1, $GUI_DISABLE) $brightness = _GetMonitorBrightness($hMonitor) ;获取监视器亮度 ConsoleWrite($brightness[1] & @CRLF) $contrast = _GetMonitorContrast($hMonitor) ;获取监视器对比度 If $brightness[2] <> 0 Then $switch1 = True If $contrast[2] <> 0 Then $switch2 = True If $switch1 Then GUICtrlSetData($idSlider1, $brightness[1]) GUICtrlSetData($idLabel1, "设置亮度:" & $brightness[1]) EndIf If $switch2 Then GUICtrlSetData($idSlider2, $contrast[1]) GUICtrlSetData($idLabel2, "设置对比度:" & $contrast[1]) EndIf For $i = 0 To UBound($VCP_Array) - 1 If $VCP_Array[$i][0] = "14" Then If $VCP_Array[$i][1] <> "" Then $Color_Array = StringSplit($VCP_Array[$i][1], " ", 2) $Color_String = "" For $S = 0 To UBound($Color_Array) - 1 $temp = Select_Color($Color_Array[$S]) If $temp <> "" Then $Color_String &= $temp & "|" Next EndIf ExitLoop EndIf Next If $Color_String <> "" Then $VCPCode = _GetVCPFeatureAndVCPFeatureReply($hMonitor, 0x14) GUICtrlSetData($Combo1, $Color_String, Select_Color($VCPCode[1] - 1)) Else GUICtrlSetData($Combo1, "不支持", "不支持") GUICtrlSetState($Combo1, $GUI_DISABLE) EndIf GUISetState(@SW_SHOW, $Gui)Else WinSetTitle($Gui, "", "未发现DDC/CI") GUICtrlSetData($Combo1, "不支持", "不支持") GUICtrlSetState($idSlider1, $GUI_DISABLE) GUICtrlSetState($idSlider2, $GUI_DISABLE) GUICtrlSetState($idButton1, $GUI_DISABLE) GUICtrlSetState($Combo1, $GUI_DISABLE) GUISetState(@SW_SHOW, $Gui)EndIfWhile 1 Sleep(50)WEndFunc LCD() Local $iDevice $iDevice = _WinAPI_CreateFileEx("\\.\LCD", $OPEN_EXISTING, $GENERIC_READ + $GENERIC_WRITE, $FILE_ANY_ACCESS, 0) Return (@error) ? (SetError(1, _WinAPI_GetLastErrorMessage(), False)) : ($iDevice)EndFunc ;==>LCDFunc LCD_Set($iDevice) Local $brightness = DllStructCreate("BYTE[256]") Local $DISPLAY_BRIGHTNESS = DllStructCreate("BYTE[3]") $success = _WinAPI_DeviceIoControl($iDevice, $IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS, Null, 0, DllStructGetPtr($brightness), 0xff) If $success = False Then Return $BRIGHTNESS_LCD_Array = Brightness_lcd(DllStructGetData($brightness, 1)) $success = _WinAPI_DeviceIoControl($iDevice, $IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS, Null, 0, DllStructGetPtr($DISPLAY_BRIGHTNESS), 0x03) If $success = False Then Return $DISPLAY_BRIGHTNESS_READ = Int(BinaryMid(DllStructGetData($DISPLAY_BRIGHTNESS, 1), 3, 1)) $Gui = GUICreate("内置LCD显示器", 262, 80, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") $idSlider3 = GUICtrlCreateSlider(10, 30, 240, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS)) GUICtrlSetLimit($idSlider3, 100) $idLabel3 = GUICtrlCreateLabel(" 亮度调节:", 10, 10, 140, 20) GUICtrlSetData($idSlider3, $DISPLAY_BRIGHTNESS_READ) GUICtrlSetData($idLabel3, "设置亮度:" & $DISPLAY_BRIGHTNESS_READ) GUICtrlSetOnEvent($idSlider3, "Brightness_set_lcd") GUISetState(@SW_SHOW, $Gui) WinSetTitle($Gui, "", "内置LCD显示器") While 1 Sleep(50) WEndEndFunc ;==>LCD_SetFunc Brightness_set_lcd() Local $lcd_BRIGHTNESS, $DISPLAY_BRIGHTNESS, $success $lcd_BRIGHTNESS = GUICtrlRead($idSlider3) GUICtrlSetData($idLabel3, "设置亮度:" & $lcd_BRIGHTNESS) For $i = 0 To UBound($BRIGHTNESS_LCD_Array) If $lcd_BRIGHTNESS <= $BRIGHTNESS_LCD_Array[$i] Then $DISPLAY_BRIGHTNESS = DllStructCreate($tag_DISPLAY_BRIGHTNESS) DllStructSetData($DISPLAY_BRIGHTNESS, "ucDisplayPolicy", 3) DllStructSetData($DISPLAY_BRIGHTNESS, "ucACBrightness", $BRIGHTNESS_LCD_Array[$i]) DllStructSetData($DISPLAY_BRIGHTNESS, "ucDCBrightness", $BRIGHTNESS_LCD_Array[$i]) $success = _WinAPI_DeviceIoControl($hDevice, $IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS, DllStructGetPtr($DISPLAY_BRIGHTNESS), DllStructGetSize($DISPLAY_BRIGHTNESS), Null, 0) If $success = False Then Return ExitLoop EndIf NextEndFunc ;==>Brightness_set_lcdFunc Select_Color($iValue) Local $String If StringIsXDigit($iValue) Then $iValue = Dec($iValue) Switch $iValue Case 1 $String = "sRGB" Case 2 $String = "原生显示" Case 3 $String = "4000K" Case 4 $String = "5000K" Case 5 $String = "6500K" Case 6 $String = "7500K" Case 7 $String = "8200K" Case 8 $String = "9300K" Case 9 $String = "10000K" Case 10 $String = "11500K" Case 11 $String = "User1" Case 12 $String = "User2" Case 13 $String = "User3" Case Else EndSwitch Return $StringEndFunc ;==>Select_ColorFunc Color() Local $iValue = GUICtrlRead($Combo1) Select Case $iValue = "sRGB" _SetVCPFeature($hMonitor, 0x14, 0x01) Case $iValue = "原生显示" _SetVCPFeature($hMonitor, 0x14, 0x02) Case $iValue = "4000K" _SetVCPFeature($hMonitor, 0x14, 0x03) Case $iValue = "5000K" _SetVCPFeature($hMonitor, 0x14, 0x04) Case $iValue = "6500K" _SetVCPFeature($hMonitor, 0x14, 0x05) Case $iValue = "7500K" _SetVCPFeature($hMonitor, 0x14, 0x06) Case $iValue = "8200K" _SetVCPFeature($hMonitor, 0x14, 0x07) Case $iValue = "9300K" _SetVCPFeature($hMonitor, 0x14, 0x08) Case $iValue = "10000K" _SetVCPFeature($hMonitor, 0x14, 0x09) Case $iValue = "11500K" _SetVCPFeature($hMonitor, 0x14, 0x0a) Case $iValue = "User1" _SetVCPFeature($hMonitor, 0x14, 0x0b) Case $iValue = "User2" _SetVCPFeature($hMonitor, 0x14, 0x0c) Case $iValue = "User3" _SetVCPFeature($hMonitor, 0x14, 0x0d) Case Else EndSelectEndFunc ;==>ColorFunc Button1() Local $VCPCode If $switch1 And $switch2 Then $VCPCode = _GetVCPFeatureAndVCPFeatureReply($hMonitor, 0x86) ConsoleWrite($VCPCode[1] & @CRLF) If $VCPCode[1] = 8 Then _SetVCPFeature($hMonitor, 0x86, 0x02) GUICtrlSetData($idButton1, "窄屏") Else _SetVCPFeature($hMonitor, 0x86, 0x08) GUICtrlSetData($idButton1, "宽屏") EndIf EndIfEndFunc ;==>Button1Func Button2() GUICtrlSetData($idButton2, "Reset..") Sleep(250) GUISetState(@SW_HIDE) If $switch1 Or $switch2 Then _RestoreMonitorFactoryDefaults($hMonitor) Sleep(1000) EndIf _DestroyPhysicalMonitor($hMonitor) ;关闭监视器句柄 DllClose($Dxva2) ExitEndFunc ;==>Button2Func Brightness() If Not $switch1 Then Return GUICtrlSetData($idLabel1, "设置亮度:" & GUICtrlRead($idSlider1)) _SetMonitorBrightness($hMonitor, GUICtrlRead($idSlider1))EndFunc ;==>BrightnessFunc Contrast() If Not $switch2 Then Return GUICtrlSetData($idLabel2, "设置对比度:" & GUICtrlRead($idSlider2)) _SetMonitorContrast($hMonitor, GUICtrlRead($idSlider2))EndFunc ;==>ContrastFunc _GetMonitorBrightness(Const $h_monitor) Local Const $MinimumBrightness = DllStructCreate("dword_ptr") Local Const $CurrentBrightness = DllStructCreate("dword_ptr") Local Const $MaximumBrightness = DllStructCreate("dword_ptr") DllCall($Dxva2, "bool", "GetMonitorBrightness", _ "handle", $h_monitor, _ "ptr", DllStructGetPtr($MinimumBrightness), _ "ptr", DllStructGetPtr($CurrentBrightness), _ "ptr", DllStructGetPtr($MaximumBrightness)) If @error Then Return SetError(1, _WinAPI_GetLastErrorMessage(), False) Local Const $brightness[3] = [DllStructGetData($MinimumBrightness, 1), _ DllStructGetData($CurrentBrightness, 1), _ DllStructGetData($MaximumBrightness, 1)] Return $brightnessEndFunc ;==>_GetMonitorBrightnessFunc _GetMonitorContrast(Const $h_monitor) Local Const $MinimumContrast = DllStructCreate("dword_ptr") Local Const $CurrentContrast = DllStructCreate("dword_ptr") Local Const $MaximumContrast = DllStructCreate("dword_ptr") DllCall($Dxva2, "bool", "GetMonitorContrast", _ "handle", $h_monitor, _ "ptr", DllStructGetPtr($MinimumContrast), _ "ptr", DllStructGetPtr($CurrentContrast), _ "ptr", DllStructGetPtr($MaximumContrast)) If @error Then Return SetError(1, _WinAPI_GetLastErrorMessage(), False) Local Const $contrast[3] = [DllStructGetData($MinimumContrast, 1), _ DllStructGetData($CurrentContrast, 1), _ DllStructGetData($MaximumContrast, 1)] Return $contrastEndFunc ;==>_GetMonitorContrastFunc _SetMonitorBrightness(Const $h_monitor, Const $NewBrightness) DllCall($Dxva2, "bool", "SetMonitorBrightness", "ptr", $h_monitor, "dword", $NewBrightness) Return (@error ? SetError(1, _WinAPI_GetLastErrorMessage(), False) : True)EndFunc ;==>_SetMonitorBrightnessFunc _SetMonitorContrast(Const $h_monitor, Const $contrast) DllCall($Dxva2, "bool", "SetMonitorContrast", "ptr", $h_monitor, "dword", $contrast) Return (@error ? SetError(1, _WinAPI_GetLastErrorMessage(), False) : True)EndFunc ;==>_SetMonitorContrastFunc _GetPhysicalMonitorsFromHMONITOR(Const $pMonitor) Local $Number = DllStructCreate("DWORD") Local $i, $tagPhysical, $M = 1 $Ret = DllCall($Dxva2, "bool", "GetNumberOfPhysicalMonitorsFromHMONITOR", _ "handle", $pMonitor, _ "ptr", DllStructGetPtr($Number)) $NumberOfMonitors = DllStructGetData($Number, 1) For $i = 1 To $NumberOfMonitors $tagPhysical &= $tagSTRUCT Next $MonitorArray = DllStructCreate($tagSTRUCT) $Ret = DllCall($Dxva2, "bool", "GetPhysicalMonitorsFromHMONITOR", _ "handle", $pMonitor, _ "DWORD", $NumberOfMonitors, _ "ptr", DllStructGetPtr($MonitorArray)) Return DllStructGetData($MonitorArray, 1) ;返回第一个显示器句柄EndFunc ;==>_GetPhysicalMonitorsFromHMONITORFunc CapabilitiesRequestAndCapabilitiesReply(Const $h_monitor) Local Const $tagStringLength = DllStructCreate("dword_ptr") DllCall($Dxva2, "bool", "GetCapabilitiesStringLength", "handle", $h_monitor, "ptr", DllStructGetPtr($tagStringLength)) Local Const $CapabilitiesStringLength = DllStructGetData($tagStringLength, 1) Local Const $CapabilitiesString = DllStructCreate("char[" & $CapabilitiesStringLength & ']') DllCall($Dxva2, "bool", "CapabilitiesRequestAndCapabilitiesReply", _ "handle", $h_monitor, _ "ptr", DllStructGetPtr($CapabilitiesString), _ "dword", DllStructGetSize($CapabilitiesString)) Return (@error) ? (SetError(1, _WinAPI_GetLastErrorMessage(), False)) : (DllStructGetData($CapabilitiesString, 1))EndFunc ;==>CapabilitiesRequestAndCapabilitiesReplyFunc _RestoreMonitorFactoryDefaults(Const $h_monitor) DllCall($Dxva2, "bool", "RestoreMonitorFactoryDefaults", "ptr", $h_monitor) Return (@error) ? (SetError(1, _WinAPI_GetLastErrorMessage(), False)) : (True)EndFunc ;==>_RestoreMonitorFactoryDefaultsFunc _SetVCPFeature(Const $h_monitor, Const $VCPCode, Const $NewValue) DllCall($Dxva2, "bool", "SetVCPFeature", _ "handle", $h_monitor, _ "byte", $VCPCode, _ "dword", $NewValue) Return (@error) ? (SetError(1, _WinAPI_GetLastErrorMessage(), False)) : (True)EndFunc ;==>_SetVCPFeatureFunc _GetVCPFeatureAndVCPFeatureReply(Const $h_monitor, Const $VCPCode) Local Const $CurrentValue = DllStructCreate("dword_ptr") Local Const $MaximumValue = DllStructCreate("dword_ptr") Local Const $VCPCodeType = DllStructCreate("dword_ptr") DllCall($Dxva2, "bool", "GetVCPFeatureAndVCPFeatureReply", _ "handle", $h_monitor, _ "byte", $VCPCode, _ "ptr", DllStructGetPtr($VCPCodeType), _ "ptr", DllStructGetPtr($CurrentValue), _ "ptr", DllStructGetPtr($MaximumValue)) If @error Then Return SetError(1, _WinAPI_GetLastErrorMessage(), False) Local Const $VCPFeatureReply[3] = [DllStructGetData($VCPCodeType, 1), DllStructGetData($CurrentValue, 1), DllStructGetData($MaximumValue, 1)] Return $VCPFeatureReplyEndFunc ;==>_GetVCPFeatureAndVCPFeatureReplyFunc Manage_vcp(Const $String) Local $Exp, $i, $tmp, $OUT_String $Exp = StringRegExp($String, "(?<=vcp\()([A-Za-z0-9]{2}[\)\(]?\s?)*(?=\))", 2) If @error Then Return $Exp = StringRegExp($Exp[0], "([0-9A-Fa-f]{2})(\(.+?\))?", 4) If @error Then Return Local $Array[UBound($Exp)][2] For $i = 0 To UBound($Exp) - 1 $tmp = $Exp[$i] $Array[$i][0] = StringStripWS(StringLeft($tmp[0], 2), 8) $OUT_String = StringStripWS(StringTrimLeft($tmp[0], 2), 3) If $OUT_String <> "" Then $OUT_String = StringTrimLeft(StringTrimRight($OUT_String, 1), 1) $Array[$i][1] = $OUT_String EndIf Next Return $ArrayEndFunc ;==>Manage_vcpFunc _DestroyPhysicalMonitor(Const $h_monitor) DllCall($Dxva2, "bool", "DestroyPhysicalMonitor", "ptr", $h_monitor) Return (@error) ? (SetError(1, _WinAPI_GetLastErrorMessage(), False)) : (True)EndFunc ;==>_DestroyPhysicalMonitorFunc Brightness_lcd(Const $BRIGHTNESS_Lcd) Local $BRIGHTNESS_String, $tmp, $i For $i = 1 To BinaryLen($BRIGHTNESS_Lcd) $tmp = Int(BinaryMid($BRIGHTNESS_Lcd, $i, 1)) If $i = 1 Then $BRIGHTNESS_String &= $tmp & ";" Else If $tmp = 0 Then ExitLoop $BRIGHTNESS_String &= $tmp & ";" EndIf Next Return StringSplit(StringTrimRight($BRIGHTNESS_String, 1), ";", 2)EndFunc ;==>Brightness_lcdFunc _exit() If $hDevice Then _WinAPI_CloseHandle($hDevice) _DestroyPhysicalMonitor($hMonitor) ;关闭监视器句柄 DllClose($Dxva2) ExitEndFunc ;==>_exit

单机游戏死亡阴影aardio内存修改器源码

aardio是专用于桌面软件快速开发的新一代混合型编程语言 – 具有动态语言轻便、灵活的特性,而且又可以同时支持静态类型开发,象静态语言那样使用。aardio可以直接支持原生DLL,即使是外部EXE进程中的函数,也可以使用一句代码声明为普通的aardio函数对象( 原生call支持 ),aardio支持非常多的标准调用约定,例如 stdcall,cdecl,thiscall,fastcall,regparm(n) 等调用约定都可以支持。aardio虽然小,但支持的接口很丰富、可以支持com静态动态双接口,象VBS一样原生支持com对象。 以下是使用aardio写的修改单机游戏死亡阴影3的游戏数据源码,仅供学习aardio使用!新建一个aardio代码文件,把下面代码复制到代码文件中,就可直接运行! 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import win.ui;import process; //声明变量hero3,jzvar hero3,jz;hero3=process.find("Heroes3.exe")if(hero3){ //把基址赋值给jz变量 jz=hero3.readNumber(0x82B0BC) }else { win.msgbox("请您先运行游戏")}/*DSG{{*/var winform = win.form(text="死亡阴影修改器";left=300;right=440;bottom=247;max=false;parent=...)winform.add(button={cls="button";text="修改";left=33;top=202;right=105;bottom=237;z=1})/*}}*/ bqm = { "水晶:";"水银:";"石头:";"金钱:";"木材:";"宝石:";"硫磺:" }py = { sj=Oxac;sy=Oxa0;st=Oxa4;jq=0xb4;mc=Ox9c;bs=0xb0;lh=Oxa8 }bjk = { "sj";"sy";"st";"jq";"mc";"bs";"lh" }tab = { } winform.button.oncommand = function(id,event){ for(i=1;#bjk;1){ if(winform["edit_"+bjk[ i ]].text != 0&&winform["edit_"+bjk[ i ]].text !=""){ table.push(tab,bjk[ i ]) } } for(i=1;#tab;1){ //win.msgbox(winform["edit_"+tab[ i ]].text,"死亡阴影修改器") hero3.writeNumber(jz+py[tab[ i ]],winform["edit_"+tab[ i ]].text) } tab={}} var topp = 5var bott = 25for(i=1;#bqm;1){ winform.add( ["edit_"+bjk[ i ]]={num=1;bottom=bott;text="999";left=50;top=topp;z=3;right=114;edge=1;cls="edit" }) winform.add( ["static"+i]={ bottom=bott;right=52;left=16;text=bqm[ i ];top=topp;z=1;transparent=1;cls="static"}) topp+=24 bott+=24} winform.show() win.loopMessage(); 其中的基址0x82B0BC,及偏移量为什么是这个数据,就需要你使用ce自己分析了! 对aardio不熟悉可以查看在线手机 aardio使用手册

aardio的listview自绘源代码

aardio的listview自绘源代码,在aardio新建一代码文件,复制下面的代码到代码文件中,直接运行就可以看到效果! 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100import win.ui;/*DSG{{*/var winform = win.form(text="listview中添加进度条演示";right=945;bottom=474)winform.add(button={cls="button";text="(点击这里随机更新一次第二行的进度值)";left=0;top=392;right=944;bottom=472;font=LOGFONT(h=-21);z=2};流程编辑框={cls="listview";left=0;top=0;right=946;bottom=384;edge=1;font=LOGFONT(h=-19;name='FontAwesome');fullRow=1;vscroll=1;z=1})/*}}*/ import win.fontAwesome;import win.graphics;import win.imageList;var imagelist = win.imageList(5,34);winform.流程编辑框.setImageList( imagelist,1/*_LVSIL_SMALL*/ );winform.流程编辑框.insertColumn("",30,,0x2/*_LVCFMT_CENTER*/) winform.流程编辑框.insertColumn("中断",80,,0x2/*_LVCFMT_CENTER*/) winform.流程编辑框.insertColumn("备注",300,,0x0/*_LVCFMT_LEFT*/) winform.流程编辑框.insertColumn("功能",100,,0x0/*_LVCFMT_LEFT*/)winform.流程编辑框.insertColumn("参数",300,,0x0/*_LVCFMT_LEFT*/)winform.流程编辑框.insertColumn("",30,,0x2/*_LVCFMT_CENTER*/)winform.流程编辑框.insertColumn("",1,,0x2/*_LVCFMT_CENTER*/)//自适应列宽度 winform.流程编辑框.adjust = function(cx,cy){ winform.流程编辑框.fillParent(5/*列序号*/);} winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';30;"直线运动";'{["速度"]=1000;["模式"]="相对运动";["距离"]="2380";["是否等待"]="否";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00d';'\uF05e';100;"直线运动";'{["速度"]=300;["模式"]="连续运动";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';200;"调用子程序";'{["调用子程序"]="连续读传感器";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';50;"调用子程序";'{["调用子程序"]="回字形对准算法";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';150;"直线运动";'{["速度"]=1000;["模式"]="相对运动";["距离"]="2380";["是否等待"]="否";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';120;"直线运动";'{["速度"]=1000;["模式"]="相对运动";["距离"]="2380";["是否等待"]="否";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00d';'\uF05e';10;"直线运动";'{["速度"]=300;["模式"]="连续运动";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';70;"调用子程序";'{["调用子程序"]="连续读传感器";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';260;"调用子程序";'{["调用子程序"]="回字形对准算法";["是否等待"]="是";}';'\uF01a'} } )winform.流程编辑框.addItem( { text={'\uF00c';'\uF1db';130;"直线运动";'{["速度"]=1000;["模式"]="相对运动";["距离"]="2380";["是否等待"]="否";}';'\uF01a'} } ) //自绘winform.流程编辑框.onnotify = function(id,code,ptr){ if( code == 0xFFFFFFF4/*_NM_CUSTOMDRAW*/ ){ var lvcd = winform.流程编辑框.getNotifyCustomDraw(code,ptr); if( lvcd.nmcd.dwDrawStage == 0x10001/*_CDDS_ITEMPREPAINT*/) return 0x20/*_CDRF_NOTIFYSUBITEMDRAW*/ elseif( lvcd.nmcd.dwDrawStage == 1/*_CDDS_PREPAINT*/ ){ return 0x20/*_CDRF_NOTIFYITEMDRAW*/; } elseif( lvcd.nmcd.dwDrawStage == ( 0x10001/*_CDDS_ITEMPREPAINT*/ | 0x20000/*_CDDS_SUBITEM*/) ){ //注意这里 iSubItem 的索引自0开始( 其他函数通常自1开始 ) var cvs = win.graphics.canvas(); // 创建一个画布 cvs.fromHDC(lvcd.nmcd.hdc); // 传入 hDC var nItem = lvcd.nmcd.dwItemSpec+1; var nSubItem = lvcd.iSubItem; var rc = owner.getItemRect(nItem,nSubItem); if(nSubItem == 3){ var RetRc = ::RECT(rc.left+1,rc.top+6,rc.right-tonumber(owner.getItemText(nItem,3)),rc.bottom-6); cvs.brush.color = 0x00ff00; cvs.fillRect(RetRc) } cvs.pen.color = 0xebebeb; // 定义画笔的颜色 cvs.drawEdge(rc); lvcd.update() cvs.destroy(); return 0/*_CDRF_DODEFAULT*/ } }}//演示更新进度winform.button.oncommand = function(id,event){ winform.流程编辑框.setItemText(tostring(math.random(10,280)),2,3);} winform.show() win.loopMessage();

TeamViewer_resetclientID重置PC端id源码

如何重置TeamViewer的ID?我们先来了解一下什么是WMI,WMI有一组API。我们不管使用VBScript、PowerShell脚本还是利用C#的来访问WMI的类库,都是因为WMI向外暴露的一组API。这些API是在系统安装WMI模块的时候安装的,通过他们我们能够能拿到我们想要的类。WMI有一个存储库。尽管WMI的多数实例数据都不存储在WMI中,但是WMI确实有一个存储库,用来存放提供程序提供的类信息,或者称为类的蓝图或者Schema。WMI有一个Service。WMI总是能够响应用户的访问,那是因为它有一个一直运行的Windows服务,名字叫Winmgmt。停止这个服务,所有对WMI的操作都将没有反应。WMI是可扩展的。人人都知道WMI能干很多事情,读取本机硬盘信息、读取远程计算机的用户信息、读取域用户信息等等。基本上,你能想到的获取或者更改资源的操作,它都能干。可谓吃得少,干得多。它为什么这么能干呢?这基于WMI的可扩展性。WMI对资源的操作,不是它自己实现了什么方法,而完全取决于向它注册的提供程序。 如何重置TeamViewer的ID?重置TeamViewer的ID的原理是什么,请看下面的源码Autoit3源代码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460; ; ----------------------------------------------------------------------------; ; ----------------------------------------------------------------------------#RequireAdmin; ----------------------------------------------------------------------------; ; ----------------------------------------------------------------------------Func _ProcessGetName($i_PID) If Not ProcessExists($i_PID) Then SetError(1) Return '' EndIf Local $a_Processes = ProcessList() If Not @error Then For $i = 1 To $a_Processes[0][0] If $a_Processes[$i][1] = $i_PID Then Return $a_Processes[$i][0] Next EndIf SetError(1) Return ''EndFuncFunc _ProcessGetPriority($vProcess) Local $i_PID = ProcessExists($vProcess) If Not $i_PID Then SetError(1) Return -1 EndIf Local $hDLL = DllOpen('kernel32.dll') Local $aProcessHandle = DllCall($hDLL, 'int', 'OpenProcess', 'int', 0x0400, 'int', False, 'int', $i_PID) Local $aPriority = DllCall($hDLL, 'int', 'GetPriorityClass', 'int', $aProcessHandle[0]) DllCall($hDLL, 'int', 'CloseHandle', 'int', $aProcessHandle[0]) DllClose($hDLL) Switch $aPriority[0] Case 0x00000040 Return 0 Case 0x00004000 Return 1 Case 0x00000020 Return 2 Case 0x00008000 Return 3 Case 0x00000080 Return 4 Case 0x00000100 Return 5 Case Else SetError(1) Return -1 EndSwitchEndFuncFunc _RunDOS($sCommand) Return RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)EndFunc; ----------------------------------------------------------------------------; ; ----------------------------------------------------------------------------; ----------------------------------------------------------------------------; ; ----------------------------------------------------------------------------Func _FileCountLines($sFilePath) Local $N = FileGetSize($sFilePath) - 1 If @error Or $N = -1 Then Return 0 Return StringLen(StringAddCR(FileRead($sFilePath, $N))) - $N + 1EndFuncFunc _FileCreate($sFilePath) Local $hOpenFile Local $hWriteFile $hOpenFile = FileOpen($sFilePath, 2) If $hOpenFile = -1 Then SetError(1) Return 0 EndIf $hWriteFile = FileWrite($hOpenFile, "") If $hWriteFile = -1 Then SetError(2) Return 0 EndIf FileClose($hOpenFile) Return 1EndFuncFunc _FileListToArray($sPath, $sFilter = "*", $iFlag = 0) Local $hSearch, $sFile, $asFileList[1] If Not FileExists($sPath) Then Return SetError(1, 1, "") If (StringInStr($sFilter, "\")) Or (StringInStr($sFilter, "/")) Or (StringInStr($sFilter, ":")) Or (StringInStr($sFilter, ">")) Or (StringInStr($sFilter, "<")) Or (StringInStr($sFilter, "|")) Or (StringStripWS($sFilter, 8) = "") Then Return SetError(2, 2, "") If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, "") $hSearch = FileFindFirstFile($sPath & "\" & $sFilter) If $hSearch = -1 Then Return SetError(4, 4, "") While 1 $sFile = FileFindNextFile($hSearch) If @error Then SetError(0) ExitLoop EndIf If $iFlag = 1 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") <> 0 Then ContinueLoop If $iFlag = 2 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") = 0 Then ContinueLoop ReDim $asFileList[UBound($asFileList) + 1] $asFileList[0] = $asFileList[0] + 1 $asFileList[UBound($asFileList) - 1] = $sFile WEnd FileClose($hSearch) Return $asFileListEndFuncFunc _FilePrint($s_File, $i_Show = @SW_HIDE) Local $a_Ret = DllCall("shell32.dll", "long", "ShellExecute", _ "hwnd", 0, _ "string", "print", _ "string", $s_File, _ "string", "", _ "string", "", _ "int", $i_Show) If $a_Ret[0] > 32 And Not @error Then Return 1 Else SetError($a_Ret[0]) Return 0 EndIfEndFuncFunc _FileReadToArray($sFilePath, ByRef $aArray) Local $hFile $hFile = FileOpen($sFilePath, 0) If $hFile = -1 Then SetError(1) Return 0 EndIf $aArray = StringSplit(StringStripCR(FileRead($hFile, FileGetSize($sFilePath))), @LF) FileClose($hFile) Return 1EndFuncFunc _FileWriteFromArray($sFilePath, $a_Array, $i_Base = 0, $i_UBound = 0) Local $hFile If Not IsArray($a_Array) Then SetError(2) Return 0 EndIf Local $last = UBound($a_Array) - 1 If $i_UBound < 1 Or $i_UBound > $last Then $i_UBound = $last If $i_Base < 0 Or $i_Base > $last Then $i_Base = 0 $hFile = FileOpen($sFilePath, 2) If $hFile = -1 Then SetError(1) Return 0 EndIf FileWrite($hFile, $a_Array[$i_Base]) For $x = $i_Base + 1 To $i_UBound FileWrite($hFile, @CRLF & $a_Array[$x]) Next FileClose($hFile) Return 1EndFuncFunc _FileWriteLog($sLogPath, $sLogMsg) Local $sDateNow Local $sTimeNow Local $sMsg Local $hOpenFile Local $hWriteFile $sDateNow = @YEAR & "-" & @MON & "-" & @MDAY $sTimeNow = @HOUR & ":" & @MIN & ":" & @SEC $sMsg = $sDateNow & " " & $sTimeNow & " : " & $sLogMsg $hOpenFile = FileOpen($sLogPath, 1) If $hOpenFile = -1 Then SetError(1) Return 0 EndIf $hWriteFile = FileWriteLine($hOpenFile, $sMsg) If $hWriteFile = -1 Then SetError(2) Return 0 EndIf FileClose($hOpenFile) Return 1EndFuncFunc _FileWriteToLine($sFile, $iLine, $sText, $fOverWrite = 0) If $iLine <= 0 Then SetError(4) Return 0 EndIf If Not IsString($sText) Then SetError(6) Return 0 EndIf If $fOverWrite <> 0 And $fOverWrite <> 1 Then SetError(5) Return 0 EndIf If Not FileExists($sFile) Then SetError(2) Return 0 EndIf Local $filtxt = FileRead($sFile, FileGetSize($sFile)) $filtxt = StringSplit($filtxt, @CRLF, 1) If UBound($filtxt, 1) < $iLine Then SetError(1) Return 0 EndIf Local $fil = FileOpen($sFile, 2) If $fil = -1 Then SetError(3) Return 0 EndIf For $i = 1 To UBound($filtxt) - 1 If $i = $iLine Then If $fOverWrite = 1 Then If $sText <> '' Then FileWrite($fil, $sText & @CRLF) Else FileWrite($fil, $sText) EndIf EndIf If $fOverWrite = 0 Then FileWrite($fil, $sText & @CRLF) FileWrite($fil, $filtxt[$i] & @CRLF) EndIf ElseIf $i < UBound($filtxt, 1) - 1 Then FileWrite($fil, $filtxt[$i] & @CRLF) ElseIf $i = UBound($filtxt, 1) - 1 Then FileWrite($fil, $filtxt[$i]) EndIf Next FileClose($fil) Return 1EndFuncFunc _PathFull($sRelativePath, $sBasePath = @WorkingDir) If Not $sRelativePath Or $sRelativePath = "." Then Return $sBasePath Local $sFullPath = StringReplace($sRelativePath, "/", "\") Local $sPath = StringLeft($sFullPath, 2) StringReplace($sFullPath, "\", "") If @extended = StringLen($sFullPath) Then Return StringLeft($sBasePath, 2) & "\" If StringLeft($sFullPath, 1) = "\" Then If $sPath = "\\" Then $sFullPath = StringTrimLeft($sFullPath, 2) $sPath &= StringLeft($sFullPath, StringInStr($sFullPath, "\") - 1) Else $sPath = StringLeft($sBasePath, 2) EndIf ElseIf Not StringInStr($sPath, ":") Then $sFullPath = $sBasePath & "\" & $sFullPath $sPath = StringLeft($sBasePath, 2) EndIf Local $aTemp = StringSplit($sFullPath, "\") Local $aPathParts[$aTemp[0]], $j = 0 For $i = 2 To $aTemp[0] If $aTemp[$i] = ".." Then If $j Then $j -= 1 ElseIf Not ($aTemp[$i] = "" And $i <> $aTemp[0]) And $aTemp[$i] <> "." Then $aPathParts[$j] = $aTemp[$i] $j += 1 EndIf Next $sFullPath = $sPath For $i = 0 To $j - 1 $sFullPath &= "\" & $aPathParts[$i] Next While StringInStr($sFullPath, ".\") $sFullPath = StringReplace($sFullPath, ".\", "\") WEnd Return $sFullPathEndFuncFunc _PathMake($szDrive, $szDir, $szFName, $szExt) Local $szFullPath If StringLen($szDrive) Then If Not (StringLeft($szDrive, 2) = "\\") Then $szDrive = StringLeft($szDrive, 1) & ":" EndIf If StringLen($szDir) Then If Not (StringRight($szDir, 1) = "\") And Not (StringRight($szDir, 1) = "/") Then $szDir = $szDir & "\" EndIf If StringLen($szExt) Then If Not (StringLeft($szExt, 1) = ".") Then $szExt = "." & $szExt EndIf $szFullPath = $szDrive & $szDir & $szFName & $szExt Return $szFullPathEndFuncFunc _PathSplit($szPath, ByRef $szDrive, ByRef $szDir, ByRef $szFName, ByRef $szExt) Local $drive = "" Local $dir = "" Local $fname = "" Local $ext = "" Local $pos Local $array[5] $array[0] = $szPath If StringMid($szPath, 2, 1) = ":" Then $drive = StringLeft($szPath, 2) $szPath = StringTrimLeft($szPath, 2) ElseIf StringLeft($szPath, 2) = "\\" Then $szPath = StringTrimLeft($szPath, 2) $pos = StringInStr($szPath, "\") If $pos = 0 Then $pos = StringInStr($szPath, "/") If $pos = 0 Then $drive = "\\" & $szPath $szPath = "" Else $drive = "\\" & StringLeft($szPath, $pos - 1) $szPath = StringTrimLeft($szPath, $pos - 1) EndIf EndIf Local $nPosForward = StringInStr($szPath, "/", 0, -1) Local $nPosBackward = StringInStr($szPath, "\", 0, -1) If $nPosForward >= $nPosBackward Then $pos = $nPosForward Else $pos = $nPosBackward EndIf $dir = StringLeft($szPath, $pos) $fname = StringRight($szPath, StringLen($szPath) - $pos) If StringLen($dir) = 0 Then $fname = $szPath $pos = StringInStr($fname, ".", 0, -1) If $pos Then $ext = StringRight($fname, StringLen($fname) - ($pos - 1)) $fname = StringLeft($fname, $pos - 1) EndIf $szDrive = $drive $szDir = $dir $szFName = $fname $szExt = $ext $array[1] = $drive $array[2] = $dir $array[3] = $fname $array[4] = $ext Return $arrayEndFuncFunc _ReplaceStringInFile($szFileName, $szSearchString, $szReplaceString, $fCaseness = 0, $fOccurance = 1) Local $iRetVal = 0 Local $szTempFile, $hWriteHandle, $aFileLines, $nCount, $sEndsWith, $hFile If StringInstr(FileGetAttrib($szFileName),"R") then SetError(6) Return -1 EndIf $hFile = FileOpen($szFileName, 0) If $hFile = -1 Then SetError(1) Return -1 EndIf Local $s_TotFile = FileRead($hFile, FileGetSize($szFileName)) If StringRight($s_TotFile, 2) = @CRLF Then $sEndsWith = @CRLF ElseIf StringRight($s_TotFile, 1) = @CR Then $sEndsWith = @CR ElseIf StringRight($s_TotFile, 1) = @LF Then $sEndsWith = @LF Else $sEndsWith = "" EndIf $aFileLines = StringSplit(StringStripCR($s_TotFile), @LF) FileClose($hFile) $szTempFile = _TempFile() $hWriteHandle = FileOpen($szTempFile, 2) If $hWriteHandle = -1 Then SetError(2) Return -1 EndIf For $nCount = 1 To $aFileLines[0] If StringInStr($aFileLines[$nCount], $szSearchString, $fCaseness) Then $aFileLines[$nCount] = StringReplace($aFileLines[$nCount], $szSearchString, $szReplaceString, 1 - $fOccurance, $fCaseness) $iRetVal = $iRetVal + 1 If $fOccurance = 0 Then $iRetVal = 1 ExitLoop EndIf EndIf Next For $nCount = 1 To $aFileLines[0] - 1 If FileWriteLine($hWriteHandle, $aFileLines[$nCount]) = 0 Then SetError(3) FileClose($hWriteHandle) Return -1 EndIf Next If $aFileLines[$nCount] <> "" Then FileWrite($hWriteHandle, $aFileLines[$nCount] & $sEndsWith) FileClose($hWriteHandle) If FileDelete($szFileName) = 0 Then SetError(4) Return -1 EndIf If FileMove($szTempFile, $szFileName) = 0 Then SetError(5) Return -1 EndIf Return $iRetValEndFuncFunc _TempFile($s_DirectoryName = @TempDir, $s_FilePrefix = "~", $s_FileExtension = ".tmp", $i_RandomLength = 7) Local $s_TempName If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @TempDir If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @ScriptDir If StringRight($s_DirectoryName, 1) <> "\" Then $s_DirectoryName = $s_DirectoryName & "\" Do $s_TempName = "" While StringLen($s_TempName) < $i_RandomLength $s_TempName = $s_TempName & Chr(Random(97, 122, 1)) WEnd $s_TempName = $s_DirectoryName & $s_FilePrefix & $s_TempName & $s_FileExtension Until Not FileExists($s_TempName) Return ($s_TempName)EndFunc; ----------------------------------------------------------------------------; ; ---------------------------------------------------------------------------- If WinExists(@ScriptName) Then Exit AutoItWinSetTitle(@ScriptName) AutoItSetOption("TrayIconHide", 1) AutoItSetOption("MouseCoordMode", 0) If ProcessExists("TeamViewer_Service.exe") Then RunWait(@ComSpec & " /C net stop TeamViewer","", @SW_HIDE) EndIf If ProcessExists("TeamViewer.exe") Then ProcessClose("TeamViewer.exe") EndIf RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\TeamViewer", "ClientID") Local $iRc = _RunDos("wmic class Win33_ComputerSystemProduct delete") $VBSFile = @ScriptDir&'\source.vbs' If Not FileExists($VBSFile) Then _FileCreate($VBSFile) FileSetAttrib(@ScriptDir&'\source.vbs', "+H") FileWriteLine ('source.vbs', 'intHighNumber = 99999') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'intLowNumber = 10000') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'intNumbers = 1') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', ' Randomize') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', ' intNumber = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber)') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'strnum = "01234567-8910-ABCD-1111-093F03C"') FileWriteLine ('source.vbs', 'strnum = strnum & Cstr(intNumber)') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'Set oLocation = CreateObject("WbemScripting.SWbemLocator")') FileWriteLine ('source.vbs', 'Set oServices = oLocation.ConnectServer(, "root\cimv2")') FileWriteLine ('source.vbs', 'Set FakeClass = oServices.Get') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'FakeClass.Path_.Class = "Win33_ComputerSystemProduct"') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "Caption", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "Description", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "IdentifyingNumber", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "Name", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "SKUNumber", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "UUID", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "Vendor", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_.add "Version", 8') FileWriteLine ('source.vbs', 'FakeClass.Properties_("Name").Qualifiers_.add "key", false') FileWriteLine ('source.vbs', 'FakeClass.Put_') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'Set FakeClass = GetObject("Winmgmts:root\cimv2:Win33_ComputerSystemProduct").SpawnInstance_') FileWriteLine ('source.vbs', '') FileWriteLine ('source.vbs', 'FakeClass.Caption = "http://www.teamviewer.com"') FileWriteLine ('source.vbs', 'FakeClass.Description = "class for teamviewer"') FileWriteLine ('source.vbs', 'FakeClass.IdentifyingNumber = "www.teamviewer.com"') FileWriteLine ('source.vbs', 'FakeClass.Name = "Teamviewer"') FileWriteLine ('source.vbs', 'FakeClass.SKUNumber = ""') FileWriteLine ('source.vbs', 'FakeClass.UUID = strnum') FileWriteLine ('source.vbs', 'FakeClass.Vendor = "Teamviewer"') FileWriteLine ('source.vbs', 'FakeClass.Version = "6.x"') FileWriteLine ('source.vbs', 'FakeClass.Put_') ShellExecute ("source.vbs", "", "", "open") Sleep(500) FileDelete(@ScriptDir&'\source.vbs') RunWait(@ComSpec & " /C net start TeamViewer","", @SW_HIDE) Run(@ScriptDir&'\TeamViewer.exe'); ----------------------------------------------------------------------------; ; ---------------------------------------------------------------------------- 其中关键的source.vbs代码1234567891011121314151617181920212223242526272829303132333435363738394041intHighNumber = 99999 intLowNumber = 10000 intNumbers = 1 Randomize intNumber = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber) strnum = "01234567-8910-ABCD-1111-093F03C"strnum = strnum & Cstr(intNumber) Set oLocation = CreateObject("WbemScripting.SWbemLocator")Set oServices = oLocation.ConnectServer(, "root\cimv2")Set FakeClass = oServices.Get FakeClass.Path_.Class = "Win33_ComputerSystemProduct" FakeClass.Properties_.add "Caption", 8FakeClass.Properties_.add "Description", 8FakeClass.Properties_.add "IdentifyingNumber", 8FakeClass.Properties_.add "Name", 8FakeClass.Properties_.add "SKUNumber", 8FakeClass.Properties_.add "UUID", 8FakeClass.Properties_.add "Vendor", 8FakeClass.Properties_.add "Version", 8FakeClass.Properties_("Name").Qualifiers_.add "key", falseFakeClass.Put_ Set FakeClass = GetObject("Winmgmts:root\cimv2:Win33_ComputerSystemProduct").SpawnInstance_ FakeClass.Caption = "http://www.teamviewer.com"FakeClass.Description = "class for teamviewer"FakeClass.IdentifyingNumber = "www.teamviewer.com"FakeClass.Name = "Teamviewer"FakeClass.SKUNumber = ""FakeClass.UUID = strnumFakeClass.Vendor = "Teamviewer"FakeClass.Version = "10.x"FakeClass.Put_ 仅此远远不够,还得需要修改teamviewer中的Win32_ComputerSystemProduct为Win33_ComputerSystemProduct,同时去掉teamviewer的自校验!

学习外挂的外挂源代码

01:可得到在网页中输入的用户名和密码的源代码 VC源代码02:传2脱机源代码 VC源代码03:传2机器人源代码 VC源代码04:封包截取的源码,值得学习 VC源代码05:神迹外挂挂源码 VC源代码06:系统加速源代码 DELPHI源代码07:传2外挂源码 ,功能丰富,是不可多得的源码 DELPHI源代码08:神迹脱机外挂源码 DELPHI源代码09:内存修改器源代码 VB源代码10:Winsock 详细使用例程 VB源代码11:内存搜索及修改源代码 VB源代码12:QQ消息自动发送器,有许多API操作值得学习 VB源代码13:读写INI文件的操作,值得学习 VB源代码14:截取封包的操作 VB源代码15:又一个内存修改器的源代码 VB源代码16:剑侠补血源码 VB源代码17:绿光抓包器,很好用 BC源代码18:封包截取源代码 VC源代码19:CS最有名的作敝器ORC9源码 VC源代码20:mu窗口化源码 VC源代码21:系统加速源码 VB源代码22:魔力宝贝和石器时代解图工具源码 VC源代码23:刀剑online 内存查看(HP,MP等) VB源代码24 :巨好的传奇2外挂 VC源代码25:巨好的龙族外挂源码 VB源代码26:传奇封包分析器 VB源代码27:DiabloII的外挂源代码 VC源代码28:JoolzCheat源码(著名游戏CS1.5版作弊器ogc-para源码) VC源代码29:传奇自动发言外挂 VC源代码30:盛大传奇外挂源码 VC源代码31:新大话西游经典系列源代码 VC源代码32:自动释放ASN聚气外挂源代码 VC源代码33:天翼脱机外挂源码(强力推荐) DELPHI源代码34:内存查找修改器 (和FPE GE一样,查找速度极快) DELPHI源代码35:又一个内存查找修改器 DELPHI源代码36:内存查找修改 DELPHI源代码37:BlowFish解密函数 DELPHI源代码38:lose-v0.41beta-win32-src DELPHI源代码39:传奇VB代码-Group.dat文件解密代码 VB源代码40:刀剑自动补血 VB源代码41:金庸小外挂 VB源代码42:腾讯QQ游戏–对对碰外挂制作教程详解 VB源代码43:APIhook DELPHI源代码44:APIHOOK VC源代码45:一个呼出热键的示例 DELPHI源代码46:mir外挂 易语言47:奇迹登陆器 VB源代码48:QQ对对碰小外挂 DELPHI源代码49:好像是封神ONLINE的东西 VC源代码50:一个极好的钩子教材 易语言51:传世地图 BC源代码52:奇迹登录器的E源码 易语言53:对对碰挂机 VC源代码54:库库神仙的防大补贴 DELPHI源代码55:扫雷外挂 DELPHI源代码56:毁灭天使2源代码 易语言 全部源代码下载地址:链接: https://pan.baidu.com/s/1Nr_ujf-OWGVZh1DrYdd6SA 提取码: amnp 复制这段内容后打开百度网盘手机App,操作更方便哦