 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
GGKillLive How do I cheat?
Reputation: 0
Joined: 17 Mar 2016 Posts: 4
|
Posted: Thu Mar 17, 2016 9:34 pm Post subject: VirtualallocEx C# |
|
|
| Good evening , I apologize for my English , have a question , I can not create a memory closer to the instruction address as the CE, 0x7FFF00000000 address of the instruction , and the memory allocated to the example in 0x7FF000000000 because of that I can not make the right jmp , tell me what to do , or how to create the correct CE in memory in C # thanks in advance , sorry for the English, they speak a little |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25812 Location: The netherlands
|
Posted: Fri Mar 18, 2016 3:44 am Post subject: |
|
|
not sure about c# but virtualalloxex has a prefered base address.
but for it to function the address must be dividabke by 0x10000 (in short, the address gas to end with 0000 ) and no memory in that region must have been allocated or reserved.
also, don't onky use mem_commit, also use mem_reserve (combine them with a binary or instruction. usually | ) _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
GGKillLive How do I cheat?
Reputation: 0
Joined: 17 Mar 2016 Posts: 4
|
Posted: Fri Mar 18, 2016 6:36 am Post subject: |
|
|
| Dark Byte wrote: | not sure about c# but virtualalloxex has a prefered base address.
but for it to function the address must be dividabke by 0x10000 (in short, the address gas to end with 0000 ) and no memory in that region must have been allocated or reserved.
also, don't onky use mem_commit, also use mem_reserve (combine them with a binary or instruction. usually | ) |
Thank you very much , but that's not work ,for example I use this functionality,
VirtualAllocEx(HandleProc, IntPtr.Zero, (IntPtr)Size, 0x1000 + 0x100000, MemoryProtection.ExecuteReadWrite);
And it's further than 0x7ff000000000 my mobile phone , and you want to create in 0x7fff00000000
I would be very grateful if you show me an example , I just have 2 days trying to figure out how to be in C# with a selection in the desired location in memory and not dismantled.... MB I'm stupid |
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Fri Mar 18, 2016 7:15 am Post subject: |
|
|
I think on C++ for example your example would work, but I've heard (I don't program C# for myself, so you'll have to google if it's true) that in C#, the lpAddress parameter tries to allocate memory exactly at the address (not near it), so if you've chosen an invalid address (such as 0x00000000) or an address that's already taken (such as "Game.exe"+12345), the function fails.
Again, I'm not really sure about that ... |
|
| Back to top |
|
 |
GGKillLive How do I cheat?
Reputation: 0
Joined: 17 Mar 2016 Posts: 4
|
Posted: Fri Mar 18, 2016 7:35 am Post subject: |
|
|
| i.e. as I understand , specifically the implementation of the creation of memory in C# 0x7ff00000000 no more , for I don't know , then the trainer is easier to do in C++? |
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Fri Mar 18, 2016 7:44 am Post subject: |
|
|
| Yes, I'd recommend C++ or Pascal rather than C# ... |
|
| Back to top |
|
 |
GGKillLive How do I cheat?
Reputation: 0
Joined: 17 Mar 2016 Posts: 4
|
Posted: Fri Mar 18, 2016 7:53 am Post subject: |
|
|
| Thanks bro , you can close the topic |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Mar 18, 2016 1:09 pm Post subject: |
|
|
C# will work just fine doing this, there is no reason to switch languages.
VirtualAllocEx is setup like this:
| Code: | LPVOID WINAPI VirtualAllocEx(
_In_ HANDLE hProcess,
_In_opt_ LPVOID lpAddress,
_In_ SIZE_T dwSize,
_In_ DWORD flAllocationType,
_In_ DWORD flProtect
); |
For creating memory to be used within a code cave, you normally just need to do something similar to:
(This is C++):
| Code: | | ::VirtualAllocEx(handle, nullptr, 0x1000, MEM_COMMIT, PAGE_EXECUTE_READWRITE); |
Your code looks fine as long as the DllImport you are using is correct. However, your memory access is a bit is wrong. You don't add two bits together. You need to OR them together like this:
0x1000 | 0x100000 _________________
- Retired. |
|
| Back to top |
|
 |
|
|
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
|
|