window xp可以吗?
|
|
诚心想学Programmer...(可是我一点都不懂) |
原帖由 goodhermit95 于 2008-12-9 06:42 PM 发表
我推荐C++
复制代码
- #include <windows.h>
- #include <tlhelp32.h>
- #include <conio.h>
- #include <stdlib.h>
- bool ChangeMemVal(const char * ProcessName, LPVOID MemAddress, int NewVal, int size);
- void main()
- {
- printf("=== Pinball Trainer Example. Made by <your name here> ===\n\n");
- if(ChangeMemVal("PINBALL.EXE", (void*) 0xA90C62, 100000000, 4))
- printf("The score has been edited successfully.\n");
- else
- printf("An error occured while attempting edit the score.\n");
- system("PAUSE");
- return 0;
- }
- bool ChangeMemVal(const char * ProcessName, LPVOID MemAddress, int NewVal, int size)
- {
- HANDLE hProcessSnap;
- HANDLE hProcess = NULL;
- PROCESSENTRY32 pe32;
- hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
- pe32.dwSize = sizeof( PROCESSENTRY32 );
- Process32First(hProcessSnap, &pe32);
- do
- {
- if(!strcmp(pe32.szExeFile, ProcessName))
- {
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
- break;
- }
- }
- while(Process32Next(hProcessSnap, &pe32));
- CloseHandle( hProcessSnap );
- if(hProcess != NULL)
- {
- WriteProcessMemory(hProcess, MemAddress, &NewVal, size, NULL);
- CloseHandle(hProcess);
- return true;
- }
- return false;
- }
JBTALKS.CC |联系我们 |隐私政策 |Share
GMT+8, 2026-1-1 10:07 AM , Processed in 0.093080 second(s), 21 queries .
Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
Dedicated Server powered by iCore Technology Sdn. Bhd.