[MetaHook] SearchPattern function

By Nagi

 1 void *SearchPattern(void *pStartSearch, DWORD dwSearchLen, char *pPattern, DWORD dwPatternLen)
 2 {
 3     DWORD dwStartAddr = (DWORD)pStartSearch;
 4     DWORD dwEndAddr = dwStartAddr + dwSearchLen - dwPatternLen;
 5
 6     while (dwStartAddr < dwEndAddr)
 7     {
 8         bool found = true;
 9
10         for (DWORD i = 0; i < dwPatternLen; i++)
11         {
12             char code = *(char *)(dwStartAddr + i);
13
14             if (pPattern[i] != 0x2A && pPattern[i] != code)
15             {
16                 found = false;
17                 break;
18             }
19         }
20
21         if (found)
22             return (void *)dwStartAddr;
23
24         dwStartAddr++;
25     }
26
27     return 0;
28 }
时间: 2024-10-19 14:28:24

[MetaHook] SearchPattern function的相关文章

通过百度echarts实现数据图表展示功能

现在我们在工作中,在开发中都会或多或少的用到图表统计数据显示给用户.通过图表可以很直观的,直接的将数据呈现出来.这里我就介绍说一下利用百度开源的echarts图表技术实现的具体功能. 1.对于不太理解echarts是个怎样技术的开发者来说,可以到echarts官网进行学习了解,官网有详细的API文档和实例供大家参考学习. 2.以下是我在工作中实现整理出来的实例源码: 公用的支持js文件 echarts.js.echarts.min.js,还有其他的图表需要支持的js文件也可以到官网下载 echa

帮同学做的大一大作业:《我的家乡—郑州》

---恢复内容开始--- 最近在上海上学的一个高中同学让我帮忙,帮她做她们的计算机课程大作业. 由于关系不错我也不好意思拒绝就帮忙做了,因为这个学期刚刚开始接触HTML5和css,所以制作过程中有很多不懂的,而且由于HTML5是选修课,一星期只有一节,所以做这个花费了比较多的时间,这个网站是我制作的第一个网站,比较有纪念意义,所以发在博客上,作为纪念. 通过去做这个作业,我了解到很多课上学不到的东西.因为没有美工,从头到尾,都是我一个人在臆想,刚开始的时候,根本无从下手,我去参考别人做的家乡网站

[MetaHook] Find a function signature

Find a non-public function signature, we need a tool "IDA Pro" ( You can open picture in a new window :D ) Step 1 Load your PE file in IDA Step 2 Find your function, you can use F5 to decompile a function You can refer to the string and function

[MetaHook] Quake OpenGL function

Quake OpenGL function for MetaHook plugin. Thank hzqst :D QGL.h 1 #ifndef QGL_H 2 #define QGL_H 3 4 #include <gl/gl.h> 5 #include <gl/glext.h> 6 7 extern void (APIENTRY *qglAccum)(GLenum op, GLfloat value); 8 extern void (APIENTRY *qglAlphaFun

[MetaHook] Quake Bink function

If you want to play Bink video in game, maybe you need this code. QBink.h 1 #ifndef QBINK_H 2 #define QBINK_H 3 4 #include "bink.h" 5 6 extern void PTR4* (RADEXPLINK *qBinkLogoAddress)(void); 7 extern void (RADEXPLINK *qBinkSetError)(const char

[MetaHook] Load large texture from model

We need hook "GL_LoadTexture" engine function. GL_LOADTEXTURE_SIG from hw.dll(3266) engine, can not use for other engine version. 1 #include <metahook.h> 2 #include "qgl.h" 3 #include "surface.h" 4 5 extern DWORD g_dwEn

[MetaHook] Surface hook

Hook ISurface function. 1 #include <metahook.h> 2 #include <vgui/ISurface.h> 3 4 using namespace vgui; 5 6 ISurface *g_pSurface = 0; 7 8 void (__fastcall *g_pfnCSurface_Shutdown)(void *pthis, int edx) = 0; 9 void (__fastcall *g_pfnCSurface_Run

[MetaHook] BaseUI hook

Hook IBaseUI function. 1 #include <metahook.h> 2 3 #include <IBaseUI.h> 4 5 IBaseUI *g_pBaseUI = 0; 6 7 void (__fastcall *g_pfnCBaseUI_Initialize)(void *pthis, int edx, CreateInterfaceFn *factories, int count) = 0; 8 void (__fastcall *g_pfnCBa

Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)

catalog 1. How to Add New Functions to MySQL 2. Features of the User-Defined Function Interface 3. User-Defined Function 4. UDF Argument Processing 5. UDF Return Values and Error Handling 6. UDF Compiling and Installing 7. Adding a New Native Functio