Register for your free account! | Forgot your password?

Go Back   elitepvpers > Conquer Online 2 > CO2 Main - Discussions / Questions > CO2 Programming
You last visited: Today at 01:24

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

 

Reading Current Experience from Conquer Process

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2006
Posts: 23
Received Thanks: 29
Reading Current Experience from Conquer Process

Hi, im trying to read the current character experience from the Conquer Process, i am reading from the address 0x5DB490, i found this using CE and am almost certain its the right address (if its not then please correct me). The problem is, when i find the address in CE i find the information i want (that is, the current character experience). But when i read in the data in C# i get a completly wrong value, for example, when i find the value in CE its 2470588, but when i find it in C# its 188. So it seems to me that CE is doing some calculation that im missing (perhaps creating a integer out of subsequent bytes?) Does anyone have a idea of what it is im missing? I tried reading off some subsequent bytes and got the following array:

{188,178,37,0,0,0,0,0,0,0,0,0,50,1}

Thanks in advance for any help.



Origonal is offline  
Old   #2
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 992
Mind showing the C# code that you're using to read the memory ? I could check it.


tanelipe is offline  
Old   #3
 
elite*gold: 0
Join Date: Jun 2006
Posts: 965
Received Thanks: 573
is 2470588 the correct value?

edit: whoops, just read it fully, yes it is XD.

You are probably using ReadProcessMemory wrong. It reads bytes and then from there you convert to an integer.

Here is a snippet from CoHealth

Code:
            #region ReadX
            static int ReadInt(int handle, int addr)
            {
                byte[] buf = new byte[4];
                ReadProcessMemory(handle, addr, buf, 4, 0);
                return BitConverter.ToInt32(buf, 0);
            }
            static int ReadShort(int handle, int addr)
            {
                byte[] buf = new byte[2];
                ReadProcessMemory(handle, addr, buf, 2, 0);
                return BitConverter.ToInt16(buf, 0);
            }
            static byte ReadByte(int handle, int addr)
            {
                byte[] buf = new byte[1];
                ReadProcessMemory(handle, addr, buf, 1, 0);
                return buf[0];
            }
            static byte[] ReadBytes(int handle, int addr, int size)
            {
                byte[] buf = new byte[size];
                ReadProcessMemory(handle, addr, buf, size, 0);
                return buf;
            }
            #endregion
high6 is offline  
Thanks
1 User
Old   #4
 
elite*gold: 0
Join Date: Apr 2006
Posts: 23
Received Thanks: 29
thanks for the two replys guys.

to high6: thanks for those code snippits, that BitConverter class might just be what i was looking for, tho i havnt had to use it when getting character level.

to tanelipe: code as requested, once this is completed ill release the whole thing open source.

Code:
private unsafe void timer_Tick(object sender, EventArgs e)
        {
            if (curProcess != null)
            {
                pReader.ReadProcess = curProcess;
                pReader.OpenProcess();
                byte[] bytesLev = pReader.ReadProcessMemory((IntPtr)CHAR_LEVEL_ADDRESS, 1, out bytesReaded);
                lblLevel.Text = "Level: " + bytesLev[0];
                byte[] bytesExp = pReader.ReadProcessMemory((IntPtr)CHAR_EXPERIENCE_ADDRESS, 4, out bytesReaded);
                lblPercent.Text = "Percent: " + convert.ConvertToPc(bytesLev[0],BitConverter.ToInt32(bytesExp,0)) + "%";
                lblWater.Text = bytesExp[0].ToString();
                pReader.CloseHandle();
            }
        }
im using someone else's API for doing the auctuall work, i think i understand most of the concepts in it, you can obtain the classes by making a codeproject class and downloading the source files from . convert is a very simple custom class that has one public method to take the level and current experience and returns a % by using a hard coded look-up table, im sure the code for that is working well.


Origonal is offline  
Old   #5
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 992
Experience is ulong so it should be read as 8 bytes instead of 4. (Atleast it's like that on packets.) And when converting from the array you should use Convert.ToInt64 then also. Other than that I don't see whats wrong if the experience address is correct
tanelipe is offline  
Thanks
1 User
Old   #6
 
elite*gold: 0
Join Date: Apr 2006
Posts: 23
Received Thanks: 29
Thanks
Ill test it out in about 10 hours and report back the result here.

edit: thanks for your help, im all finsihed now, i had one more hurdle to overcome after getting the exp figure correct, that is realising that i had forgotten to multiply curexp/reqexp by 100 :P


Origonal is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Current conquer.exe +1K reward
Upload Conquer.exe without editing the current one. karma rewarded
2 Replies - CO2 Main - Discussions / Questions
Read Process memory in Conquer.exe
Any of you coders here could help me out? From my program, I'm trying to retrieve/get the SERVER_NAME of the memory of the game. Ex,...
6 Replies - CO2 Main - Discussions / Questions



All times are GMT +1. The time now is 01:24.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.