• Welcome to Valhalla Legends Archive.
 

Accessing Diablo Memory

Started by PyroKid, August 07, 2003, 04:21 PM

Previous topic - Next topic

PyroKid

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!

Adron

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?

iago

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


iago

btw, I'm assuming you mean Diablo II, not diablo.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


TheMinistered

#4
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...

PyroKid

Its not account theft. Im talking about accessing the memory in general. You know sortof like d2jsp (the auto-login).

Skywing

#6
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.

iago

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


PyroKid

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.

iago

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


PyroKid

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. :)

Adron

Hook readprocessmemory and writeprocessmemory and run that other program. If you have a program that does it, learn off that.

Noodlez

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