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 


Create new memory region

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Beck123x
How do I cheat?
Reputation: 0

Joined: 24 Sep 2021
Posts: 5

PostPosted: Fri Oct 22, 2021 10:54 am    Post subject: Create new memory region Reply with quote

Hello. Can someone help me.


For example, after I modify the bytes of this adress " 143DDA009" from
"A3 0C 57 FC F3 0F 11 83 A8 00 00 00 F3 44 0F 11 83 B0 00 00 00 40 84 FF" to " A3 0C 57 FC E9 EE 5F 21 FC 90 90 90 F3 44 0F 11 83 B0 00 00 00 40 84 FF"

Some instruction from that memory adress will jump to an adress like 13FFF0000 which doesn't exist yet and if I am searching it all bytes will be ?? ?? ?? ?? .......

Can you tell me, how to write a C# code to allocate a memory Region that starts at 13FFF0000 and ends at 13FFFFFFF for example?

I want to build my hack to be an EXE and then to protect it, but this doesn't matter.

The problem is that I wrote the code in C# to patch those bytes, but 13FFF000 adress doesn't exist.
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Fri Oct 22, 2021 10:15 pm    Post subject: Re: Create new memory region Reply with quote

Beck123x wrote:
Some instruction from that memory adress will jump to an adress like 13FFF0000 which doesn't exist yet


it's unclear what you meant here.
anyhow, allocating memory regions externally should be done by a call to VirtualAllocEx; and since you mentioned it contains a jump instruction to that region then make sure to set page protection to be executable and readable.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Beck123x
How do I cheat?
Reputation: 0

Joined: 24 Sep 2021
Posts: 5

PostPosted: Wed Oct 27, 2021 4:59 am    Post subject: Re: Create new memory region Reply with quote

OldCheatEngineUser wrote:
Beck123x wrote:
Some instruction from that memory adress will jump to an adress like 13FFF0000 which doesn't exist yet


it's unclear what you meant here.
anyhow, allocating memory regions externally should be done by a call to VirtualAllocEx; and since you mentioned it contains a jump instruction to that region then make sure to set page protection to be executable and readable.



Look what I mean :


Code:

namespace xFUT22
{

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        public Mem m = new Mem();
        private byte[] orgBytes;

        private void form1_load(object sender, EventArgs e)
        {
            if (!backgroundWorker1.IsBusy)
                backgroundWorker1.RunWorkerAsync();
        }

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            while (true)
            {

                int pID = m.GetProcIdFromName("FIFA22"); //Gaseste ID-ul jocului
                bool openProc = false; //verifica daca procesul e gasit
                if (pID > 0)
                {
                    openProc = m.OpenProcess(pID); //Porneste procesul, daca exista
                    procID.Invoke((MethodInvoker)delegate
                    {

                        procID.Text = pID.ToString();
                    });
                }



                if (openProc) // De aici incepe modificarea memoriei
                {

                    procID.Invoke((MethodInvoker)delegate
                    {

                        openLabel.Text = "OPEN";
                        openLabel.ForeColor = Color.Green;
                    });

if (HiddenTF.Checked)



                        m.WriteMemory("0x143dda009", "bytes", "A3 0C 57 FC E9 EE 5F 21 FC 90 90 90 F3 44 0F 11 83 B0 00 00 00 40 84 FF");


                    else

                        m.WriteMemory("0x143dda009", "bytes", "A3 0C 57 FC F3 0F 11 83 A8 00 00 00 F3 44 0F 11 83 B0 00 00 00 40 84 FF");


                    if (HiddenTF.Checked)
                        m.WriteMemory("0x13FFF0000", "bytes", "F3 0F 11 9B B1 00 00 00 E9 08 A0 DE 03 00 00 00 00 00 00 00 00 00 00 00");

                    else
                        m.WriteMemory("0x13FFF0000", "bytes", "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");






I have this C# using Memory64.dll.

The problem is that the adress 13FFF0000 DOESN'T exist, in FIFA process, untill I create it with CT, but I want to do it from my program.


I can allocate memory to FIFA process with CheatEngine, so I can write bytes to 13FFF0000, but i dont know how to do that with C#.

Can you explain?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Wed Oct 27, 2021 8:17 pm    Post subject: Reply with quote

Calling alloc() in CE is just calling VirtualAllocEx as needed with the proper params based on what you tell CE to do.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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