Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


WriteProcessMemory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mr.moon
Newbie cheater
Reputation: 0

Joined: 27 Aug 2016
Posts: 10

PostPosted: Thu Aug 31, 2017 5:41 am    Post subject: WriteProcessMemory Reply with quote

hi i am trying to user ASM from windows application like this

Code:

Addy_ins = dwBaseAddr + Addy_ins_Offset;
   
Addy_Call = dwBaseAddr + Addy_Call_Offset;

static _declspec(naked) void ASMFunc(void)
{
   _asm
   {
      push 01
      mov ecx, Addy_ins
      call Addy_Call
      ret
   }
}



i think to use WriteProcessMemory like that

Code:

void MyForm::button1_Click(System::Object^  sender, System::EventArgs^  e)
{
   LPVOID VirtualAlloc = VirtualAllocEx(hProc, 0, 128, MEM_RESERVE, PAGE_READWRITE);


WriteProcessMemory(hProc, (LPVOID)0x03920000, (DWORD*)ASMFunc, sizeof(ASMFunc ), NULL);
}


but didn't work

any idea how can make it work ?
thanks
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 3

Joined: 01 Feb 2016
Posts: 451

PostPosted: Thu Aug 31, 2017 7:01 am    Post subject: Reply with quote

prototype, must be called from main.
Code:
void WriteToMemory(HANDLE hProcHandle)
{
   DWORD AddressToWrite;

   if (AmmoStatus)
   {
      AddressToWrite = FindDMAaddress(3, hProcHandle, AmmoOffsets, AmmoBaseAddress); //'3' is pointer level
      WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
   }
   if (HealthStatus)
   {
      AddressToWrite = FindDMAaddress(1, hProcHandle, HealthOffsets, HealthBaseAddress); //'1' is pointer level
      WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
   }
}

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites