Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: kanazky on May 09, 2004, 03:31 PM

Title: Help With Memory Editing
Post by: kanazky on May 09, 2004, 03:31 PM
I made a program that finds the system process but now I wanna try and find a adrress inside that process and change the value of it. How would I do this?
Title: Re:Help With Memory Editing
Post by: Eric on May 09, 2004, 03:38 PM
I'm not completely sure on this because I just started working with memory allocation recently, but I don't think you can access another application's memory without actually being a part of the application so you'll have to read up on DLL injection.
Title: Re:Help With Memory Editing
Post by: iago on May 09, 2004, 03:40 PM
You'll want ReadProcessMemory() and WriteProcessMemory().
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 03:41 PM
You know any tutorials on this kinda stuff????
Title: Re:Help With Memory Editing
Post by: Eric on May 09, 2004, 03:46 PM
Quote from: iago on May 09, 2004, 03:40 PM
You'll want ReadProcessMemory() and WriteProcessMemory().

QuoteEach process on 32-bit Microsoft® Windows® has its own virtual address space that enables addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual address space of 8 terabytes. All threads of a process can access its virtual address space. However, threads cannot access memory that belongs to another process, which protects a process from being corrupted by another process.
MSDN lied to me. :(
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 03:48 PM
completely clueless. If someone could help me out a bit. Im trying to make a program that will search the selected program for memory adresses with a value thats put in a text field. Then post all the results so that the user can change the value and get a different result out of the proccess. All my searches will be on Byte1 values.

Is there any tutorials out there
Title: Re:Help With Memory Editing
Post by: iago on May 09, 2004, 05:57 PM
I gave you two great keywords to stick into google.
Title: Re:Help With Memory Editing
Post by: Forged on May 09, 2004, 06:26 PM
Let me find my mh sourcew code for war3, that should help you a little.
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 06:26 PM
hahaha they most C++ results though
Title: Re:Help With Memory Editing
Post by: Forged on May 09, 2004, 06:36 PM
www.shadow-tech.org/Forged/mh.zip

WriteProcess is shown in that.
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 06:39 PM
Wow I can always count on you guys to bring great help with you to these forums!
Title: Re:Help With Memory Editing
Post by: iago on May 09, 2004, 06:43 PM
Quote from: kanazky on May 09, 2004, 06:26 PM
hahaha they most C++ results though

It works the same in vb as c++ once you get it going.
Title: Re:Help With Memory Editing
Post by: Adron on May 09, 2004, 06:50 PM
Quote from: kanazky on May 09, 2004, 03:31 PM
I made a program that finds the system process but now I wanna try and find a adrress inside that process and change the value of it. How would I do this?

I don't think you'll have much luck with the system process though. What would you want to replace there?
Title: Re:Help With Memory Editing
Post by: Skywing on May 09, 2004, 06:52 PM
Quote from: iago on May 09, 2004, 03:40 PM
You'll want ReadProcessMemory() and WriteProcessMemory().
The system process doesn't have it's own address space (when executing in the system process, the only addressable region is the kernel region).  You would need to be running in kernel mode to read memory from there.
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 06:53 PM
Its actually a game. You can trigger new events by changing the memory adresses but I want to actually search though the adresses for ones that match the byte and then search for those that changed and stuff so i can find the 3 addresses that trigger the event. Yes I am aware that you can download stuff to do this but I wanna learn this.




Go to Page 2
Title: Re:Help With Memory Editing
Post by: kanazky on May 09, 2004, 06:56 PM
Can someone write an example script of a search.
if Command1_click then
Adress = ReadProcessMemory()
hprocess = FrmMain.list1.Iteam              
nsize = FrmMain.Text2
lpNumberOfBytesRead = 1
FrmMain.List2.Additeam Adress
End If

Somthing like that??? sorry im kind of new to this lol.
             
Title: Re:Help With Memory Editing
Post by: TheMinistered on May 11, 2004, 09:08 PM
Lord, MSDN didn't lie to you!  They just didn't expand further... while you can not directly access another application's memory space inside your application, the ReadProcessMemory() and WriteProcessMemory() can!

i.e. let's say in the TARGET application, at address 0040004, a long is stored.  However, that is in the TARGET application... in OUR application it might be used for something completely different!

Thus, the following would code would not be able to change the value located at that address in the TARGET application, but rather the value located in OUR application

__asm
{
mov dword ptr [0040004],  20h;
}

Title: Re:Help With Memory Editing
Post by: Eric on May 12, 2004, 01:27 AM
Ah, thanks for clearing that up.  I kinda had that thought in mind when I was reading up on ReadProcessMemory() and WriteProcessMemory().
Title: Re:Help With Memory Editing
Post by: Dyndrilliac on May 15, 2004, 06:27 PM
http://www.gamehacking.com/tutorials/prgvb2.php

A tutorial on programming trainers in VB using Read/Write Process Memory.