从拉姆读 [英] Read from Ram

查看:86
本文介绍了从拉姆读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我想从我的内存中读取数据.但是有一些问题.
MemoryScanner表示地址中:0x2604090是值:1794.

但是当我读到那个地址时,我会得到一个0的回音:(

希望你能帮助我
PS:对不起,我的英语不好:)

这是我的代码:

Hello!

I want to read data from my ram. But there are some Problems.
The MemoryScanner says that in the adress: 0x2604090 is the value: 1794.

But when i read that adress then i get a 0 back :(

I hope you can help me
PS: Sorry for my bad english :)

Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
namespace ReadMemory
{
    public partial class Form1 : Form
    {
        MemoryScanner.ProcessMemoryReader reader = new MemoryScanner.ProcessMemoryReader();
        int[] ProcessIDs;
        public Form1()
        {
            InitializeComponent();
            Process[] Temp;
            Temp = Process.GetProcesses();
            ProcessIDs = new int[Temp.Length];
            for (int i = 0; i < Temp.Length; i++)
            {
                listBox1.Items.Add(Temp[i].ProcessName.ToString());
                ProcessIDs[i] = Temp[i].Id;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            reader.OpenProcess();
            int results = 0;
            uint bytesToRead = 20480;
            int bytesRead = 0;
            byte[] result = reader.ReadProcessMemory((IntPtr)0x2604090, bytesToRead, out bytesRead);
            if (bytesRead <= 0)
            {
                MessageBox.Show("No Bytes are readed!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                for (int i = 0; i < result.Length; i++)
                    results += result[i];
                richTextBox1.Text += results + Environment.NewLine;
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            byte[] WriteBytes = {255};
            int WrittenBytes = 0;
            reader.WriteProcessMemory((IntPtr)0x2604090, WriteBytes, out WrittenBytes);
            if(WrittenBytes <=0)
                MessageBox.Show("No Bytes are written!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
                MessageBox.Show("Successfully written!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            reader.ReadProcess = Process.GetProcessById(ProcessIDs[listBox1.SelectedIndex]);
        }
    }
}



我从MemoryScanner中取出MemoryScanner.cs;)



I took the MemoryScanner.cs from the MemoryScanner ;)

推荐答案

您最好问一些黑客该怎么做!
You''d better ask some hackers how to do this!


这篇关于从拉姆读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