Solved Example code for an injection-dll please :(

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

forivin

Newbie
Full Member
Mar 24, 2013
10
182
0
I'd like to read and write memory from within a process using dll injection.
I wrote my injector and it works very well, but I have a hard time writing this dll. All the tutorials I found are so ... COMPLEX.
You know, I don't need to create a windows forms window or w/e. I just want to write given values to specific addreses and show the content of other addresses in a messagebox or consolewindow.

So what I'm asking for is a very very basic and simple code of an dll with an example of reading a memory address and writing to a memory address.
I would really really appreciate it.
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
AllocConsole.

*(data type*)address to read and write, eg

cout << *(int*)0x1234567 << endl;

*(int*)0x1234567 = 100;
 

forivin

Newbie
Full Member
Mar 24, 2013
10
182
0
Well, first of all I'm impressed how super easy it seems to be to read/write within a process, but I was actually looking for a more complete sourcecode. :p
I'm not very familiar with c++.

So I created a new dll project in vc++, what would be the content of my main.cpp?
Would it be something like this?
C++:
#include <iostream>
DWORD WINAPI Main_thread( LPVOID lpParam )
{
    cout << *(int*)0x1234567 << endl;
    *(int*)0x1234567 = 100; 
    return S_OK;
}
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
Well, first of all I'm impressed how super easy it seems to be to read/write within a process, but I was actually looking for a more complete sourcecode. :p
I'm not very familiar with c++.

So I created a new dll project in vc++, what would be the content of my main.cpp?
Would it be something like this?
C++:
#include <iostream>
DWORD WINAPI Main_thread( LPVOID lpParam )
{
    cout << *(int*)0x1234567 << endl;
    *(int*)0x1234567 = 100; 
    return S_OK;
}
Oh well.

C++:
AllocConsole();
freopen("CONIN$", "r", stdin); 
freopen("CONOUT$", "w", stdout); 
freopen("CONOUT$", "w", stderr); 

cout << "0x1234567 contains: (int)" << *(int*)0x1234567 << endl;
*(int*)0x1234567 = 100; 
cout << "0x1234567 now contains: (int)" << *(int*)0x1234567 << endl;
 
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