// console version
#include <windows.h>

typedef int (__cdecl *PYMAIN)(int, char **);
static HINSTANCE dll = NULL;

int main(int argc, char **argv)
{
	int rc;
	char *args[3];

	// junk on the end of strings so the binary can be hacked
	args[0] = "app/launch.py\000ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
	args[1] = "app/launch.py\000ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";

	HINSTANCE dll = LoadLibrary("python24.dll");
	PYMAIN Py_Main = (PYMAIN) GetProcAddress(dll, "Py_Main");
	if (argc > 1) {
		args[2] = argv[1];
		rc = (Py_Main)(3, args);
	} else {
		rc = (Py_Main)(2, args);
	}
	return rc;
}
