сделать d3d9 меню в вх часть 1

  • Автор темы Автор темы adspro
  • Дата начала Дата начала
  • Для просмотра чата и остального функционала вам нужно авторизоваться или пройти регистрацию!
Статус
В этой теме нельзя размещать новые ответы.

adspro

Посетитель
Original poster
Дек 19, 2011
22
2
6
Часть 1​
69625341.jpg

12883784.jpg

42549564.jpg

aimg442.imageshack.us_img442_7180_47547396.jpg
aimg687.imageshack.us_img687_661_66235354.jpg
91594551.jpg

aimg252.imageshack.us_img252_5222_84675133.jpg
93441236.jpg

#ADE32.h
Код:
//==================================================================
// This file is part of Qmo Base D3D Class part 2
// (c) copyright Qmo 2011™
// special thanks to : mpgh.net 
//==================================================================



#ifndef __FAKE_H__
#define __FAKE_H__

#define C_ERROR		0xFFFFFFFF
#define C_ADDR1		0x00000001
#define C_ADDR2		0x00000002
#define C_ADDR4		0x00000004
#define C_LOCK		0x00000008
#define C_67		0x00000010
#define C_66		0x00000020
#define C_REP		0x00000040
#define C_SEG		0x00000080
#define C_ANYPREFIX	(C_66+C_67+C_LOCK+C_REP+C_SEG)
#define C_DATA1		0x00000100
#define C_DATA2		0x00000200
#define C_DATA4		0x00000400
#define C_SIB		0x00000800
#define C_ADDR67	0x00001000
#define C_DATA66	0x00002000
#define C_MODRM		0x00004000
#define C_BAD		0x00008000
#define C_OPCODE2	0x00010000
#define C_REL		0x00020000
#define C_STOP		0x00040000

#pragma pack(push)
#pragma pack(1)

struct disasm_struct {
BYTE disasm_defaddr;	// 00
BYTE disasm_defdata;	// 01
DWORD disasm_len;		// 02 03 04 05
DWORD disasm_flag;		// 06 07 08 09
DWORD disasm_addrsize;	// 0A 0B 0C 0D
DWORD disasm_datasize;	// 0E 0F 10 11
BYTE disasm_rep;		// 12
BYTE disasm_seg;		// 13
BYTE disasm_opcode;		// 14
BYTE disasm_opcode2;	// 15
BYTE disasm_modrm;		// 16
BYTE disasm_sib;		// 17

union {
BYTE disasm_addr_b[8];	// 18 19 1A 1B  1C 1D 1E 1F
WORD disasm_addr_w[4];
DWORD disasm_addr_d[2];
char disasm_addr_c[8];
short disasm_addr_s[4];
long disasm_addr_l[2];
};

union {
BYTE disasm_data_b[8];	// 20 21 22 23  24 25 26 27
WORD disasm_data_w[4];
DWORD disasm_data_d[2];
char disasm_data_c[8];
short disasm_data_s[4];
long disasm_data_l[2];
};
}; 

#pragma pack(pop)

int disasm(BYTE* opcode0, disasm_struct* diza);
int oplen(BYTE* opcode);

#endif 
/**************************************************************************************************************************************************************************************************************/
#QmoBase.h
Код:
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||
//-----------------------------------------------------------------------------
// flavor from the Base cheat ... need to Edit ok, and the creation of your abilities
//( Clue : discard the unnecessary )
//-----------------------------------------------------------------------------
// To Be only Included in cBase.cpp Otherwise needs Modification to Provide Cross object linking

#include "stdafx.h"

#pragma once

class cBase
{

public:

FILE *LOG;
char dllpath[255];
char logfile[255];


struct sscreen
{
int height;
int width;
}screen;

char* GetFile(char *file);
void  WriteFile(FILE *file,const char *fmt, ...);

};
extern cBase Base;
#QmoDetour.h
Код:
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||
//-----------------------------------------------------------------------------
// flavor from the Base cheat ... need to Edit ok, and the creation of your abilities
//( Clue : discard the unnecessary )
//-----------------------------------------------------------------------------

#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN

