Valhalla Legends Archive

Programming => Advanced Programming => Topic started by: PyroKid on August 07, 2003, 04:21 PM

Title: Accessing Diablo Memory
Post by: PyroKid on August 07, 2003, 04:21 PM
Im trying to make a program that can log battlenet memory values. The values i want read are the character name, the username, the password, and the realm.

How would i be able to access those values in memory? The location keeps changing. I have tried as much as i can think of. Things such as searching for a static value, injecting asm, and getting the location from a pointer. None work.

Btw i dont want to have to use dll injection.

Thanks for your help!
Title: Re:Accessing Diablo Memory
Post by: Adron on August 07, 2003, 04:54 PM
If the values are there and used, getting them through one or more levels of pointers + offsets should work. The only reason I could see for that not working would be if they are stack variables on some thread other than the first - thread stacks can have "random" starting offsets, right?
Title: Re:Accessing Diablo Memory
Post by: iago on August 07, 2003, 05:21 PM
To get the character name:
const char *Username = (char*)0x12f4b8;

string __fastcall GetCharName()
{
   return Username;
}


The username is also stored in a constant place, but I'm not sure where.

And there's no reason you should need to get the password, unless you're trying to steal accounts but I'm not going to help you with that.

And account-theft is more of a trash-can topic than an advanced-programming topic.
Title: Re:Accessing Diablo Memory
Post by: iago on August 07, 2003, 05:21 PM
btw, I'm assuming you mean Diablo II, not diablo.
Title: Re:Accessing Diablo Memory
Post by: TheMinistered on August 07, 2003, 06:51 PM
I would suggest intercepting a function (specifically, one called when you press LOGIN/OK) and reading the password & username from memory.  (you will probably want a pointer to the textbox, etc), I would comment on the others but I'm about to leave...
Title: Re:Accessing Diablo Memory
Post by: PyroKid on August 07, 2003, 07:25 PM
Its not account theft. Im talking about accessing the memory in general. You know sortof like d2jsp (the auto-login).
Title: Re:Accessing Diablo Memory
Post by: Skywing on August 07, 2003, 08:01 PM
Quote from: iago on August 07, 2003, 05:21 PM
To get the character name:
const char *Username = (char*)0x12f4b8;

string __fastcall GetCharName()
{
   return Username;
}


The username is also stored in a constant place, but I'm not sure where.

And there's no reason you should need to get the password, unless you're trying to steal accounts but I'm not going to help you with that.

And account-theft is more of a trash-can topic than an advanced-programming topic.
That is a stack address and will probably vary from service pack to service pack.  I'd strongly recommend against using it.
Title: Re:Accessing Diablo Memory
Post by: iago on August 07, 2003, 08:25 PM
It's never changed, so it would seem to be fairly safe to use.  When 1.10 comes out, everything is going to change anyway, so I'm not going to put anymore work into it.
Title: Re:Accessing Diablo Memory
Post by: PyroKid on August 07, 2003, 08:37 PM
1.10 isnt coming out anytime soon. You should see the bugs page. If they want to fix all those i might be dead before they release the patch  :P

Anyway I know the character name is a constant value but the username and password arent. I need to know how to read/write to that memory to finish my program.
Title: Re:Accessing Diablo Memory
Post by: iago on August 07, 2003, 10:30 PM
IF you aren't injecting (although you should, use my injector program off the general programming forum, I think it's http://www.backstab.ca/~rbowes/Injector.rar or something like that)

"how" to read/write is done by using ReadProcessMemory and WriteProcessMemory.
Title: Re:Accessing Diablo Memory
Post by: PyroKid on August 07, 2003, 10:55 PM
i know how to read/write the process memory :)
what im saying is that the address of the username/password changes each time. i need to know how to get that address. i checked for pointers but i couldnt find anything. i know that its possible because i downloaded a vb program that can do it, although i cant find the source. the author's email doesnt exist so i cant ask them about it. this is the only place i could find where people that still play diablo actually know what theyre doing and could answer my question. :)
Title: Re:Accessing Diablo Memory
Post by: Adron on August 08, 2003, 02:56 AM
Hook readprocessmemory and writeprocessmemory and run that other program. If you have a program that does it, learn off that.
Title: Re:Accessing Diablo Memory
Post by: Noodlez on August 08, 2003, 05:22 PM
Since the address of the username that you found always changes, just find the offset between it and a static address, the distance between them will always be the same. So you just need that address, and you trace back or forward the offset