Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Kal Online
You last visited: Today at 13:35

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

Advertisement



[Question] Dumping Memory

Discussion on [Question] Dumping Memory within the Kal Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
Kozue's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 20
Received Thanks: 5
[Question] Dumping Memory

This snippet is in a loop that dumps values from memory.

PHP Code:
char &myposition=*(char*)offset;
printf("%x \n",myposition);
offset++; 
This is a little of my output:
PHP Code:
55 ffffff8b ffffffec ffffff83 ffffffec 18 
The data is correct but can anyone tell me why there are leading f's on some of the output? Any comments would be appreciated.
Kozue is offline  
Old 04/30/2009, 16:29   #2
 
Kozue's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 20
Received Thanks: 5
This is dump is actually based on a single line in the public SearchPattern function. Put it in your dll.cpp It will dump all memory to the screen from your starting offset to the end if you run it (but be prepared to wait a looong time for it to finish running).

PHP Code:
if (strcmp(input,"mem") == 0)
{
    
DWORD offset =0x00401000;
    
DWORD end =0x0061A587;

    while (
offset end)
    {
        
char &myposition=*(char*)offset;  // from public SearchPattern func
        
printf("%x \n",myposition);
        
offset++; 
    }

However, as I mentioned before, some output has 6 leading f's. No f's and it's a complete and correct dump of memory.

PHP Code:
55 ffffff8b ffffffec ffffff83 ffffffec 18 ........ 
But the f's don't seem to fit any pattern and I'm totally new at working with memory. Anyone know why these f's are showing up in my output?
Kozue is offline  
Old 04/30/2009, 17:11   #3
 
elite*gold: 0
Join Date: May 2007
Posts: 61
Received Thanks: 35
I believe you want printf("%02x ", ...), using only %x will assume that you are passing an integer and thus print the bytes for 32-bit in your case. The 0 will allow padding (in case your value is between 0-F, it will pad to 00 etc.) and the 2 specifies the width, which would be 2 digits in this case.
The C++ way of doing it:

Code:
#include <iostream>
#include <iomanip>

std::cout << std::hex << std::setw(2);
for (...)
    std::cout << myposition << " ";
std::cout << std::endl;
shad0wZ_ is offline  
Thanks
1 User
Old 04/30/2009, 18:29   #4
 
Kozue's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 20
Received Thanks: 5
Quote:
Originally Posted by shad0wZ_ View Post
I believe you want printf("%02x ", ...), using only %x will assume that you are passing an integer and thus print the bytes for 32-bit in your case. The 0 will allow padding (in case your value is between 0-F, it will pad to 00 etc.) and the 2 specifies the width, which would be 2 digits in this case.
The C++ way of doing it:
Print formatting didn't help, but thanks for getting me to think about designing a fix. I'll have to take some time to figure out originally why the f's were displaying, but after some experimenting what I did was make the following simple changes.

before
PHP Code:
char &myposition=*(char*)offset
after
PHP Code:
BYTE &myposition=*(BYTE*)offset

output
PHP Code:
55 8b ec 83 ec 18 ........ 
Actually, don't even need to use the & operator.

I've done a lot of shell scripting and php, but I'm starting to really get hooked on c/c++.
Kozue is offline  
Old 04/30/2009, 19:40   #5
 
elite*gold: 0
Join Date: May 2007
Posts: 61
Received Thanks: 35
Quote:
Originally Posted by Kozue View Post
Print formatting didn't help, but thanks for getting me to think about designing a fix. I'll have to take some time to figure out originally why the f's were displaying, but after some experimenting what I did was make the following simple changes.

before
PHP Code:
char &myposition=*(char*)offset
after
PHP Code:
BYTE &myposition=*(BYTE*)offset

output
PHP Code:
55 8b ec 83 ec 18 ........ 
Actually, don't even need to use the & operator.

I've done a lot of shell scripting and php, but I'm starting to really get hooked on c/c++.
Yeah a byte is an unsigned character. Didn't think printf() would make a difference there, since it can't make a difference between the types (it basically just gets the parameters from the stack in dword-format). Must be something with your compiler.
You don't need "myposition" at all. You can just use printf("%02x", *reinterpret_cast<byte*>(offset)).

With the &-operator you are creating a reference. This can be useful if you want to use the variable multiple times and modify the original source aswell (it is basically a pointer behind the scenes).
shad0wZ_ is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Question about memory finding.
08/21/2010 - GW Bots - 1 Replies
Hey,I'm pretty much new at memory finding/reading,I've been trying to do it by myself until now,I decided to seek help here because I am somewhat confused. I know how to find base memory address in Guild Wars and I've found out that 1b4 is the offset for "skill id".However if I use base memory address and 1b4 offset it gives me the skill I AM casting.How do I make it so it displays the skill id my target is casting? I've tried pretty much every possibilty with my "knowledge" but I...
Memory Editor question.
08/05/2008 - Conquer Online 2 - 4 Replies
How would I change an item into something like a stancher using a memory editor such as Cheat Engine? And then change it back of course?
[Question] VB.Net and process memory
07/28/2008 - .NET Languages - 5 Replies
Hello, Im having some trouble with read/write process Memory and Im hoping someone here could help me out a little. Code: Dim iMoneyAddress As Integer iMoneyAddress = 90720324 Dim Reader As New MemReader.ProcessMemoryReader() Dim MyProcs As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName(&quo t;Conquer")
[Question] Memory address of VP?
06/06/2008 - Conquer Online 2 - 24 Replies
Anyone know the memory address for Virtue Points? Or is this stored on the server? How is it that people get it on their tools...
[Question] Autoit Memory
06/04/2008 - Conquer Online 2 - 7 Replies
Hey everyone, I just started learning about how to do memory in AutoIt. I made this simple script but for some reason would not work. ------CODE START---------- #Include<NomadMemory.au3> $ProcessID = WinGetProcess("","") $DllInformation = _MemoryOpen($ProcessID) $CharName=_MemoryOpen(0x56BC64,$DllInformation)



All times are GMT +1. The time now is 13:35.


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.