Original lib: http://www.byond.com/developer/Ssj4justdale/stdoutshell
Source:
#include <string>
#include <iostream>
#include <stdio.h>
#include <conio.h>
extern "C" __declspec(dllexport) const char * shell(int argc, char ** argv);
std::string result;
const char * shell(int argc, char ** argv) {
FILE* pipe = _popen(argv[0], "r");
if (!pipe) return "ERROR";
result.clear();
char buffer[128];
while(!feof(pipe)) {
if(fgets(buffer, 128, pipe) != NULL)
result.append(buffer);
}
_pclose(pipe);
return result.c_str();
}