Not a member yet? Register for your free account!


Go Back   elitepvpers > Metin2 > Metin2 Main - Discussions / Questions
You last visited: Today at 19:51

  • Please register to post and access all features, it's quick, easy and FREE!

 

C++ Python Library Error

This is a discussion on C++ Python Library Error within the Metin2 Main - Discussions / Questions forum part of the Metin2 category; Hello guys i included python.h and python librarys to my hack dll after then i debugged my source codes.But theres ...

Closed Thread
 
Thread Tools
Old 12/09/2012, 14:11   #1
Senior Member
 
Join Date: Aug 2012
Posts: 113
Received Thanks: 80
C++ Python Library Error


Hello guys i included python.h and python librarys to my hack dll
after then i debugged my source codes.But theres an errorlog in my game.
Its :

PHP Code:
Module NameC:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\CL2-Revolution.exe.exe
Time Stamp
0x7375705f Tue May 20 23:45:19 2031


Exception Type
0x80000003

eax
0x00000000    ebx0x0012ef10
ecx
0x7599e0c5    edx0x00000001
esi
0x0012ef1c    edi0x0012ef14
ebp
0x0012eeb4    esp0x0012eeb0

0x759b381b    C
:\Windows\system32\KERNELBASE.dll
0x44680f4e    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\python22_d.dll
0x445ff5a0    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\python22_d.dll
0x445ff580    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\python22_d.dll
0x4464aeaa    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\python22_d.dll
0x446484ee    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\python22_d.dll
0x56ff3f85    C
:\Users\Canberk\Desktop\test.dll
0x56ff5d83    C
:\Users\Canberk\Desktop\test.dll
0x56ff36e4    C
:\Users\Canberk\Desktop\test.dll
0x00492640    C
:\Users\Canberk\Desktop\Finish Client für Cl2-Revolution\CL2-Revolution.exe
0x01d0e768    
0xe8000037    
0x000dbec4    
0x8689c72b    
0x000130f4    
0x0dbeb7e8    
0x740d8b00    
0x3b007d2c    
0x2b4a76c1    
0x01f43dc1    
0x147d0000    
0x30f48e39    
0x0c770001    
0x2c7005c7    
0x0001007d    
0x33eb0000    
0xf5f7d233    
0xaf0ff88b    
0x57cf03fd    
0x73eba868    
0x740d8900    
0xe8007d2c    
0x001adf99    
0x0a6c0d8b    
0xc483007d    
0x55e85708    
0xeb000dbf    
0x701d8906    
0x8a007d2c    
0x01320d86    
0x74c08400    
0x701d8908    
0xeb007d2c    
0x701d390c    
0x0f007d2c    
0x0003ff85    
0x6805dd00    
0x53007a4f    
0x14245cd9    
0x1424448b    
0xc9e85050    
0x8300115f    
0x21e80cc4    
0x89000dbe    
0x8a102444    
0x01323086    
0xb3c08400    
0x8d327501    
0x000920be    
0xe8cf8b00    
0x00091b44    
0x2374c085    
0xe0102d8b    
0xcd8b007c    
0xf9b353e8    
0xe8cf8bff    
0x00093b1c    
0x0974c085    
0x21e8cd8b    
0xebfff9b3    
0x8bdb3202    
0x5b26e8ce    
0xc084000b    
0x568b0e75    
0x204e8d20    
0x000bb868    
0x1052ff00    
0x1375db84    
0x8d20468b    
0xb868204e    
0xff00000b    
0x47e91050    
0x8b000003    
0x7d0a740d    
0x6e52e800    
0xbe8d000b 
I think there's an error in python22_d.dll
And of course my dll didnt work the game closed itself.

Any idea about the error ?

My Source :

PHP Code:
#include "stdafx.h"
#include <windows.h>
#include <Python.h>
#include "detours.h"
#include <string>
#include <sstream>
#include <iostream>
#include <fcntl.h>
#pragma comment(lib, "detours.lib")
using namespace std;

void (__stdcallMainFunc)();
bool ScanForOffsets();
DWORD dwFindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char szMask);
bool bDataCompare(const BYTEpData, const BYTEbMask, const charszMask);
voidGetCallDest(voidaddr);
void Main();
void SendPacket(const unsigned charpacketdataunsigned long len);
void Hook_MainFunc();

DWORD Offset1 0//mainstream
DWORD Offset2 0//AddPacketData Function
DWORD Offset3 0//AddSignatureByte Function
DWORD Offset4 0//Update Function (MainFunc)
DWORD Offset5 0//RegisterVid Function
void AutoAttack();

BOOL APIENTRY DllMain(HANDLE hModuleDWORD ul_reason_for_callLPVOID lpReserved)
{
    switch (
ul_reason_for_call)
    {
        case 
DLL_PROCESS_ATTACH:
            
ScanForOffsets();
            
MainFunc = (void (__stdcall*)())DetourFunction((PBYTE)Offset4, (PBYTE)Hook_MainFunc); //0x00471F50
            
CreateThread(NULL0, (LPTHREAD_START_ROUTINE)MainhModule0NULL);
            break;
        case 
DLL_THREAD_ATTACH:
            break;
        case 
DLL_THREAD_DETACH:
            break;
        case 
DLL_PROCESS_DETACH:
            break;
    }
    return 
TRUE;
}

