自己写的函数全部集合
「已注销」
这个作者很懒,什么都没留下…
展开
-
关闭内存页保护开启内存页保护cr0
void PageProtectOn(){ __asm{//恢复内存保护 mov eax, cr0 or eax, 10000h mov cr0, eax sti }}void PageProtectOff(){ __asm{//去掉内存保护 cli mov eax, cr0 and eax, not 10000h mov转载 2017-09-04 17:59:16 · 610 阅读 · 0 评论 -
写日志函数c盘WriteLog
void WriteLog(char * szLog){ SYSTEMTIME st; GetLocalTime(&st); FILE *fp; fp = fopen("c:\\log.txt", "at"); fprintf(fp, "MyLogInfo: %d:%d:%d:%d ", st.wHour, st.wMinute, st.wSecond, st.wMillis...转载 2019-02-01 09:22:41 · 1283 阅读 · 0 评论 -
得到系统版本
ULONG uMajorVersion; ULONG uMinorVersion; PsGetVersion(&uMajorVersion, &uMinorVersion, NULL, NULL);转载 2018-09-02 22:48:54 · 140 阅读 · 0 评论 -
内核中睡眠 函数 KeDelayExecutionThread 睡30秒
VOID shuimian(ULONG n){KdPrint(("进入睡眠.............\n"));LARGE_INTEGER timeout;timeout.QuadPart = -10 * 1000 * 1000;timeout.QuadPart *= n;KeDelayExecutionThread(KernelMode, FALSE, &timeout)...转载 2018-08-19 18:30:51 · 3617 阅读 · 0 评论 -
wchar_t*和string相互转换
在处理中文时,一个中文通常占用2个字节,而char*和string字符串中的字符都是一个字节的,为了能够有效处理中文,引入了wchar_t*型变量,当需要处理中文时,可以首先将string转换成char*,然后将char*转换成wchar_t*即可。在window环境中,可以利用MultiByteToWideChar();WideCharToMultiByte();1 2两个A...转载 2018-08-15 05:36:42 · 12945 阅读 · 0 评论 -
字符串转换Unicode下wstring(wchar_t*)和string(char*)互相转换
#include<string> using namespace std; //将string转换成wstring wstring string2wstring(string str) { wstring result; //获取缓冲区大小,并申请空间,缓冲区大小按字符计算 ...转载 2018-08-15 05:28:14 · 1011 阅读 · 0 评论 -
扫内核
//搜索函数地址ULONG sao_neihe(ULONG dizhi,ULONG daxiao, char*hanshuming, ULONG*dizhichu){ if (strstr(hanshuming, "KiFastCallEntry") != 0) { KdPrint(("进来了 \n")); KdPrint(("基质%x 大小%x", dizhi, daxiao)...转载 2018-08-12 15:21:26 · 163 阅读 · 0 评论 -
函数名获取函数地址 MmGetSystemRoutineAddress
#include<ntifs.h>VOID DriverUnLoad(PDRIVER_OBJECT pDriverObject){ DbgPrint("驱动已卸载...");}NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegPath){ NTSTATUS ...转载 2018-08-04 12:27:07 · 3947 阅读 · 0 评论 -
通过进程名获取进程id
BOOL GetProcessInfo(wchar_t *szProcessName,ULONG * ProcessId){ NTSTATUS status; ULONG RetLen; BOOL bIsSuccess = FALSE; PVOID ProcessInfo; SYSTEM_PROCESS_INFORMATION* p; if (ProcessId ==转载 2017-10-28 14:25:21 · 2250 阅读 · 1 评论 -
寻找SSDT表地址
#include"ntifs.h"#include"intsafe.h"#include"ntimage.h"#define out#define inULONG_PTR dizhi_zwclose = 0;ULONG_PTR dizhi_KiServiceInternal = 0;ULONG_PTR dizhi_KiSystemServiceStart = 0;ULONG_P转载 2017-09-04 22:00:15 · 255 阅读 · 0 评论 -
获取内核地址大小路径
#include"ntifs.h"#include"intsafe.h"#include"ntimage.h"#define out#define in#define SystemModuleInformation 11ULONG_PTR jizhi_neihe = 0;ULONG_PTR daxiao_neihe = 0;WCHAR *pwz_kernel_path = NULL转载 2017-09-04 18:03:30 · 297 阅读 · 0 评论 -
内核扫函数 特征码定位
ULONG sao1()//DbgkCopyProcessDebugPort{ UCHAR *p1 = (UCHAR*)jizhi_neihe; UCHAR *p2 = NULL; UCHAR n1 = 0; for (ULONG i = 0; i <= (ULONG)daxiao_neihe; i++) { if (MmIsAddressValid(p1 + i)) {转载 2017-09-04 18:00:53 · 433 阅读 · 0 评论 -
汇编插入打印函数
__asm {pushad pushfd call ceshi11 popfd popad }ULONG ceshi11(){ KdPrint(("进入退出线程111111122222222222")); return 0;}转载 2019-01-29 23:03:52 · 254 阅读 · 0 评论