Solved Opcode Help.

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
i use this method in c# to make trainer

Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
WriteProcessMemory((int)handle, 0x7FF1945134, write, write.Length, ref written);

when i restart my pc opcodes changing everytime
so is there way to make it game.exe+10512c like that?
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,074
78,998
2,371
still give error : system.componentmodel.win32exception access is denied
You're writing to a code section of memory. These memory pages do not have write access, they have execute. This is the built in security of windows. You need to use VirtualProtectEx to give yourself write permissions to that memory page.Use the memory protection constant PAGE_EXECUTE_READWRITE and make sure you run as admin.

Also 0x7FF1945134 looks like a dynamic address. You need to use an offset from exe module base address instead if the .exe if ASLR is enabled. Checkout Tutorial - Get Module Base Address Tutorial dwGetModuleBaseAddress

You can also use a simple Nop function like this one

You will need to use patter scanning maybe too

checkout
https://guidedhacking.com/threads/rakes-baby-c-memory-class.13979/
https://guidedhacking.com/threads/simple-c-pattern-scan.13981/
 
Last edited:

Simon-Benyo

Jr.Coder
Full Member
Nobleman
Aug 9, 2013
64
1,498
3
As Traxin told you, your problem is ASLR
getting Growtopia.exe+10512c would be as following :

IntPtr addr= Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512c;

Good luck.
 

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
As Traxin told you, your problem is ASLR
getting Growtopia.exe+10512c would be as following :

IntPtr addr= Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512c;

Good luck.
thanks but i dont know how to use it :/ can you explain
 

Roman_Ablo

Banned
Feb 27, 2017
355
2,402
1
your old code
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
WriteProcessMemory((int)handle, 0x7FF1945134, write, write.Length, ref written);
your new code
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;
WriteProcessMemory((int)handle, addr,write, write.Length, ref written);
idk about c#, im just using logic to do dis
 

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
your old code
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
WriteProcessMemory((int)handle, 0x7FF1945134, write, write.Length, ref written);
your new code
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;
WriteProcessMemory((int)handle, addr,write, write.Length, ref written);
idk about c#, im just using logic to do dis
its give error = Argument 2: cannot convert from 'System.IntPtr' to 'long'
 

Roman_Ablo

Banned
Feb 27, 2017
355
2,402
1
its give error = Argument 2: cannot convert from 'System.IntPtr' to 'long'
Can't you just cast it into a long?
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;
WriteProcessMemory((int)handle, (long)addr, write, write.Length, ref written);
 

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
Can't you just cast it into a long?
C++:
Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;
WriteProcessMemory((int)handle, (long)addr, write, write.Length, ref written);
still give error : system.componentmodel.win32exception access is denied
 

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
Rake;51148 said:
You're writing to a code section of memory. These memory pages do not have write access, they have execute. This is the built in security of windows. You need to use VirtualProtectEx to give yourself write permissions to that memory page.Use the memory protection constant PAGE_EXECUTE_READWRITE and make sure you run as admin.

Also 0x7FF1945134 looks like a dynamic address. You need to use an offset from exe module base address instead if the .exe if ASLR is enabled. Checkout https://guidedhacking.com/getmodulebase

You can also use a simple Nop function like this one
but its c++ ?
 

Roman_Ablo

Banned
Feb 27, 2017
355
2,402
1
C++:
[DllImport("kernel32.dll")]
static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress,
   UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);

Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;

IntPtr old_prot = null;
VirtualProtectEx((int)handle, addr, 5, 0x40, &old_prot);
WriteProcessMemory((int)handle, (long)addr, write, write.Length, ref written);
VirtualProtectEx((int)handle, addr, 5, old_prot, &old_prot);
5 is the number of bytes you're writing (5 nops), 0x40 is the PAGE_EXECUTE_READWRITE for pages, so ya can read/write properly, and old_prot is where we store the previous protection thingy for the page so that you can revert back to it after you're writing the memory

- Untested cos i dont use c#, but if it doesn't work, i'll just test it myself ;)
 
Last edited:

AwsomDud

Newbie
Full Member
Aug 9, 2017
19
54
0
C++:
[DllImport("kernel32.dll")]
static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress,
   UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);

Process pp = Process.GetProcessesByName("Growtopia")[0];
IntPtr handle = OpenProcess(0x1F0FFF, false, pp.Id);
int written = 0;
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
IntPtr addr = Process.GetProcessesByName("Growtopia")[0].MainModule.BaseAddress + 0x10512C;

IntPtr old_prot = null;
VirtualProtectEx((int)handle, addr, 5, 0x40, &old_prot);
WriteProcessMemory((int)handle, (long)addr, write, write.Length, ref written);
VirtualProtectEx((int)handle, addr, 5, old_prot, &old_prot);
5 is the number of bytes you're writing (5 nops), 0x40 is the PAGE_EXECUTE_READWRITE for pages, so ya can read/write properly, and old_prot is where we store the previous protection thingy for the page so that you can revert back to it after you're writing the memory

- Untested cos i dont use c#, but if it doesn't work, i'll just test it myself ;)
its give too many errors try it yourself
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods