[英]Im trying to figure out why my squares cant match up properly can anyone help me figure it out
[英]Cant figure out how to properly use memset inside of my DLL
我想要做的是將一個整數(准確地說是-1)寫入模式掃描提供的地址,最好使用模式掃描儀作為DWORD返回的memset 或 memcpy
這是我的代碼:
#include <iostream>
#include "memory.h"
DWORD paranoid = sigScan("\x00\x00\x70\x41\x01\x00\x00\x00","xxxxxxxx");
void initiate() {
std::cout<<paranoid<<std::endl;
memset(paranoid,-1,8);//were I'm having issues at (I don't understand this function)
std::cout<<"toggled paranoid"<<std::endl;
}
void * memset ( void * ptr, int value, size_t num );
所以你必須寫這樣的東西:
#include <iostream>
#include "memory.h"
void* paranoid = (void*)sigScan("\x00\x00\x70\x41\x01\x00\x00\x00","xxxxxxxx");
void initiate() {
if(paranoid)
memset(paranoid,-1, sizeof(int));//were I'm having issues at (I don't understand this function)
std::cout<<"toggled paranoid"<<std::endl;
}
同樣值得指出的是,使用DWORD
變量來存儲指針可能是不安全的,因為它可能導致 x64 環境中的指針截斷。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.