diff --git a/tools/unstuck.cpp b/tools/unstuck.cpp new file mode 100644 index 000000000..6788e954b --- /dev/null +++ b/tools/unstuck.cpp @@ -0,0 +1,41 @@ +// Make stuck DF run again. + +#include +#include +#include +#include +#include +#include +using namespace std; + +#include +#include + +int main (void) +{ + string blah; + DFHack::API DF("Memory.xml"); + try + { + DF.Attach(); + } + catch (exception& e) + { + cerr << e.what() << endl; + #ifndef LINUX_BUILD + cin.ignore(); + #endif + return 1; + } + + DF.ForceResume(); + cout << "DF should be running again :)" << endl; + getline(cin, blah); + + if(!DF.Detach()) + { + cerr << "Can't detach from DF" << endl; + return 1; + } + return 0; +}