As the title states, this is EXTREMELY simple, so don't think I'm releasing this thinking I'm some kind of god because this code isn't hard to write, at all. If you can't already tell by the name, what this does is outputs wherever there's an error with your exploit/cheat. It doesn't even really have to be an exploit or cheat either, this can work for a lot of other things. For example, say you have a Windows Form with a text-box (for putting code into) and a button (for executing the code). Let's say you put this C++ code in the text-box to execute:
The exception handler would point out an error with line 9 (cout << a << endl) and the error would say that the statement wasn't ended with a semicolon. It's pretty simple, but it's also very useful for error handling and testing code. Here's the code:
Code:
#include <iostream>
using namespace std;
int main()
{
int a = 5;
cout << a << endl
return 0;
}
The exception handler would point out an error with line 9 (cout << a << endl) and the error would say that the statement wasn't ended with a semicolon. It's pretty simple, but it's also very useful for error handling and testing code. Here's the code:
Code:
try
{
// Your code/command
}
catch (const std::exception & e)
{
MessageBoxA(0, e.what(), "Error", 0); // Prints where you messed up or where an error is
}
catch (...)
{
MessageBoxA(0, "Unexpected error", "", 0);
}