Metick / DMALibrary

Simple but extensive library for DMA users, made for gamehacking
MIT License
343 stars 74 forks source link

VMMDLL_MemReadEx is unable to read the data #29

Closed lishaoju closed 2 months ago

lishaoju commented 3 months ago

When I try to read the item name from the inventory, I can't retrieve it. However, after accessing the pointer once using CE, I can successfully read the name via DMA. How should I handle this situation?

CheetoTrump commented 2 months ago

your probably making a mistake in your code, you will get help quicker if you show what your doing instead of a broad question

lishaoju commented 2 months ago

your probably making a mistake in your code, you will get help quicker if you show what your doing instead of a broad question

wchar_t Value1[256]{}; wchar_t Value2[256]{}; VMMDLL_MemReadEx(Dma.Function.GetHandle(), Dma.Process.Get_Current().Pid, 0x1F1D661A000 + 0x14, reinterpret_cast(&Value1), sizeof(Value1), NULL, VMMDLL_FLAG_FORCECACHE_READ_DISABLE); VMMDLL_MemReadEx(Dma.Function.GetHandle(), Dma.Process.Get_Current().Pid, 0x1F1D65C48C0 + 0x14, reinterpret_cast(&Value2), sizeof(Value2), NULL, VMMDLL_FLAG_FORCECACHE_READ_DISABLE); wprintf(L"Value1 = [%s]\nValue2 = [%s]\n", Value1, Value2); Value1 = [snowballgun] Value2 = []

Thank you for your reply When I use CheatEngine to access the pointer at 0x1F1D661A000 + 0x14 once, DMA can read the characters

Metick commented 2 months ago

Why not just use

wchar_t value[256] = {};
mem.Read(0x1F1D661A000 + 0x14, value, sizeof(value));

that should work (:

lishaoju commented 2 months ago

为什么不直接使用

wchar_t value[256] = {};
mem.Read(0x1F1D661A000 + 0x14, value, sizeof(value));

那应该可以 (:

I tried it, but it still doesn't work, including all the flags

lishaoju commented 2 months ago

Why not just use

wchar_t value[256] = {};
mem.Read(0x1F1D661A000 + 0x14, value, sizeof(value));

that should work (:

I've never encountered this issue when using drivers or injection methods. I currently suspect that it might be because the DMA isn't retrieving data from this region. When I access it once using the CE debugger, it seems to get activated or something similar

Metick commented 2 months ago

Why not just use

wchar_t value[256] = {};
mem.Read(0x1F1D661A000 + 0x14, value, sizeof(value));

that should work (:

I've never encountered this issue when using drivers or injection methods. I currently suspect that it might be because the DMA isn't retrieving data from this region. When I access it once using the CE debugger, it seems to get activated or something similar

You're most likely doing something wrong then unless it's paged out, but that chance is pretty low

lishaoju commented 2 months ago

Why not just use

wchar_t value[256] = {};
mem.Read(0x1F1D661A000 + 0x14, value, sizeof(value));

that should work (:

I've never encountered this issue when using drivers or injection methods. I currently suspect that it might be because the DMA isn't retrieving data from this region. When I access it once using the CE debugger, it seems to get activated or something similar

You're most likely doing something wrong then unless it's paged out, but that chance is pretty low

Alright, I'll use it like this for now. This is a list of names, for example, there are 100 in total. Some of them just can't be retrieved, limited to strings Thank you for your response