I try to use python in my DLL i'm newbie :<
Code:
#include "windows.h"
#define MS_NO_COREDLL
#include <Python.h>
#include <detours.h>
#include "stdafx.h"
#include <string>
#include <sstream>
#include <iostream>
#include <fcntl.h>
#pragma comment(lib, "detours.lib")
using namespace std;
void pickupitem(){
PyObject* args = PyTuple_New(0);
PyObject* ret = PyObject_Call(PyObject_GetAttrString(PyImport_ImportModule("player"), "PickCloseItem"), args, NULL);
double result = PyFloat_AsDouble(ret);
Py_DECREF(ret);
Py_XDECREF(args);
//return result;
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
pickupitem();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Btw. what is the best dll + python injector ? I remember that i saw python + dll injector in one program (DE for metin)
// 2 my metin2 client is still running as administrator privillages.
I dont know how to remove it ( i dont set it in file proporties )







