Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 02:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP] Visual Basic.NET 05/08 - Read Memory

Discussion on [HELP] Visual Basic.NET 05/08 - Read Memory within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old 07/31/2009, 18:54   #16
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
Quote:
Originally Posted by Zeelia View Post
Thanks guys, finally receiving some help ^.^
And thanks for the code examples, ookamocka and IAmHawtness, this will really help me to proceed with my code.

I hope you can help me if i get some more errors. I really want to do this since there is no (known) application which uses VB.NET, which really is the easiest language (except English).

*EDIT* I have one question though, it may sound newbie.
To use memory addresses in VB I have to replace the initiating double-zeros with &H, right?
But what do I have to do if I have a memory address starting with only one zero?
Is the "rule" that you should replace initiating double zero's with &H or ANY beginning zero, no matter how many, with &H?
I'd really appreciate an answer on this one =)

Thanks!
//Zeelia
If you have an address, say 1B4AD589, then in VB you'd just put &H in fron of all of it: &H1B4AD589. Only reason you put &H in front is so VB knows that it's hexadecimal. It will remove the zeros infront of the hex number automatically, if there is anything to remove.
IAmHawtness is offline  
Old 07/31/2009, 18:59   #17
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
You don't need to call OpenProcess using the ID, .NET provides the native handle as 'variable_name'.Handle. From there you can directly call Read/WriteProcessMemory.
_tao4229_ is offline  
Old 07/31/2009, 19:23   #18
 
elite*gold: 0
Join Date: Dec 2006
Posts: 37
Received Thanks: 8
@IAmHawtness yes I know, thank you. I was just stupid because I put the memory address in a string variable so that's why VB didn't do it automatically. When I removed the quotes, all the magic happened =)

@_tao4229_ Ohh you're right! Thanks
Since I'm using FindWindow, I get the handle directly. But how do you mean with "'variable_name'.Handle"?
Handle is not a property of an integer which the handle variable is.

And here's how I get the handle now, thanks to tao4229:
PHP Code:
            ProcessHandle FindWindow(vbNullString"[Conquer] Raiding Clans")
            
GetWindowThreadProcessId(ProcessHandleProcessID)
            
fReadProcessMemory(&H82B010
Zeelia is offline  
Old 07/31/2009, 20:43   #19
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
Quote:
Originally Posted by Zeelia View Post
Okay so first I don't know how to find the player base address.But for the charname, I have the memory address which isn't static, and I'm having troubles finding the pointer and offset because nothing writes to the memory address while I'm logged in so I have to do a pointer scan which really takes long time... Maybe its here that the player base address comes in?
Code:
Public Const PlayerBaseAddrPtr As Long = &H691CA0

Public Const NamePtrOffset = &H10C
Public Const XCoordOffset = &H1B8
Public Const YCoordOffset = &H1BC
Public Const IDOffset = &H88
To find your char name you could do something like:

Code:
Dim BaseAddress as long
Dim NamePtrAddress as long
Dim Name(16) as byte

ReadProcessMemory ProcessHandle, PlayerBaseAddrPtr, BaseAddress, 8, 0 
ReadProcessMemory ProcessHandle, BaseAddress + NamePtrOffset, NamePtrAddress, 8, 0
ReadProcessMemory ProcessHandle, NamePtrAddress, Name(0), 16, 0

CharName.Text = StrConv(Name, vbUnicode)
That's if not .NET has some other string converting feature that I'm not aware of.
IAmHawtness is offline  
Old 07/31/2009, 21:29   #20
 
elite*gold: 0
Join Date: Dec 2006
Posts: 37
Received Thanks: 8
Thank you!

In fact, since the return from the memory is in a byte, there is this function which I have been told to use:
System.Text.UnicodeEncoding.Unicode.GetString(Name )

But i guess they work the same =)

I'm gonna start up cheat engine to get the memory addresses and I'll test the example you posted above.
I'll edit this post in a few minutes...

*EDIT* Okay. I think I have some kind of error in my code... Maybe while I'm retrieving the window handle, I don't know :S.
All the memory addresses I try give me an error and the code you supplied also gives me errors.
I'm using Err.LastDllError and it returns error '6' which means that my variables have the wrong properties (I think).
I changed the declared function into:
PHP Code:
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As LongByVal lpBaseAddress As LongByRef lpBuffer As LongByVal nSize As IntegerByRef lpNumberOfBytesWritten As Integer) As Integer 
and now it returns null.
Any ideas??
Zeelia is offline  
Old 07/31/2009, 21:32   #21
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
Quote:
Originally Posted by Zeelia View Post
Thank you!

In fact, since the return from the memory is in a byte, there is this function which I have been told to use:
System.Text.UnicodeEncoding.Unicode.GetString(Name )

But i guess they work the same =)

I'm gonna start up cheat engine to get the memory addresses and I'll test the example you posted above.
I'll edit this post in a few minutes...
Good luck
IAmHawtness is offline  
Old 07/31/2009, 22:29   #22
 
elite*gold: 0
Join Date: Dec 2006
Posts: 37
Received Thanks: 8
*bump*
okay edited my post
just bumping so you know that I've edited^^
Zeelia is offline  
Reply

Tags
2008, vb.net, visual basic


Similar Threads Similar Threads
Visual C++ (C++), Visual Basic, oder AutoIT?
06/24/2010 - .NET Languages - 11 Replies
Hallo Zusammen Ich würde gerne mit dem Programmieren anfangen. Meine Vorstellungen: Es müsste möglich sein, eigene Programme zu schreiben wie z. B. MSN, Emule oder ähnliches. Natürlich nie in dieser Grösse nur als Beispiel. Als weiteres sollte mit der gleichen Programmiersprache auch die Möglichkeit bestehen einen WoW Bot zu schreiben. Habe gehört die meisten Bots sind in Auto IT geschrieben. Gibt es unterschiede wegen des Warden schutzes oder kommt es nicht darauf an?
[Brauche Hilfe]Visual Basic Memory Write
04/17/2010 - .NET Languages - 15 Replies
Also wie im Titel schon erwähnt wurde brauche ich hilfe bei memory write in vb. Die Tuts die hier bei EPvp sind bringen mir nicht den da kommen immer fehler... Public Class Form1 Public Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer Public Declare Function WriteProcessMemory Lib "kernel32"...
Visual Basic 6.0
07/09/2007 - Conquer Online 2 - 4 Replies
Hi i am a VB noob and i cant get it to zoom the window i have up i wonder if anyone can help me please because i want to make a new COzoom and i cant get it work please can someone just give me a quick runthrough on how to use VB with basic coding etc all i want is it to zoom my CO windows thanks for your help Penance



All times are GMT +1. The time now is 02:48.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.