Solved Example code for an injection-dll please :(

Hexui Undetected CSGO Cheats PUBG Accounts

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,183
19,938
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,183
19,938
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;
 
Community Mods