#include 

#include "ADE32.h"

#define DETOUR_LEN_AUTO 0      // Finds the detour length automatically

enum
{
DETOUR_TYPE_JMP,          // min detour len: 5
DETOUR_TYPE_PUSH_RET,     // min detour len: 6
DETOUR_TYPE_NOP_JMP,      // min detour len: 6
DETOUR_TYPE_NOP_NOP_JMP,  // min detour len: 7
DETOUR_TYPE_STC_JC,       // min detour len: 7
DETOUR_TYPE_CLC_JNC,      // min detour len: 7
};

LPVOID DetourCreate(LPVOID lpFuncOrig, LPVOID lpFuncDetour, int patchType, int detourLen=DETOUR_LEN_AUTO);
LPVOID DetourCreate(LPCSTR lpModuleName, LPCSTR lpProcName, LPVOID lpFuncDetour, int patchType, int detourLen=DETOUR_LEN_AUTO);
BOOL DetourRemove(LPVOID lpDetourCreatePtr);

#pragma warning(disable: 4311)
#pragma warning(disable: 4312)
#pragma warning(disable: 4244)

#define DETOUR_MAX_SRCH_OPLEN 64

#define JMP32_SZ 5
#define BIT32_SZ 4

// jmp32 sig
#define SIG_SZ 3
#define SIG_OP_0 0xCC
#define SIG_OP_1 0x90
#define SIG_OP_2 0xC3

static DWORD Silamguard;

int GetDetourLen(int patchType);
int GetDetourLenAuto(PBYTE &pbFuncOrig, int minDetLen);

// Thin wrapper for APIs
LPVOID DetourCreate(LPCSTR lpModuleName, LPCSTR lpProcName, LPVOID lpFuncDetour, int patchType, int detourLen)
{
LPVOID lpFuncOrig = NULL;

if((lpFuncOrig = GetProcAddress(GetModuleHandle(lpModuleName), lpProcName)) == NULL)
return NULL;

return DetourCreate(lpFuncOrig, lpFuncDetour, patchType, detourLen);
}

