C 記憶體修改

2021-04-20 07:22:33 字數 1325 閱讀 7881

先通過

system.diagnostics.process類獲取想要編輯的程序

呼叫api

[flags]

public enum processaccesstype

[dllimport("kernel32.dll")]

public static extern intptr openprocess(uint32 dwdesiredaccess, int32 binherithandle, uint32 dwprocessid);

[dllimport("kernel32.dll")]

public static extern int32 closehandle(intptr hobject);

[dllimport("kernel32.dll")]

public static extern int32 readprocessmemory(intptr hprocess, intptr lpbaseaddress, [in, out] byte buffer, uint32 size, out intptr lpnumberofbytesread);

[dllimport("kernel32.dll")]

public static extern int32 writeprocessmemory(intptr hprocess, intptr lpbaseaddress, [in, out] byte buffer, uint32 size, out intptr lpnumberofbyteswritten);

開啟程序

private intptr m_hprocess = intptr.zero;   //這個儲存開啟了個程序控制代碼

public void openprocess()

m_readprocess.id 程序的id編號   讀取

public byte readprocessmemory(intptr memoryaddress, uint bytestoread, out int bytesread)

intprt memoryaddress 為要讀取的記憶體位址

uint bytestoread 需要讀的數量

out int bytesread 實際讀出的數量

寫入 

public void writeprocessmemory(intptr memoryaddress, byte bytestowrite, out int byteswritten)

intprt memoryaddress 為要讀取的記憶體位址

byte bytestowrite 需要寫入的資料

out int byteswritten 實際寫入多少

C 製作記憶體修改器

先看效果圖 其實 搞這個東西 主要是因為 不久前看到乙個c 寫的外掛程式 頓時就來了興趣 當時看了之後 覺得不爽的就是 那個位址是寫死在程式裡面的是固定的 而且是用其他東西掃出來的位址 頓時就覺得不爽了 要這個位址也是自己寫的程式掃出來的那才有成就感 於是呼這東西就這樣誕生了 在做之前 我感覺這東西...

idea記憶體修改

我這邊再用idea 我在啟動我的專案的時候非常的慢 並且在tomcat啟動後會出現一大堆的紅色警告 說記憶體不足什麼的 這個警告我已經解決了 大家可以去看我的博文裡有 我在解決我的警告前 以為是我idea記憶體不足 然後我就在網上去找我的idea記憶體修改方式 這裡我就歸納一下 該我們的idea記憶...

idea記憶體修改

我這邊再用idea 我在啟動我的專案的時候非常的慢 並且在tomcat啟動後會出現一大堆的紅色警告 說記憶體不足什麼的 這個警告我已經解決了 大家可以去看我的博文裡有 我在解決我的警告前 以為是我idea記憶體不足 然後我就在網上去找我的idea記憶體修改方式 這裡我就歸納一下 該我們的idea記憶...