Thread: EnginePK Source

Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    EnginePK's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    8
    My Mood
    Amused

    Post EnginePK Source

    hi,
    i'm new to this site, but today im did a little work and i made this "engine source"

    What is it?
    It is like a nomenu, but i added a bit of code (that i coded) and now you can draw UNDETECTED lines on the game

    example:



    You will need: updated detours

    Direct3D9.cpp
    Code:
    #include <windows.h>
    #include <d3dx9.h>
    #include <d3d9.h>
    #include <fstream>
    #include "Detour.h"
    #include "Class.h"
    
    #pragma comment(lib,"d3dx9.lib")
    #pragma comment(lib,"d3d9.lib")
    
    Engine *engine;
    ID3DXFont *pfont;
    INT ShowEngine=0;
    bool DrawHook;
    
    typedef HRESULT (__stdcall * oReset) (LPDIRECT3DDEVICE9 pDev,D3DPRESENT_PARAMETERS *pPara);
    oReset pReset;
    
    
    typedef HRESULT (__stdcall *oPresent) (LPDIRECT3DDEVICE9 pDev,CONST RECT *pBegin,CONST RECT *pMid,HWND hWnd,CONST RGNDATA *pEnd);
    oPresent pPresent;
    
    HRESULT WINAPI myReset(LPDIRECT3DDEVICE9 pDev,D3DPRESENT_PARAMETERS *pPara)
    {
    	pfont->OnLostDevice();
    	HRESULT pResetDevice = pReset(pDev,pPara);
    	pfont->OnLostDevice();
    	return pResetDevice;
    }
    
    void DrawLine(int x, int y, DWORD Color, const char *txt, LPD3DXFONT nfont, DWORD Style = DT_NOCLIP )
    {
    	RECT Newstring = { x, y, x + 120, y + 20 };
    	char buffer[500] = {'\0'};
    	va_list va_alist;
    
    	va_start(va_alist, txt);
    	vsprintf_s(buffer, txt, va_alist);
    	va_end(va_alist);
    
    	nfont->DrawTextA(NULL, buffer, -1, &Newstring, Style, Color);
    }
    
    HRESULT WINAPI cHacks(char *Dest)
    {
    	if(GetModuleHandle(Dest))
    	{
    
    	if(GetAsyncKeyState(VK_F1)&1){ *(int*)0x00/*Adress*/ = 1; }
    	if(GetAsyncKeyState(VK_F2)&1){ *(int*)0x00/*Adress*/ = 0; }
    
    	}
    	return 0;
    }
    
    void Funcs()
    {
    	DrawLine(10,25,D3DCOLOR_ARGB(255,0,255,255),"-GlassWalls on - F1",pfont);
    	DrawLine(10,40,D3DCOLOR_ARGB(255,0,255,255),"-GlassWalls off - F2",pfont);
    	DrawLine(10,55,D3DCOLOR_ARGB(255,0,255,255),"-Functions here",pfont);
    	DrawLine(10,70,D3DCOLOR_ARGB(255,0,255,255),"-mpgh.net",pfont);
    	DrawLine(10,85,D3DCOLOR_ARGB(255,0,255,255),"-Coded by EnginePK",pfont);
    }
    
    void Controls()
    {
    	if(ShowEngine==0)
    	{
    		if(GetAsyncKeyState(VK_INSERT)&1)
    		{
    			ShowEngine=1;
    		}
    	}
    
    	if(ShowEngine==1)
    	{
    		if(GetAsyncKeyState(VK_INSERT)&1)
    		{
    			ShowEngine=0;
    		}
    	}
    }
    
    HRESULT WINAPI myPresent(LPDIRECT3DDEVICE9 pDev,CONST RECT *pBegin,CONST RECT *pMid,HWND hWnd,CONST RGNDATA *pEnd)
    {
    	if(!DrawHook)
    	{
    		D3DXCreateFont(pDev,13,0,FW_NORMAL,1,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_DONTCARE,(LPCSTR)"Verdana",&pfont);
    		DrawHook=true;
    	}
    
    	if(pfont == NULL)
    		pfont->OnLostDevice();
    	Controls();
    
    	DrawLine(10,10,D3DCOLOR_ARGB(255,255,255,0),"Press Insert to show/hide the engine hotkeys!",pfont);
    	if(ShowEngine==1)
    	{
    	Funcs();
    	}
    	cHacks("WarRock.exe");
    	return pPresent(pDev,pBegin,pMid,hWnd,pEnd);
    }
    
    int Direct3D9Hook()
    {
    	HINSTANCE hInst;
    	hInst=0;
    	DWORD vTable[105];
    	do{
    		hInst = GetModuleHandle("d3d9.dll");
    		if(!hInst)
    			Sleep(20);
    	}while(!hInst);
    	{
    		pReset = (oReset)EngineDetour((DWORD)vTable[16],(DWORD)myReset,5);
    		pPresent = (oPresent)EngineDetour((DWORD)vTable[17],(DWORD)myPresent,7);
    	}
    	return 0;
    }
    
    BOOL __stdcall DllMain(HINSTANCE hDll,DWORD dwReason,LPVOID lpv)
    {
    	if(dwReason == DLL_PROCESS_ATTACH)
    	{
    		CreateThread(0,0,(LPTHREAD_START_ROUTINE)Direct3D9Hook,0,0,0);
    	}
    	return TRUE;
    }
    Menu.cpp
    Code:
    #include <d3dx9.h>
    #include <d3d9.h>
    #include <windows.h>
    #include <fstream>
    #include "Class.h"
    
    ID3DXFont *pNewFonts;
    
    void Engine::AddItem(char *txt, char **opt, int *var, int MaxValue)
    {
    	MENU[Mmax]->typ=MENUITEM;
    	MENU[Mmax]->txt=txt;
    	MENU[Mmax]->opt=opt;
    	MENU[Mmax]->var=var;
    	MENU[Mmax]->MaxValue=MaxValue;
    	Mmax++;
    }
    
    void NewLine(int x, int y, DWORD Color, const char *txt, LPD3DXFONT nfont )
    {
    	RECT Newstring = { x, y, x + 120, y + 20 };
    	char buffer[500] = {'\0'};
    	va_list va_alist;
    
    	va_start(va_alist, txt);
    	vsprintf_s(buffer, txt, va_alist);
    	va_end(va_alist);
    
    	pNewFonts->DrawTextA(NULL, buffer, -1, &Newstring, DT_NOCLIP, Color);
    }
    
    void Engine::Display()
    {
    	NewLine(20,200,D3DCOLOR_ARGB(255,255,255,0),"Press Insert to show/hide the engine hotkeys!",pNewFonts);
    }
    Class.h
    Code:
    #include <windows.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    
    #define MAXMENUITEMS 10
    #define MENUITEM     1
    #define MENUFOLDER   2
    
    typedef struct
    {
    	int typ;
    	char *txt;
    	char **opt;
    	int *var;
    	int MaxValue;
    } EngineMenu;
    
    
    class Engine
    {
    public:
    	Engine(char *EngineTitle=0)
    	{
    		Mmax=0;
    		ShowMenu = 1;
    		MENU = (EngineMenu **)malloc(4*MAXMENUITEMS);
    		for(int i=0; i<MAXMENUITEMS; i++) MENU[i] = (EngineMenu *)malloc(sizeof(EngineMenu));
    	} ~Engine(){
    		for(int i=0; i<MAXMENUITEMS; i++)
    		free(MENU[i]);
    		free(MENU);
    	}
    	EngineMenu **MENU;
    	int ShowMenu;
    	int Mmax;
    	void Display();
    	void Render(float x,float y,ID3DXFont *pfont,LPDIRECT3DDEVICE9 pDev);
    	void AddItem(char *txt,char **opt,int *var,int MaxValue);
    private:
    	char *WeWant;
    	float Max_Ofs;
    	float Size;
    };
    Credits ~EnginePK

  2. The Following 6 Users Say Thank You to EnginePK For This Useful Post:

    APhotos (10-21-2012),Enj0i (08-20-2011),Mike Shinoda (08-12-2011),R3dLine (08-13-2011),Terell. (08-12-2011),_Apostolos_ (08-21-2011)

  3. #2
    TheCamels8's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Israel :D
    Posts
    2,945
    Reputation
    174
    Thanks
    1,376
    My Mood
    Cheeky
    Interesting..
    Great job!

  4. #3
    Terell.'s Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    JAMAICAA
    Posts
    6,923
    Reputation
    273
    Thanks
    1,165
    My Mood
    Angry
    This is really nice. Do you have any experience with d3dmenus ?

    Warrock Minion 8-13-2011 - N/A
    A.V.A Minion since 11-1-11 - 11-12-11

  5. #4
    TheCamels8's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Israel :D
    Posts
    2,945
    Reputation
    174
    Thanks
    1,376
    My Mood
    Cheeky
    Quote Originally Posted by Shunnai View Post
    This is really nice. Do you have any experience with d3dmenus ?
    It seems like the answer is yes..

  6. #5
    Terell.'s Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    JAMAICAA
    Posts
    6,923
    Reputation
    273
    Thanks
    1,165
    My Mood
    Angry
    I was asking cause if he didn't I would be amazed .

    Warrock Minion 8-13-2011 - N/A
    A.V.A Minion since 11-1-11 - 11-12-11

  7. #6
    EnginePK's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    8
    My Mood
    Amused
    Quote Originally Posted by TheCamels8 View Post
    Interesting..
    Great job!
    Thank you
    What is the intresting part?

    Quote Originally Posted by Shunnai View Post
    This is really nice. Do you have any experience with d3dmenus ?
    yes

  8. #7
    TheCamels8's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Israel :D
    Posts
    2,945
    Reputation
    174
    Thanks
    1,376
    My Mood
    Cheeky
    Quote Originally Posted by EnginePK View Post
    Thank you
    What is the intresting part?
    Everything ^^
    It's always interesting to know more things

  9. #8
    Mike Shinoda's Avatar
    Join Date
    May 2008
    Gender
    male
    Location
    127.0.0.1
    Posts
    1,177
    Reputation
    67
    Thanks
    165
    My Mood
    Amazed
    WelCome and thanks for this
    It always starts with one thing...

  10. #9
    EnginePK's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    8
    My Mood
    Amused
    Quote Originally Posted by TheCamels8 View Post
    Everything ^^
    It's always interesting to know more things
    yes it is

    Quote Originally Posted by makis5 View Post
    WelCome and thanks for this
    Thank you

  11. #10
    nielshetschaap's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    175
    Reputation
    10
    Thanks
    29
    My Mood
    Fine
    thnx man

  12. #11
    AeroMan's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Hell
    Posts
    3,291
    Reputation
    189
    Thanks
    3,049
    My Mood
    Busy
    good job :P

  13. #12
    TheGoodB0y's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    507
    Reputation
    12
    Thanks
    44
    My Mood
    In Love
    I Gotta try this, i hope i'll succsessing

  14. #13
    _Apostolos_'s Avatar
    Join Date
    Aug 2011
    Gender
    male
    Location
    Athnes, Greece
    Posts
    129
    Reputation
    62
    Thanks
    70
    My Mood
    Amused
    tHANKS A LOT!

  15. #14
    Enj0i's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    217
    Reputation
    6
    Thanks
    419
    My Mood
    Amazed
    THis is AWEEEsome.
    I'm probably one of the few noobs that actually reads the thread.



    Click Here for a starter book to learn C++!
    Click Here for a beginner's book to learn D3D!

    If I Helped You, Press the Thanks button!

  16. #15
    _Apostolos_'s Avatar
    Join Date
    Aug 2011
    Gender
    male
    Location
    Athnes, Greece
    Posts
    129
    Reputation
    62
    Thanks
    70
    My Mood
    Amused
    Can i have some detours and i have this 2 errors:
    Code:
    1>c:\documents and settings\tolis !!!\τα έγγραφά μου\visual studio 2008\projects\_apostolos_ nomenu\_apostolos_ nomenu\direct3d9.cpp(117) : error C3861: 'EngineDetour': identifier not found
    1>c:\documents and settings\tolis !!!\τα έγγραφά μου\visual studio 2008\projects\_apostolos_ nomenu\_apostolos_ nomenu\direct3d9.cpp(118) : error C3861: 'EngineDetour': identifier not found
    and i not understand where i put the #defines address and source for the address
    Last edited by _Apostolos_; 08-21-2011 at 09:45 AM.

Page 1 of 2 12 LastLast

Similar Threads

  1. CS Source Clan/Server
    By Dave84311 in forum General
    Replies: 20
    Last Post: 10-04-2006, 12:21 PM
  2. HALO 2 (XBOX) Source Code
    By mirelesmichael in forum General Game Hacking
    Replies: 12
    Last Post: 09-23-2006, 04:35 AM
  3. Counter Strike: Source
    By Flawless in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 15
    Last Post: 06-03-2006, 08:28 PM