Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 20:11

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

Advertisement



[HELP-CO2] runtime error R6025 - pure virtual function call

Discussion on [HELP-CO2] runtime error R6025 - pure virtual function call within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
[HELP-CO2] runtime error R6025 - pure virtual function call

Hey guys,

I know whats going wrong w/ my code, its described on a M$ website which follows.



And its all well and good to fix that problem in C++... but i'm not using c++ for that function call, i'm using assembly language.

Namely the following...

PHP Code:
    asmWriter.push((uint8_t)1);
    
asmWriter.push((uint8_t)0);
    
asmWriter.pushDwordPtr(param2);
    
asmWriter.pushDwordPtr(param1);
    
asmWriter.call(0x4FDBFE);
    
asmWriter.movEcxEax();
    
asmWriter.call(0x4F8C0A); 
and don't worry to much about asmWriter, i know it works. I use it for ALL my other functions from casting spells to triggering F-keys in background.

[param1] contains the pointer to my mob structure (first of the item pair in DequeEx from high6)
[param2] contains the pointer to some key value (second of the item pair in DequeEx from high6)

And im pretty sure im calling it correctly, its just the scope im calling it i guess.

Any suggestions??

Thanks.

Edit:

Just some extra information this "runtime error R6025 - pure virtual function call" comes from the co-client after calling the function... And the function does actually make my character start attacking the mob... then after some time (3 to 5 seconds), that error message comes up.

Edit:
I'm looking at this now

I suppose its just a matter of learning how to call virtual functions in assembly language.
clintonselke is offline  
Old 05/30/2009, 20:34   #2
 
elite*gold: 0
Join Date: May 2009
Posts: 98
Received Thanks: 30
Really you should ignore runtime errors. They are MFC's way of trying to get information from a crash. The majority of the time the information wont help you at all.

And yes it is because you most likely called it wrong.

Try having olly break on exceptions and calling it.
high7 is offline  
Old 05/31/2009, 14:37   #3
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Just found out its works sorta... like if I only call it once, then it works perfectly, but if i call it twice (I.E. ask it to attack the same target that i'm already attacking, then it crashes).

I can delay until the target is dead, for target i can 1-hit and works fine.

So i need to find a way to detect if I am currently attacking a particular target. (And if I am attacking a particular target already, then i skip calling the function)

I wouldn't be surprised if co are using C++ exceptions now. And an unhandled exception saying the target is already being attack is unhanded from within the scope of the code cave which calls it.

I'll keep looking in olly to see if there are any JZ or JNZ or something that skips the calling if im already attacking a target.

Edit: ok... that already attacking target exception theory is not correct... ignore that, just found out conquer calls its own attack function when u select to attack a target ur already attacking anyway.


Edit: Right... a simple fix... how about i try and install a SE handler in assembly, so when the exception is thrown by the attack function i will just ignore the exception, because the attack function is working its just also throwing an exception if i attack a target that im already attacking. Maybe the function containing the attack function does this also, because c++ exceptions are not always for errors, they can also be used for other purposes.

Edit: Ok SE installed, but no exceptions captured from the attack() function, weird, its like there is an exception caused later on in the code.

PHP Code:
    // http://www.rohitab.com/sourcecode/seh.html
    // try {
    
asmWriter.pushAd();            // Save Current State
    
line3 asmWriter.getLine();
    
asmWriter.movEsi(0);           // Address of the new exception handler (filled in later)
    
asmWriter.pushEsi();           // Save Old Exception Handler
    
asmWriter.pushDwordPtrFs(0);   // Install New Exception Handler
    
asmWriter.movDwordPtrFsEsp(0);
    
// Attack(StructAddr, Key)
    
asmWriter.push((uint8_t)1);
    
asmWriter.push((uint8_t)0);
    
asmWriter.pushDwordPtr(param2);
    
asmWriter.pushDwordPtr(param1);
    
asmWriter.call(0x4FDBFE);
    
asmWriter.movEcxEax();
    
/*
    asmWriter.xorEbxEbx();
    asmWriter.movEdx(2);
    asmWriter.movEdi(0xF423F);
    asmWriter.movEsi(0x19F0060);
    */
    
asmWriter.call(0x4F8C0A);
    
// } catch (...) {
    
line4 asmWriter.getLine();
    
asmWriter.jmp(0);                   // No Exception Occured, so jump over (filled in later)
    
line5 asmWriter.getLine();
    
asmWriter.setLine(line3);
    
asmWriter.movEsi(line5);
    
asmWriter.setLine(line5);
    
asmWriter.movEspDwordPtrEspPlus(8); // Exception Occured, Get old ESP
    
asmWriter.popDwordPtrFs(0);         // Restore Old Exception Handler
    
asmWriter.addEsp(4);                // ESP value before SEH was set
    
asmWriter.popAd();                  // Restore Old State
    // }
    
line3 asmWriter.getLine();
    
asmWriter.jmp(0);                   // Exception was handled by catch (...) (filled in later)
    
line5 asmWriter.getLine();        // No Exception Occured
    
asmWriter.setLine(line4);
    
asmWriter.jmp(line5);
    
asmWriter.setLine(line5);
    
asmWriter.popDwordPtrFs(0);         // Restore Old Exception Handler
    
asmWriter.addEsp(32+4);             // ESP value before SEH was set. 32 for pushad and 4 for push offset Handler. (No Restore State)
    
line4 asmWriter.getLine();        // Exception has been handled, or no exception occured
    
asmWriter.setLine(line3);
    
asmWriter.jmp(line4);
    
asmWriter.setLine(line4); 
I've also checked this very closely w/ ollydbg to make sure asmWriter is working correctly and to make sure the SE handler is installed properly and all was good. And in the conquer versions prior to patch 5127 i had no problem w/ the attack() function at all. It seems an exception is caused somewhere else inside conquer after the time i call attack w/ my code. very weird.

Edit: I know i shouldn't take notice of runtime errors but.... pure virtual function call, that means an something like the following was done

PHP Code:
class SomeClass {
   public:
     
virtual void someFunc() = 0;
     
SomeClass() {
         
someFunc();
     }
}; 
normally a complier would pick up on this when ur compiling the code, but since im inserting assembly into conquer... im just thinking since the mobs in the DequeEx keep shuffling around, they dont stay in the same place. So what would happen when i call an attack function on a Mob at the same time the mob is being constructed? (assuming the mob class has a base class w/ attack as a pure virtual function). Then i would expect "runtime error: pure virtual function call", which is what i'm getting.

I could be completely wrong, but maybe that is what is going on.
clintonselke is offline  
Reply


Similar Threads Similar Threads
Fatal error: Call to undefined function session_start() in /usr/local/www/apache22/d
04/03/2010 - Metin2 Private Server - 3 Replies
Fehler kann mir jmd. da helfen? Fatal error: Call to undefined function session_start() in /usr/local/www/apache22/data/regist_yes.php on line 50
Fatal error: Call to undefined function mysql_connect()
02/16/2010 - Metin2 Private Server - 3 Replies
hi elitepvpers da ich bei einem problem einfach nicht weiterkomme, hoffe ich hier hilfe zu finden. Ich habe auf FreeBsd Apache Mysql und Php installiert nun möchte ich eine page damit online stellen, die z.b. ein registrierungsformular besitzt und diese daten dann in ne mysql datenbank eingibt. ist zum accounts machen für ein game. wenn ich nun jedoch auf absenden gehe kommt folgender error:
Call Function in Process from another
09/04/2009 - General Coding - 7 Replies
Hi, how the topic says i'm wondering if it's possible to call an function from your application(no dll loaded from a loader) via jmp or call? example: i have app1 that has a function which opens a messagebox "Hello!". Now i'm tryin to call that function from another application while the app1 is running. thanks for your advice
MySro Error~>Microsoft Error Visual C++ Runtime...
08/18/2009 - SRO Private Server - 3 Replies
Hello, i have got a problem: http://image.cp-g.net/pics/4a8971bd15c0d.jpg. I have already installed Microsoft Visual C++ Runtime Library 2005 and after that i installed 2007. It didn´t work. Who can help me? thanks Alucard15
Call COs jump function in masm?
10/28/2006 - Conquer Online 2 - 0 Replies
well i followed the tutorial on how to do this but it didnt give a very good masm example. how would i call the function in masm? does anyone have a good example or code? i have a bunch of other functions to use for hacks but i need to get this done first. im new to masm so i dont really know wat to do. i know how to call functions that dont have variables in other games but no clue when it comes to variables (x and y for jumping.) thanks, high6. p.s. here is the jump function location...



All times are GMT +1. The time now is 20:12.


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