Marshal class
So, why i cant read 8 bytes from unmanaged memory?
Base address is 40000x16 and 4194304x10, not null
38 Replies
It doesnt work like that
What are you trying to make?
I'm trying to read the data of another program from RAM and cram it into my program for future use
Actually here they are
because you need read access to the processes memory
and how do I get it?
if you are on windows, you can use winapi functions to do it
I know, moreover, I already have such a solution. But I thought it was possible to use the functionality of this class.
Anyway thanks for the answer
what's the program that you want to read from?
Anno 1404, game
Unknown Userโข3y ago
Message Not Public
Sign In & Join Server To View
i do a lot with memory, maybe i can help
what problem are you running into exactly?
what do
40000x16
and 4194304x10
mean?
base 16 and base 10?
what the others said is correct, you must p/invoke win32api and do the read from there. Marshal
is for managed memory within your own processThat is, the Marshal class cannot read data from third-party processes?
that's correct
for inter-process (memory) reads, you must invoke kernel functions
on all OSes
Okay, thanks a lot for the answer, now everything falls into place
i highly implore you upgrade to a .NET 7 preview which has much better library imports
on previous versions you'll lose speed marshalling data
the above can also be written as this in .net 6 and lower
but again, this is gonna cost you over the above
for .NET 7, you can just do that, and it'll translate that into native calls with source generation for you
wdym you dont need net7 for this
yeah. that's why i said that's how you can also write it in .net 6 and lower
i miss read
this is how i declare it in .net 7
isnt this breaking a TOS though? in that case this should be removed
not necessarily?
Unknown Userโข3y ago
Message Not Public
Sign In & Join Server To View
unless someone can dig up some TOS of Anno 1440 that says no memory reading lol
looks quite likely
i highly doubt it
games just allow you to do that?
why not?
because you can get an advantage over other players???
it's a single player game from 2009...
doesnt matter
yes, it literally does matter
Unknown Userโข3y ago
Message Not Public
Sign In & Join Server To View
Guys, I've already used this method to read memory and there were no problems with it, so there's no need to argue๐
the mods decide i dont
there's nothing to argue
what you're doing cannot work
it's impossible
Marshal does not do that
I'm not talking about Marshal, but about this
so why'd you try it with Marshal?
just to see if it would work?
Yes
)