LPVOID DetourCreate(LPVOID lpFuncOrig, LPVOID lpFuncDetour, int patchType, int detourLen)
{
LPVOID lpMallocPtr = NULL;
DWORD dwProt = NULL;
PBYTE NewocPBrs = NULL;
PBYTE pbFuncOrig = (PBYTE)lpFuncOrig;
PBYTE pbFuncDetour = (PBYTE)lpFuncDetour;
PBYTE pbPatchBuf = NULL;
int minDetLen = 0;
int detLen = 0;

// Get detour length
if((minDetLen = GetDetourLen(patchType)) == 0)
return NULL;

if(detourLen != DETOUR_LEN_AUTO)
detLen = detourLen;

else if((detLen = GetDetourLenAuto(pbFuncOrig, minDetLen)) < minDetLen)
return NULL;

// Alloc mem for the overwritten bytes
if((lpMallocPtr = (LPVOID)malloc(detLen+JMP32_SZ+SIG_SZ)) == NULL)
return NULL;

NewocPBrs = (PBYTE)lpMallocPtr;

// Enable writing to original
VirtualProtect(lpFuncOrig, detLen, PAGE_READWRITE, &dwProt);

// Write overwritten bytes to the malloc
memcpy(lpMallocPtr, lpFuncOrig, detLen);
NewocPBrs += detLen;
NewocPBrs[0] = 0xE9;
*(DWORD*)(NewocPBrs+1) = (DWORD)((pbFuncOrig+detLen)-NewocPBrs)-JMP32_SZ;
NewocPBrs += JMP32_SZ;
NewocPBrs[0] = SIG_OP_0;
NewocPBrs[1] = SIG_OP_1;
NewocPBrs[2] = SIG_OP_2;

// Create a buffer to prepare the detour bytes
pbPatchBuf = new BYTE[detLen];
memset(pbPatchBuf, 0x90, detLen);

switch(patchType)
{
case DETOUR_TYPE_JMP:
pbPatchBuf[0] = 0xE9;
*(DWORD*)&pbPatchBuf[1] = (DWORD)(pbFuncDetour - pbFuncOrig) - 5;
break;

case DETOUR_TYPE_PUSH_RET:
pbPatchBuf[0] = 0x68;
*(DWORD*)&pbPatchBuf[1] = (DWORD)pbFuncDetour;
pbPatchBuf[5] = 0xC3;
break;

case DETOUR_TYPE_NOP_JMP:
pbPatchBuf[0] = 0x90;
pbPatchBuf[1] = 0xE9;
*(DWORD*)&pbPatchBuf[2] = (DWORD)(pbFuncDetour - pbFuncOrig) - 6;
break;

case DETOUR_TYPE_NOP_NOP_JMP:
pbPatchBuf[0] = 0x90;
pbPatchBuf[1] = 0x90;
pbPatchBuf[2] = 0xE9;
*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
break;

case DETOUR_TYPE_STC_JC:
pbPatchBuf[0] = 0xF9;
pbPatchBuf[1] = 0x0F;
pbPatchBuf[2] = 0x82;
*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
break;

case DETOUR_TYPE_CLC_JNC:
pbPatchBuf[0] = 0xF8;
pbPatchBuf[1] = 0x0F;
pbPatchBuf[2] = 0x83;
*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
break;

default:
return NULL;
}

// Write the detour
for(int i=0; i
 
#QmoFont.h
Код:
//-----------------------------------------------------------------------------
// File: D3DFont.h
// Desc: Texture-based font class
// Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.

/*------------------ Editt by ------------------------------------------------*/
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||qq
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
#ifndef D3DFONT_H
#define D3DFONT_H
#include 
#include 

// Font creation flags
#define D3DFONT_BOLD        0x0001
#define D3DFONT_ITALIC      0x0002
#define D3DFONT_ZENABLE     0x0004

// Font rendering flags
#define D3DFONT_CENTERED    0x0001
#define D3DFONT_TWOSIDED    0x0002
#define D3DFONT_FILTERED    0x0004
#define D3DFONT_RIGHT       0x0008		// non standard
#define DT_SHADOW      0x0010		// non standard



//-----------------------------------------------------------------------------
// Name: class CD3DFont
// Desc: Texture-based font class for doing text in a 3D scene.
//-----------------------------------------------------------------------------
class CD3DFont
{
TCHAR   m_strFontName[80];            // Font properties
DWORD   m_dwFontHeight;
DWORD   m_dwFontFlags;

LPDIRECT3DDEVICE9      m_pd3dDevice;  // A D3DDevice used for rendering
LPDIRECT3DTEXTURE9     m_pTexture;    // The d3d texture for this font
LPDIRECT3DVERTEXBUFFER9 m_pVB;        // VertexBuffer for rendering text
DWORD   m_dwTexWidth;                 // Texture dimensions
DWORD   m_dwTexHeight;
FLOAT   m_fTextScale;
FLOAT   m_fTexCoords[128-32][4];
DWORD   m_dwSpacing;                  // Character pixel spacing per side

/**********Stateblocks for setting and restoring render states *****/
LPDIRECT3DSTATEBLOCK9   m_dwSavedStateBlock;
LPDIRECT3DSTATEBLOCK9   m_dwDrawTextStateBlock;

public:
// 2D and 3D text drawing functions
HRESULT DrawText( FLOAT x, FLOAT y, DWORD dwColor, 
TCHAR* strText, DWORD dwFlags=0L );

// Function to get extent of text
HRESULT GetTextExtent( TCHAR* strText, SIZE* pSize );

// Initializing and destroying device-dependent objects
HRESULT InitDeviceObjects( LPDIRECT3DDEVICE9 pd3dDevice );
HRESULT RestoreDeviceObjects();
HRESULT InvalidateDeviceObjects();
HRESULT DeleteDeviceObjects();

// Constructor / destructor
CD3DFont( TCHAR* strFontName, DWORD dwHeight, DWORD dwFlags=0L );
~CD3DFont();
};




#endif
#QmoMenu.h
Код:
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||
//-----------------------------------------------------------------------------
// flavor from the Base cheat ... need to Edit ok, and the creation of your abilities
//( Clue : discard the unnecessary )
//-----------------------------------------------------------------------------

#include "stdafx.h"
#include "Qmofont.h"



#pragma once

#define ITEM_ARRAY 64 // Maximum of 64 Items change to reduce Static address size

// ============ SOME CALCULATION MACROS FOR LONG CALCULATIONS ================
// ============                THE PREFIX IS MC				  ================
#define MC_MAXX					(X+WIDTH)												// X of Menu + Width
#define MC_FCTR(x,y)			((x+y)/2)												// Calculate Center Point Between two items
#define MC_ITEMY(index)			(Y+(index*I_SPC)+T_SPC+(T_SPC/2))						// Calculate Y of Item using Index or calculate Menu Maximum Y
#define MC_MSY					(Y+T_SPC+(T_SPC/2))										// Y Start For Menu Items


/*=================================== Menu Class ============================*/
class cMenu{

public:

//-----------------------------------------------------------------------------
// Desc: Item Index Structure
//-----------------------------------------------------------------------------
struct sitem{
char title[50];		// Name Of Item to Display
char state[50];	    // States of Item
int	 type;			// Type of Item ie. Cat , Items
int  max;			// Number of States
int  no;			// number inside the Array
int	 *val;			// Variable Being Controlled
} items[ITEM_ARRAY];
//-----------------------------------------------------------------------------
// Desc: Item Color Enumeration
//-----------------------------------------------------------------------------
enum COLORS{  // Normal Colors
WHITE	=	D3DCOLOR_ARGB(255,255,255,255),
RED		=	D3DCOLOR_ARGB(255,220,20,60),
GREEN	=	D3DCOLOR_ARGB(255,0,255,0),
BLUE	=	D3DCOLOR_ARGB(255,0,0,255),
BLACK	=	D3DCOLOR_ARGB(255,0,0,0),
PURPLE	=	D3DCOLOR_ARGB(255,125,0,255),
GREY	=	D3DCOLOR_ARGB(255,128,128,128),
YELLOW  =	D3DCOLOR_ARGB(255,255,255,0),
ORANGE	=	D3DCOLOR_ARGB(255,255,125,0)
};
//-----------------------------------------------------------------------------
// Desc: Item Color Enumeration
//-----------------------------------------------------------------------------
enum I_COLORS{  // Item Colors
C_OFF	 =	D3DCOLOR_ARGB(255,255,255,255),
C_ON	 =  D3DCOLOR_ARGB(255,220,20,60),
C_CAT	 =	D3DCOLOR_ARGB(255,220,20,60),
C_CUR	 =	D3DCOLOR_ARGB(255,220,20,60),
C_TITLE	 =	D3DCOLOR_ARGB(255,255,255,255),
C_STRING =	D3DCOLOR_ARGB(255,220,20,60),
};
//-----------------------------------------------------------------------------
// Desc: BackGround Color Enumeration
//-----------------------------------------------------------------------------
enum BK_COLORS{ // BackGround Colors
C_BOX    = D3DCOLOR_ARGB(255,0,0,0),
C_BORDER = D3DCOLOR_ARGB(255,220,20,60)
};

//-----------------------------------------------------------------------------
// Desc: Menu Types Enumeration
//-----------------------------------------------------------------------------

enum I_TYPES{
T_TEXT = 0,
T_ITEM = 1,
T_CAT  = 2
};

//-----------------------------------------------------------------------------
// Desc: Class Global Variables
//-----------------------------------------------------------------------------

CD3DFont *font;
int  X,Y;			// TOP LEFT OF MENU
POINT mofs;			// Offset From Mouse Last Point
POINT mpos;			// Mouse Coordinates
int  M_DRAG;		// is Menu Being Dragged
int  WIDTH;			// Width of Menu
int  I_OFS,S_OFS;	// Item Title Column Start
int  I_SPC,I_TSPC;  // Title Spacing and Item Spacing
int  T_SPC,F_SPC;	// Title Spacing from Menu Items and Footer Spacing
int  NO;			// Number of Menu Items
int  I_CUR;			// Current Menu Item
bool SHOW;			// Is menu shown
bool INIT;			// Has Menu Been Setup
// ANIMATION GLOBALS 
int  ABOR;			// Board Animation Offset
int  BTEX,BDIR;		// Blinking Text Highlight

//-----------------------------------------------------------------------------
// Desc: Class Global Functions
//-----------------------------------------------------------------------------

void	DrawBox( int x, int y, int w, int h, D3DCOLOR Color,LPDIRECT3DDEVICE9 pDevice);
void	DrawBorder( int x, int y, int w, int h, D3DCOLOR Color,LPDIRECT3DDEVICE9 pDevice);
void	DrawMouse(int x, int y,LPDIRECT3DDEVICE9 pDevice);
char*	oprintf (const char *fmt, ...);
void	PostReset(LPDIRECT3DDEVICE9 pDevice);
void	PreReset(void);
char*	FPS(int en = 1);
char*	TIME(void);
char*	DATE(void);
void	ShowMenu(LPDIRECT3DDEVICE9 pDevice);
void	ShowBox(LPDIRECT3DDEVICE9 pDevice);

//-----------------------------------------------------------------------------
private:

//-----------------------------------------------------------------------------
// Desc: Class Private Functions
//-----------------------------------------------------------------------------
void	acat(char *title, char *states, int *var);
void	aitem(char *title, char *states,int *var, int show, int when);
void	atext(char *title, char *states,int show, int when);
void	atext(char *title, char *states);
void	additem(char *title, char *states,int type, int *var, int show, int when);
void	getfield(char *str,char *dst,int no);
int		nofields(char *str);
void	Init(void);
int		Load(char* szSection, char* szKey, int iDefaultValue,LPCSTR file);
void	Save(char* szSection, char* szKey, int iValue,LPCSTR file);

//-----------------------------------------------------------------------------


};
extern cMenu Menu;

// Item Manager Struct
struct copt{
//Global Variables
int text; // Text Items
struct sinfo{
int main;
}info;
struct splayer{
int main;
int superj;
int speed;
int stamina;
int recoil;
int spread;
int trigger;
int	nfd;
}player;
struct sserver{
int main;
int spawn;
int prem;
int slots;
}server;
struct susercp{
int main;
int pfind;
int pinfo;
int pkey;
}usercp;

struct sasm{
int main;
int antik;
int invis;
int restrict;
int mview;
int nodelay;
int prone;
int uoxy;
int bone;
int shotty;
int opk;
int svp;
int	uammo;
int stw;
int wtw;
}asmm;
struct sd3d{
int main;
int ChamsCT;
int ChamsTERO;
int WHGlass;
}d3d;
struct schams{
int main;
int chams;
int	chamsf;
int	chamsb;
int type;
}chams;
struct sesp{
int main;
int oespn;
int oesph;
int espn;
int esph;
int espi;
int eonly;
int espd;

}esp;
struct soptions{
int main;
int move;
int reset;
int save;
int load;
}options;
};
extern copt opt;
 
#QmoSound.h
Код:
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||
//-----------------------------------------------------------------------------

#include "stdafx.h"
#include 

#pragma once

// Stripped Sound Class kinda pointless for public release since i stripped all the cool functions but more pain to remove lol

class cSound
{

public:

struct smp3
{

}mp3;

struct swav
{
void playsound(LPCSTR sound);
void playsoundmem(LPCSTR sound);
}wav;

};
extern cSound Sound;
#pragma.h
Код:
//-----------------------------------------------------------------------------
//     Copyright © November/2011. MPGH/Qmoa. All rights reserved.
//                  ||  Do not forget to credits ||
//-----------------------------------------------------------------------------

#pragma warning(disable: 4018)
#pragma warning(disable: 4996)
#pragma warning(disable: 4102)
#pragma warning(disable: 4244)
#Sounds.h залью на залил
 
А не легче было ссылку и скриншот исходника оставить?
 
Закинь исход в рар архив плз.заранее спасибо
 
Ачто так трудно ???
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу