• Welcome to Valhalla Legends Archive.
 

[Resolved] Determining gamestate...

Started by Don Cullen, June 19, 2005, 04:57 PM

Previous topic - Next topic

Don Cullen

This code keeps returning a zero, even if I'm inside a game playing when it should be returning a 01... I checked WinHack to look at the 645E54 offset, and the hex address shows 01 as it should. When I obtain the ReadProcess value, it's always blank. Is there a way I can get the hex address itself (01)? Or is there a better way to identify if the user is in a game?

The program emits a type mismatch error in regards to the Vala variable. When I change the variable to a long, the program executes fine, but the variable has nothing stored inside it (meaning it displays zero, even if SC's offset that I'm obtaining it from has 01 in it)...

Here's a screenshot of what I'm talking about:

*Screenshot removed due to issue being resolved*
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Kp

Before you sink too much more time into this, I should point out that you'll have much finer grained control (and likely greater success) if you load directly into the Starcraft process, rather than trying to perform {Read,Write}ProcessMemory calls from outside.  Of course, Visual Basic is a horrible language [for injecting into other processes].
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Don Cullen

Quote from: Kp on June 19, 2005, 05:03 PM
Before you sink too much more time into this, I should point out that you'll have much finer grained control (and likely greater success) if you load directly into the Starcraft process, rather than trying to perform {Read,Write}ProcessMemory calls from outside. 

Care to explain?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Arta

The two values you're pointing to on that screenshot are the same. The display on the left shows the value of the byte, 0x01, and the display on the right shows its ASCII representation. Since 0x01 is a control character and not a printable character, the display shows nothing.

Most programs would show a dot or a square or something, but yours appears not to.

Don Cullen

Quote from: Arta[vL] on June 19, 2005, 05:24 PM
The two values you're pointing to on that screenshot are the same. The display on the left shows the value of the byte, 0x01, and the display on the right shows its ASCII representation. Since 0x01 is a control character and not a printable character, the display shows nothing.

Most programs would show a dot or a square or something, but yours appears not to.

Exactly, so how do I have my RPM determine if the state is 0x01 or 0x00?
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

R.a.B.B.i.T


Don Cullen

Quote from: rabbit on June 19, 2005, 05:44 PM
If Vara = Chr(&H1) Then

To do that, I had to change Vala to a string (Dim Vala as String). The code executed without a problem, but it returned with nothing. It said Unknown Status:. As in, blank string, there's nothing, not even a single byte of data in it... This is the code I have so far:

   
    'Let's make sure the person is in a game.
   
    Dim Vala As String
   
    ReadProcessMemory pHandle, &H645E54, Vala, &H1, 0&
   
    'MsgBox Vala
    'Exit Sub
   
    If Vala = Chr$(&H1) Then
        MsgBox "Game Status: Active"
    ElseIf Vala = Chr$(&H0) Then
        MsgBox "Game Status: Inactive"
    Else
        MsgBox "Unknown status:" & Vala
    End If


By the way, thanks for helping thus far!
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Kp

Quote from: Kyro on June 19, 2005, 05:05 PM
Quote from: Kp on June 19, 2005, 05:03 PMBefore you sink too much more time into this, I should point out that you'll have much finer grained control (and likely greater success) if you load directly into the Starcraft process, rather than trying to perform {Read,Write}ProcessMemory calls from outside. 
Care to explain?

Yours is one of the nicer request-for-clarifications I've received, so I don't intend this to be insulting, but: I thought I was quite clear.  On what do you want me to elaborate?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Don Cullen

Quote from: Kp on June 19, 2005, 05:52 PM
Quote from: Kyro on June 19, 2005, 05:05 PM
Quote from: Kp on June 19, 2005, 05:03 PMBefore you sink too much more time into this, I should point out that you'll have much finer grained control (and likely greater success) if you load directly into the Starcraft process, rather than trying to perform {Read,Write}ProcessMemory calls from outside. 
Care to explain?

Yours is one of the nicer request-for-clarifications I've received, so I don't intend this to be insulting, but: I thought I was quite clear.  On what do you want me to elaborate?

That's because I'm here to learn, not to offend. I can't learn if I annoy everyone who's trying to help by being dense. I was asking you elaborate on what you mean by loading directly into the Starcraft process, rather than performing memory calls from VB-- I'm not understanding what you mean by that, and how I'd do that...

Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Don Cullen

This problem has been solved thanks to Dyndrilliac at BWHacks.com forums.

For the solution, feel free to read the thread:

http://www.bwhacks.com/forums/showthread.php?t=5023

Kp- I'm still interested in how I can handle this better, so I'm open to any suggestion you may have to make- I'm always looking for ways to improve!
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Kp

Quote from: Kyro on June 19, 2005, 06:06 PMI was asking you elaborate on what you mean by loading directly into the Starcraft process, rather than performing memory calls from VB-- I'm not understanding what you mean by that, and how I'd do that.

Well, it'll be much easier to access Starcraft memory if you have code executing in the context of the Starcraft process.  As it is, your VB application sits outside the process and peeks/pokes using Windows API calls; I was suggesting to have your code execute as part of Starcraft, so that you can read/write its variables directly.  As for how to do that, look into SampleHDL.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Don Cullen

Ahhh... C++... I don't have C++, and I don't know any C++... Bad, I know-- heh.
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.

Kp

[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!


Don Cullen

Only one problem-- I know absolutely no C++ :-P I once took a class in programming in C++, but it's been over two years since- and I've forgotten everything I learned... So I'd be annoying the heck out of you due to my newbieness...  :P
Regards,
Don
-------

Don't wonder why people suddenly are hostile when you treat them the way they shouldn't be- it's called 'Mutual Respect'.