Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 06:34

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

Advertisement



AccessViolationException :(

Discussion on AccessViolationException :( within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2010
Posts: 793
Received Thanks: 268
AccessViolationException :(

hi ich bin grade dabe einen Bot zu schreiben, dieser besteht um einem teil aus 2 in c++ geschribenen dlls(ohne .NET) und zum andernen teil aus einer in c# geschribenen .exe. In meinem c++ code nutze ich die funktion :
PHP Code:
c++:
VirtualAllocExhProcessNULLsizeof(szLibPath), MEM_COMMITPAGE_READWRITE 
, die Memory in einem anderen Prozess alloziert, das funzt eig auch ganz gut. aber wenn ich versuche meinen selbstgeschriebene Funktion, die VirtualAllocEx benutzt, mittlens
PHP Code:
c#:
[DllImport(DllName)]
        public 
unsafe static extern Int32 StartThread(//eine selbst geschribene Funktion in einer selbstgeschriebenen Datei, die VirtualAllocEx benuzt
            
long processID
            
); 
von c# aus auzurufen bekommt ich eine exception des typs AccessViolationException
"Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist."

kann mir da jmd weiterhelfen?
nkkk is offline  
Old 06/06/2010, 17:56   #2
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
xNopex is offline  
Old 06/06/2010, 18:39   #3
 
elite*gold: 0
Join Date: May 2010
Posts: 793
Received Thanks: 268
Quote:
Originally Posted by xNopex View Post
half mir leider nicht weiter , mein problem ist ja nicht, dass StartThread nicht aufgrerufen wird, es wir ja aufgrrufen und auch bis zu einem geissen teil ausgeführt bis es dann eine Exception wirft. was aber warscheinlich nicht am Code in StartThread Liegt, denn wenn ich StartThread als ausführbare exe in c++ ausführe geht es ja.
nkkk is offline  
Old 06/07/2010, 16:44   #4
 
elite*gold: 0
Join Date: May 2010
Posts: 793
Received Thanks: 268
so hab das problem vorrübergehend gelöst, indem ich die c++ dll als .exe schreibe und dann mitttels
PHP Code:
            Process p = new Process();
            
p.StartInfo.FileName "C:\\...   ...\\Release\\RemoteStart.exe";
            
p.StartInfo.Arguments processID.ToString();
            
p.Start(); 
ausführe.
aber dennoch fände ich die Dll methode schoner und wenn jmd was weiss wäre ich sehr erfreut.
nkkk is offline  
Reply




All times are GMT +2. The time now is 06:34.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.