![]() |
Memory Injection And Cracking
In this article I'm going to show you how to change value of variable during run time. There are many tools around how to do this easily, but I will focus on the way doing it programatically, specifically using C language.
Tools I will use: Cheat Engine 6.0 Here is a simple code for login, I know it's weak and vulnerable, but for proof of concept and for the ease it's ok. test.cpp Code: Cpp
http://imgs.g4estatic.com/memory-inj...njection-1.JPG Now, we have to find out the memory address, where the password is stored. We will do it with Cheat Engine, but there are many other tools for this. So let's open Cheat Engine and click on the computer. It should look something like this: http://imgs.g4estatic.com/memory-inj...njection-2.png Now click on that flashing computer. This should appear: http://imgs.g4estatic.com/memory-inj...njection-3.png Now search for test.exe and click "Open". Well, we have successfully opened our process memory! Let's go further! Fill the search properties like this, and click "First scan". In the left table should appear the string "lol" with exact memory address. http://imgs.g4estatic.com/memory-inj...njection-4.JPG Well, now copy the memory address to some safe place, cause we will need it later! Of course we could change the memory value right now with Cheat Engine, but this article is not dealing "how to use Cheat Engine", we will do this stuff programatically. So our address is : 0022FF6C We will change the memory address value with WriteProcessMemory() function. Here is the code: Code:
#include <cstdlib>Here is what we will use : MemoryValueChange("test.exe", (void*) 0x0022FF6C, 102, 4)
Once you are done, something like this will appear: http://imgs.g4estatic.com/memory-inj...njection-5.JPG Well done, the memory has been changed! Ok, now you can close procmem.exe and look on our test.exe. Try to login with password as is in our code when we complied it, it's "lol". But what happend??? You cannot login? Yeah, right! The password has been chaged to HTML(102) = "f". So try to login with "f"! Voila!!! You are welcomed lord :D http://imgs.g4estatic.com/memory-inj...njection-6.JPG And how to protect? You can use VirtualProtect function, but I'm not going to explain how to use it in this tutorial, maybe later :) But I can show you some tricks! Like protecting yourself from Cheat Engine: Code:
HANDLE hCE = FindWindow(TEXT("Cheat Engine"), NULL); if(hOlly) ExitProcess(0);I hope you enjoyed this article! I enjoyed playing with memory this very much! Stay tuned for further articles! |
Re: Memory Injection And Cracking
Can we do something like this on Linux??
|
Re: Memory Injection And Cracking
Quote:
|
Re: Memory Injection And Cracking
Quote:
For some examples on cracking in linux , you can have a look at my tutorial series of crack me's. |
Re: Memory Injection And Cracking
Quote:
|
Re: Memory Injection And Cracking
this is goog and with the explanation was great .
|
Re: Memory Injection And Cracking
Quote:
|
Re: Memory Injection And Cracking
It’s high-quality and with the enlightenment was great Code.
|
| All times are GMT +5.5. The time now is 03:35. |