C# Write/ReadprocessMemory Fehler Code 5 ( Zugriff Verweigert)

01/07/2013 20:08 .NoThx#1
Hey Leute, ich habe folgendes Problem, undzwra erstelle ich grade ienn hack für Metin, welcher auf Metin2 Singapore auch geht, jedoch bekomme ich bei Metin2 Deutschland, die Fehlermeldung "Zugriff Verweigert".

Ich weiß jedoch auchnicht wo diesen Problem liegt.

Das gleiche ist in C++ auch.

Hier ist einmal die Komplette source:
frmMain.cs
[Only registered and activated users can see links. Click Here To Register...]
cMemory.cs:
[Only registered and activated users can see links. Click Here To Register...]
Player.cs:
[Only registered and activated users can see links. Click Here To Register...]

Und dann gibt es eben noch die Pointer.cs, wo nur die Addressen + Offsets drinne sind.


Welche jedoch stimmen, da sie mit CE funktionieren( ja auf Metin2 DE)



Weiß einer wo der Fehler liegt und / oder wie ich diesen beheben kann?
01/08/2013 04:55 »jD«#2
Sorry, I only speak english.

This could be caused by one of two things. Firstly, as you said it works for one, and not the other, I would start by checking the Memory Pointers are correct for the one it does not work on. You may be trying to use metin singapore memory addresses on metin germany which is totally wrong. If this is true, that is your source of access denied error, as you are probably trying to write into the wrong address and that address is write protected.

Second possibility: Memory regions can be declared write protected meaning only the process owning the memory can write to it (and sometimes read from it). You would need to use DLL Injection to get the process owning the memory to read or write it for you and then pass it back to your process. Named pipes work well! Its basically a proxy.

Hope that helps :)

-jD
01/08/2013 12:39 .NoThx#3
Hey, thanks for your Answer and your help to find a Solution for my Problem, First The Adresses and Pointers are right. I've tested the Adresses and Pointer in CheatEngine.

I think it can be, that the Addresses are Proctected, but how does CheatEngine Read/Write from it? As i know CheatEngine does not Inject an DLL.

Sorry for my bad English :D
01/09/2013 05:12 »jD«#4
I'm not sure. You could use OllyDbg to find out some more information on the memory of the program! You can download it from [Only registered and activated users can see links. Click Here To Register...]. Its pretty simple to use. What you would need to do is run the program, then click File -> Attach in OllyDbg and find your program. Once you've done that click "Attach", give it some time to attach, and then find the little 'M' in the bright blue box up the top of OllyDbg. Clicking that will bring up the Memory View. Simply find your address in the list and then see what is in the "Access" column. That should give you a rough indication on whether the memory is read/write protected. Mind you it isn't impossible to read or write protected memory ;)

About your cheat engine question, as far as I'm aware I think they have their own "driver" that can run in kernel mode with unlimited permissions to read/write memory, they then use some custom functions to use the driver to access the memory. I could be totally wrong as I never really looked into cheat engine and it has been years since I opened it up. Please note that GameGuard and assorted other anti-cheat engines will detect this sort of driver hooking and stop it before you can do anything. I can whip you up a DLL or some examples if you would like.

-jD
01/09/2013 14:34 .NoThx#5
Hey the User [Only registered and activated users can see links. Click Here To Register...] gave me the Answer of my Quest, if i asked him yesterday, the Anti-Cheat of Metin2 Germany blocks Memory Writing and Reading at Kernel and User-level.

So i have to Inject an DLL or ?
01/10/2013 00:27 »jD«#6
Yes, you would need to inject a DLL or like I said above, write a Kernel Driver :)

-jD
09/01/2013 11:07 freekevin42#7
hey I want to do for metin2 turkey. csharp pointers gives the error, if pointers.cs construction? :/