1 Star 1 Fork 1

yangand/winspool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
patch - 58.h 8.09 KB
一键复制 编辑 原始数据 按行查看 历史
yangan 提交于 2020-04-19 23:24 . 添加项目文件。
#include <Windows.h>
#include "stdafx.h"
#include "ILHook.h"
#include "vmpsdk.h"
#include <shellapi.h>
#include <Shlwapi.h>
#include <time.h>
#include <string>
using namespace std;
#pragma(lib,"shell32.lib")
#pragma comment(lib,"shlwapi.lib")
CILHook HookGetVersion;
CILHook HookCreateWindowEx;
CILHook HookSetTimer;
typedef unsigned char byte;
void enableDebuggerPrivileges()
{
HANDLE tokenHandle;
OpenProcessToken(GetCurrentProcess(), 40, &tokenHandle);
TOKEN_PRIVILEGES token_privileges = { 0 };
token_privileges.PrivilegeCount = 1;
token_privileges.Privileges->Attributes = 2;
LookupPrivilegeValueA(NULL, "SeDebugPrivilege", &token_privileges.Privileges->Luid);;
AdjustTokenPrivileges(tokenHandle, false, &token_privileges, sizeof(token_privileges), NULL, false);
}
void MakeHook(DWORD CurAddr,DWORD TargetAddr)
{
byte JmpCode[5]={0xe9};
*((DWORD*)&JmpCode[1])=TargetAddr-CurAddr-5;
DWORD dwOldProtect=0;
VirtualProtect((LPVOID)CurAddr,5,PAGE_EXECUTE_READWRITE,&dwOldProtect);
memcpy((LPVOID)CurAddr,JmpCode,5);
}
void MakeCall(DWORD CurAddr,DWORD TargetAddr)
{
byte JmpCode[5]={0xe8};
*((DWORD*)&JmpCode[1])=TargetAddr-CurAddr-5;
DWORD dwOldProtect=0;
VirtualProtect((LPVOID)CurAddr,5,PAGE_EXECUTE_READWRITE,&dwOldProtect);
memcpy((LPVOID)CurAddr,JmpCode,5);
}
char* eText(char * str)
{
int len = strlen(str);
if (len == 0)
return NULL;
char* lpE =(char*) malloc(len + 1);
memset(lpE, 0, len + 1);
memcpy(lpE, str, len);
return lpE;
}
byte bOrg = 0xf;
DWORD patchAddr1 = 0x00410ECA;
byte patchData1[] = {
0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
DWORD patchAddr2 = 0x0041158D;
byte patchData2[] = {
0xe9, 0xb9, 0x01, 0x00, 0x00, 0x90 };
DWORD patchAddr3=0x0040F311;
byte patchData3[] = {
0xc3 };
DWORD patchAddr4=0x824567;
byte patchData4[] = {
0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
DWORD patchAddr5=0x004B9A9A;
byte patchData5[] = { 0xc3 };
DWORD patchAddr6=0x0049DFFA;
byte patchData6[]= { 0xc3 };
DWORD patchAddr7=0x0049B0B8;
byte patchData7[]= { 0xeb };
DWORD patchAddr8=0x004BB69B;
byte patchData8[]= { 0xeb };
DWORD patchAddr9= 0x004BE757;
byte patchData9[]= { 0xeb };
DWORD patchAddr10=0x00BE29D1;
byte patchData10[]= { 0xeb };
DWORD patchAddr11=0xBF91F1;
byte patchData11[]= { 0xeb };
DWORD patchAddr12=0x94D482;
byte patchData12[]= { 0xeb };
DWORD patchAddr13= 0x9BB324;
byte patchData13[]= { 0xeb };
DWORD patchAddr14= 0xB66DD9;
byte patchData14[]= { 0xeb };
DWORD patchAddr15= 0xB790A9;
byte patchData15[]= { 0xeb };
DWORD patchAddr16 = 0xB5FA89;
byte patchData16[] = { 0xeb };
DWORD patchAddr17 = 0x0059C470;
byte patchData17[] = { 0xeb };
DWORD patchAddr18 = 0x00C0ED56;
byte patchData18[] = { 0xeb };
DWORD patchAddr19 = 0x0094D4D9;
byte patchData19[] = { 0xeb };
DWORD patchAddr20 = 0x00BF9248;
byte patchData20[] = { 0xeb };
DWORD patchAddr21 = 0x00C14CCE;
byte patchData21[] = { 0xeb };
DWORD patchAddr22 = 0x00C0C378;
byte patchData22[] = { 0xeb };
DWORD patchAddr23 = 0x00C16855;
byte patchData23[] = { 0xeb };
DWORD patchAddr24 = 0x00C710E6;
byte patchData24[] = { 0xeb };
DWORD patchAddr25 = 0x00CA01C5;
byte patchData25[] = { 0xeb };
DWORD patchAddr26 = 0x00CB37F2;
byte patchData26[] = { 0xeb };
DWORD patchAddr27 = 0x0087ABAA;
byte patchData27[] = { 0xeb };
DWORD patchAddr28 = 0x0096CB6A;
byte patchData28[] = { 0xeb };
DWORD patchAddr29 = 0x00978D13;
byte patchData29[] = { 0xeb };
DWORD patchAddr30 = 0x009BB380;
byte patchData30[] = { 0xeb };
DWORD patchAddr31=0x00B9443D;
byte patchData31[] = { 0xeb };
DWORD patchAddr32=0x00CA020F;
byte patchData32[] = { 0xeb };
//DWORD patchAddr3=0x00BD6235;
//byte patchData3[] = { 0xeb };
void writeData(DWORD patchAddr, LPVOID patchData, DWORD patchSize)
{
DWORD oldProtect = 0;
VirtualProtect((LPVOID)patchAddr, patchSize, PAGE_EXECUTE_READWRITE, &oldProtect);
memcpy((LPVOID)patchAddr, patchData, patchSize);
}
char* getUser()
{
return eText("select * from [2016wlmq_user] where name like '652322196612180036'");
}
char* WINAPI getText(int a)
{
return eText("??okiszhuce-2019|KGppXV8tU19rbmxbJWlwc1RpJWheV2hkKWFfZWhvXiNaW3BfWVwkb2FqY2I=|");
}
char* WINAPI getText2(int a1,int a2)
{
return eText("{\"data\":{\"username\":\"vip\",\"uid\":50,\"group_id\":3,\"token\":\"9fc81ecbcb45a9b539648b91a1cf3ac3\"},\"code\":1,\"message\":\"success\"}");
}
char * getData(int index)
{
switch (index)
{
case 1:
return eText("2019/11/18 10:06:55");
case 2:
return eText("2029/12/31 15:05:18");
case 3:
return eText("vip.58.com");
case 4:
return eText("8.1");
case 5:
return eText("58帖子刷新助手@1、软件已经更换服务器,请更新至7.9版本@2、支持上架,下架,删帖,恢复帖子@3、支持定时刷新系统@4、另外出售@58全职,兼职一体发帖机@5、全网最安全简历提取器@6、短信群发助手、邮箱监控实时卡发@7、官网:www.ccsrjyz.cn");
case 6:
return eText("http://www.ccsrjyz.cn");
case 7:
return eText("0");
case 8:
return eText("58帖子刷新助手@1、修复房产帖子获取不到@修复点击打开网页Cookie失效");
}
}
void patch()
{
MakeHook(0x00414712, (DWORD)getData);
writeData(patchAddr1,patchData1,sizeof(patchData1));
writeData(patchAddr2,patchData2,sizeof(patchData2));
// writeData(patchAddr3, patchData3, sizeof(patchData3));
// writeData(patchAddr4, patchData4, sizeof(patchData4));
/*writeData(patchAddr5, patchData5, sizeof(patchData5));
writeData(patchAddr6, patchData6, sizeof(patchData6));
MakeCall(patchAddr7, (DWORD)getStr1);
MakeCall(patchAddr8, (DWORD)getStr2);
MakeCall(patchAddr9, (DWORD)getStr2);*/
// writeData(patchAddr7, patchData7, sizeof(patchData7));
// writeData(patchAddr8, patchData8, sizeof(patchData8));
// writeData(patchAddr9, patchData9, sizeof(patchData9));
// writeData(patchAddr10, patchData10, sizeof(patchData10));
// writeData(patchAddr11, patchData11, sizeof(patchData11));
// writeData(patchAddr12, patchData12, sizeof(patchData12));
// writeData(patchAddr13, patchData13, sizeof(patchData13));
// writeData(patchAddr14, patchData14, sizeof(patchData14));
// writeData(patchAddr15, patchData15, sizeof(patchData15));
// writeData(patchAddr16, patchData16, sizeof(patchData16));
// writeData(patchAddr17, patchData17, sizeof(patchData17));
// writeData(patchAddr18, patchData18, sizeof(patchData18));
// writeData(patchAddr19, patchData19, sizeof(patchData19));
// writeData(patchAddr20, patchData20, sizeof(patchData20));
// writeData(patchAddr21, patchData21, sizeof(patchData21));
// writeData(patchAddr22, patchData22, sizeof(patchData22));
// writeData(patchAddr23, patchData23, sizeof(patchData23));
// writeData(patchAddr24, patchData24, sizeof(patchData24));
// writeData(patchAddr25, patchData25, sizeof(patchData25));
// writeData(patchAddr26, patchData26, sizeof(patchData26));
// writeData(patchAddr27, patchData27, sizeof(patchData27));
// writeData(patchAddr28, patchData28, sizeof(patchData28));
// writeData(patchAddr29, patchData29, sizeof(patchData29));
// writeData(patchAddr30, patchData30, sizeof(patchData30));
// writeData(patchAddr31, patchData31, sizeof(patchData31));
// writeData(patchAddr32, patchData32, sizeof(patchData32));
}
HWND WINAPI MyCreateWindowExW( DWORD dwExStyle,
LPWSTR lpClassName,
LPWSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam
)
{
HookCreateWindowEx.UnHook();
HWND hwnd=CreateWindowExW(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam);
DWORD dwOrigin=0;
// DWORD base =(DWORD) GetModuleHandleA("HZX3981.dll");
// patchAddr1 = base + 0x2b2ea;
if (IsBadReadPtr((LPVOID)patchAddr1,1))
{
return hwnd;
}
if (*(byte*)patchAddr1==bOrg)
{
//LoadLibraryA("patch.dll");
//MakeHook(patchAddr1,(DWORD)MyInit);
patch();
return hwnd;
}
HookCreateWindowEx.ReHook();
return hwnd;
}
void deleteSe()
{
SHDeleteKey(HKEY_CURRENT_USER, TEXT("Software\\Classes\\Interface\\{C6680AAC-C1DA-C66C-CF10-C4227DE20C53}"));
SHDeleteKey(HKEY_CURRENT_USER, TEXT("Software\\Classes\\Wow6432Node\\Interface\\{C6680AAC-C1DA-C66C-CF10-C4227DE20C53}"));
SHDeleteKeyA(HKEY_CLASSES_ROOT, "Wow6432Node\\Interface\\{C6680AAC-C1DA-C66C-CF10-C4227DE20C53}");
SHDeleteKeyA(HKEY_CLASSES_ROOT, "Interface\\{C6680AAC-C1DA-C66C-CF10-C4227DE20C53}");
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangand/winspool.git
[email protected]:yangand/winspool.git
yangand
winspool
winspool
master

搜索帮助