bool ScanForOffsets()
{
    
DWORD Base 0x00400000;
    
DWORD SizeOfCode;

    
DWORD i Base;
    while ((
memcmp((void *)i"PE\0\0"4)) && (<= Base 0x1000))
        
i++;

    if (
<= Base 0x1000)
        
SizeOfCode = *(DWORD *)(0x1C);


    
BYTE Signature1[] = { 0x8B0x0D0xF40x1C0x5F0x000x520x500xE80x67,
                          
0x600x000x000xE80x120x7B0x120x000x5E};


    
BYTE Signature2[] = { 0x8B0xC10x8B0x500x380x8B0x480x340x530x8B,
                          
0x5C0x240x080x2B0xCA0x3B0xD9};

    
BYTE Signature3[] = { 0xC20x040x000x8B0xCE0xE80xB20xCE0x0D0x00,
                          
0x5E};

    
BYTE Signature4[] = { 0x830xEC0x080x560x8B0xF10x8D0x440x240x04,
                          
0x500x8D0x4C0x240x0C0x51};

    
BYTE Signature5[] = { 0x8B0x440x240x040x890x810x9C0x040x000x00,
                          
0xC20x040x00};


    
Offset1 = *(DWORD *)(dwFindPattern(Base 0x1000SizeOfCodeSignature1"xx????xxx????x????x") + 2);
    
Offset2 dwFindPattern(Base 0x1000SizeOfCodeSignature2"xxxxxxxxxxxxxxxxx");
    
DWORD Offset3_Address = (dwFindPattern(Base 0x1000SizeOfCodeSignature3"xxxxxx????x") + 6);
    
Offset3 reinterpret_cast<DWORD>(GetCallDest((DWORD *)(Offset3_Address 1)));
    
Offset4 dwFindPattern(Base 0x1000SizeOfCodeSignature4"xxxxxxxxxxxxxxxx");
    
Offset5 dwFindPattern(Base 0x1000SizeOfCodeSignature5"xxxxxxxxxxxxx") + 4;


    if ((
Offset1))
        return 
true;
    else
        return 
false;
}

voidGetCallDest(voidaddr)
{
    
unsigned charcallDestAddr reinterpret_cast<unsigned char*>(addr) + 1;

    
uintptr_t relativeDest = *reinterpret_cast<uintptr_t *>(callDestAddr);
    return 
reinterpret_cast<void*>(uintptr_t(addr) + relativeDest 5);
}

bool bDataCompare(const BYTEpData, const BYTEbMask, const charszMask)
{
    for(;*
szMask;++szMask,++pData,++bMask)
        if(*
szMask=='x' && *pData!=*bMask 
            return 
false;
    return (*
szMask) == NULL;
}

DWORD dwFindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char szMask)
{
    for(
DWORD i=0dwLeni++)
        if( 
bDataCompare( (BYTE*)( dwAddress+),bMask,szMask) )
            return (
DWORD)(dwAddress+i);   
    return 
0;
}


void SendPacket(const unsigned charpacketdataunsigned long len)
{
    
DWORD dwSendFunc Offset2;
    
DWORD dwAddSignatureByte Offset3;
    
__asm
    
{
        
PUSH packetdata
        PUSH len
        MOV EAX
Offset1
        MOV ECX
DWORD PTR DS:[EAX]
        
CALL dwSendFunc
        MOV EAX
Offset1
        MOV ECX
DWORD PTR DS:[EAX]
        
CALL dwAddSignatureByte
    
}
}


void Hook_MainFunc()
{
    
_asm pushad
    AutoAttack
();
    
__asm popad
    
return (*MainFunc)();
}

void Main()
{
    
AutoAttack();
}

void StartAutoAttack(){
    
PyObjectargs PyTuple_New(1);
    
Py_INCREF(Py_True);
    
PyTuple_SetItem(args0Py_True);

    
PyObjectret PyObject_Call(PyObject_GetAttrString(PyImport_ImportModule("player"), "SetAttackKeyState"), argsNULL);

    
Py_XDECREF(ret);
    
Py_XDECREF(args);
}

void AutoAttack()
{
    
StartAutoAttack();

AutoAttack python codes from @Infinity.

__________________

LazYGirl. is offline  
Old 12/09/2012, 18:27   #2
Metin2 Hax0r
 
Join Date: May 2008
Posts: 896
Received Thanks: 4,081
you do it wrong... start new dll project
KaMeR1337 is offline  
Old 12/09/2012, 20:00   #3
Senior Member
 
Join Date: Aug 2012
Posts: 113
Received Thanks: 80
solved# thanks for comment just need to release not debug Lol
LazYGirl. is offline  
Closed Thread

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
FATAL ERROR!! Python Library file not exist dertim96 Metin2 Main - Discussions / Questions 5 12/23/2012 11:47
C++ Python Library Error LazYGirl. C/C++ 0 12/09/2012 10:09
FATAL ERROR!! Python Library file not exist! mojafaca1 Metin2 PServer - Discussions / Questions 4 11/13/2012 17:58
fatal error python library not exist TROPENkiller Metin2 PServer - Discussions / Questions 4 06/27/2011 15:59
FATAL ERROR!! Python Library file not exist GefChrom Metin2 PServer - Discussions / Questions 1 03/29/2011 15:34



All times are GMT +2. The time now is 19:51.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.