EMO Style ForumPro - Hos Geldiniz
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 202 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: AnthonyFurey3

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Kimler hatta?
Toplam 11 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 11 Misafir :: 1 Arama motorları

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 92 kişi Paz Ağus. 28, 2016 6:58 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

Useful D3D9/C++ Info,Functions, Cham Alternations, and more!

Önceki başlık Sonraki başlık Aşağa gitmek

Useful D3D9/C++ Info,Functions, Cham Alternations, and more!

Mesaj tarafından EMO Bir Çarş. Ağus. 10, 2011 12:11 pm

[QUOTE=CodeDemon;2580298]

Here is a list of useful D3D9 Functions, info, and other misc items.

If you would like to add a function, post it below(with credits) and I will add it in here! Also, if I missed any credits, please say so, so that I can add them!

This post actually has enough info for you to make your own D3D9 Base.

Enjoy!

[SIZE="4"]D3D9 vTable Values(Credits to Str1k3r21):[/SIZE]

Kod:

QueryInterface // 0
AddRef // 1
Release // 2
TestCooperativeLevel // 3
GetAvailableTextureMem // 4
EvictManagedResources // 5
GetDirect3D // 6
GetDeviceCaps // 7
GetDisplayMode // 8
GetCreationParameters // 9
SetCursorProperties // 10
SetCursorPosition // 11
ShowCursor // 12
CreateAdditionalSwapChain // 13
GetSwapChain // 14
GetNumberOfSwapChains // 15
Reset // 16
Present // 17
GetBackBuffer // 18
GetRasterStatus // 19
SetDialogBoxMode // 20
SetGammaRamp // 21
GetGammaRamp // 22
CreateTexture // 23
CreateVolumeTexture // 24
CreateCubeTexture // 25
CreateVertexBuffer // 26
CreateIndexBuffer // 27
CreateRenderTarget // 28
CreateDepthStencilSurface // 29
UpdateSurface // 30
UpdateTexture // 31
GetRenderTargetData // 32
GetFrontBufferData // 33
StretchRect // 34
ColorFill // 35
CreateOffscreenPlainSurface // 36
SetRenderTarget // 37
GetRenderTarget // 38
SetDepthStencilSurface // 39
GetDepthStencilSurface // 40
BeginScene // 41
EndScene // 42
Clear // 43
SetTransform // 44
GetTransform // 45
MultiplyTransform // 46
SetViewport // 47
GetViewport // 48
SetMaterial // 49
GetMaterial // 50
SetLight // 51
GetLight // 52
LightEnable // 53
GetLightEnable // 54
SetClipPlane // 55
GetClipPlane // 56
SetRenderState // 57
GetRenderState // 58
CreateStateBlock // 59
BeginStateBlock // 60
EndStateBlock // 61
SetClipStatus // 62
GetClipStatus // 63
GetTexture // 64
SetTexture // 65
GetTextureStageState // 66
SetTextureStageState // 67
GetSamplerState // 68
SetSamplerState // 69
ValidateDevice // 70
SetPaletteEntries // 71
GetPaletteEntries // 72
SetCurrentTexturePalette // 73
GetCurrentTexturePalette // 74
SetScissorRect // 75
GetScissorRect // 76
SetSoftwareVertexProcessing // 77
GetSoftwareVertexProcessing // 78
SetNPatchMode // 79
GetNPatchMode // 80
DrawPrimitive // 81
DrawIndexedPrimitive // 82
DrawPrimitiveUP // 83
DrawIndexedPrimitiveUP // 84
ProcessVertices // 85
CreateVertexDeclaration // 86
SetVertexDeclaration // 87
GetVertexDeclaration // 88
SetFVF // 89
GetFVF // 90
CreateVertexShader // 91
SetVertexShader // 92
GetVertexShader // 93
SetVertexShaderConstantF // 94
GetVertexShaderConstantF // 95
SetVertexShaderConstantI // 96
GetVertexShaderConstantI // 97
SetVertexShaderConstantB // 98
GetVertexShaderConstantB // 99
SetStreamSource // 100
GetStreamSource // 101
SetStreamSourceFreq // 102
GetStreamSourceFreq // 103
SetIndices // 104
GetIndices // 105
CreatePixelShader // 106
SetPixelShader // 107
GetPixelShader // 108
SetPixelShaderConstantF // 109
GetPixelShaderConstantF // 110
SetPixelShaderConstantI // 111
GetPixelShaderConstantI // 112
SetPixelShaderConstantB // 113
GetPixelShaderConstantB // 114
DrawRectPatch // 115
DrawTriPatch // 116
DeletePatch // 117
CreateQuery // 118

[SIZE="4"]D3D ARGB Colors:[/SIZE]

Kod:

//Colors are A,R,G,B meaning alpha(opacity), red, green, blue
D3DCOLOR RED = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR GREEN = D3DCOLOR_ARGB(255, 0, 255, 0);
D3DCOLOR BLUE = D3DCOLOR_ARGB(255, 0, 0, 255);
D3DCOLOR WHITE = D3DCOLOR_ARGB(255, 255, 255, 255);
D3DCOLOR BLACK = D3DCOLOR_ARGB(255, 0, 0, 0);
D3DCOLOR YELLOW = D3DCOLOR_ARGB(255, 255, 255, 0);
D3DCOLOR TEAL = D3DCOLOR_ARGB(255, 0, 255, 255);
D3DCOLOR PINK = D3DCOLOR_ARGB(255, 255, 240, 0);
D3DCOLOR ORANGE = D3DCOLOR_ARGB(255, 255, 132, 0);
D3DCOLOR LIME = D3DCOLOR_ARGB(255, 198, 255, 0);
D3DCOLOR SKY BLUE = D3DCOLOR_ARGB(255, 0, 180, 255);
D3DCOLOR MAROON = D3DCOLOR_ARGB(255, 142, 30, 0);
D3DCOLOR LGRAY = D3DCOLOR_ARGB(255, 174, 174, 174); //Light Gray
D3DCOLOR DGRAY = D3DCOLOR_ARGB(255, 71, 65, 64); //Dark Gray
D3DCOLOR BROWN = D3DCOLOR_ARGB(255, 77, 46, 38);
D3DCOLOR SHIT = D3DCOLOR_ARGB(255, 74, 38, 38); //Shit and brown aint much different
[SIZE="4"]
Generate Texture Function(Credits to Azorbix):
[/SIZE]
Kod:

HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
   if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex,NULL)) )
      return E_FAIL;
   
   WORD colour16 =   ((WORD)((colour32>>28)&0xF)<<12)
         |(WORD)(((colour32>>20)&0xF)<<8)
         |(WORD)(((colour32>>12)&0xF)<<4)
         |(WORD)(((colour32>>4)&0xF)<<0);

   D3DLOCKED_RECT d3dlr;   
   (*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
   WORD *pDst16 = (WORD*)d3dlr.pBits;

   for(int xy=0; xy < 8*8; xy++)
      *pDst16++ = colour16;

   (*ppD3Dtex)->UnlockRect(0);

   return S_OK;
}

[SIZE="4"]EndScene(vTable 42):[/SIZE]
Kod:

typedef HRESULT (WINAPI* oEndScene)(LPDIRECT3DDEVICE9 pDevice);
oEndScene pEndScene;
Kod:

HRESULT WINAPI EndScene(LPDIRECT3DDEVICE9 pDevice)
{
   return pEndScene(pDevice);
}
[SIZE="4"]
Reset(vTable 16):
[/SIZE]
Kod:

typedef HRESULT ( WINAPI* oReset )( LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters );
oReset pReset;
Kod:

HRESULT WINAPI Reset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
{

   return pReset(pDevice, pPresentationParameters);
}

[SIZE="4"]Draw Indexed Primitive[DIP (vTable 82)]:[/SIZE]
Kod:

typedef HRESULT (WINAPI* oDIP)(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE,int,UINT,UINT,UINT,UINT);
oDIP pDIP;
Kod:

HRESULT WINAPI DIP(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,int BaseVertexIndex,UINT MinIndex,UINT NumVertices,UINT StartIndex,UINT PrimCount)
{
   return pDIP(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimCount);
}
[SIZE="4"]
Find Pattern Function(Credits to d0m1n1c):
[/SIZE]
Kod:

bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
   for(;*szMask;++szMask,++pData,++bMask)
      if(*szMask=='x' && *pData!=*bMask) 
         return 0;
   return (*szMask) == NULL;
}

DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask)
{
   for(DWORD i=0; i<dwLen; i++)
      if (bCompare((BYTE*)(dwAddress+i),bMask,szMask)) 
         return (DWORD)(dwAddress+i);
   return 0;
}
[SIZE="4"]
Detour Create Function(Credits to Azorbix):
[/SIZE]
Kod:

void *DetourCreate(BYTE *src, const BYTE *dst, const int len)
{
   BYTE *jmp = (BYTE*)malloc(len+5);
   DWORD dwBack;

   VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
   memcpy(jmp, src, len);   
   jmp += len;
   jmp[0] = 0xE9;
   *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
   src[0] = 0xE9;
   *(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
   for (int i=5; i<len; i++)  src[i]=0x90;
   VirtualProtect(src, len, dwBack, &dwBack);
   return (jmp-len);
}

[SIZE="4"]Picture Background(Create Texture from File in Memory):[/SIZE]
Kod:

D3DXCreateTextureFromFileInMemory(pDevice,imagebytes,size,LPDIRECT3DTEXTURE9);

[SIZE="4"]PrintText Function(Credits To ac1d_bUrn, he gave it to me to add to the list):[/SIZE]
Kod:

void PrintText(LPD3DXFONT Font, long x, long y, D3DCOLOR fontColor, char *text, ...)

    RECT rct;   
    rct.left    = x - 1;   
    rct.right    = x + 1;   
    rct.top      = y - 1 ;   
    rct.bottom  = y + 1; 

    if(!text) { return; }
    va_list va_alist;
    char logbuf[256] = {0};
    va_start (va_alist, text);
    _vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
    va_end (va_alist);
    RECT FontRect = { x, y, x, y };
    pFont->DrawText(NULL, logbuf, -1, &rct, DT_NOCLIP, fontColor); 
}

[SIZE="4"]Draw Box Function(Credits To ac1d_bUrn, he gave it to me to add to the list):[/SIZE]
Kod:

void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
   D3DRECT rec = { x, y, x + w, y + h };
   pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}

[SIZE="4"]Draw Border Function(Credits To ac1d_bUrn, he gave it to me to add to the list):[/SIZE]
Kod:

void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
   FillRGB( x, (y + h - px), w, px,   BorderColor, pDevice );
   FillRGB( x, y, px, h,            BorderColor, pDevice );
   FillRGB( x, y, w, px,            BorderColor, pDevice );
   FillRGB( (x + w - px), y, px, h,   BorderColor, pDevice );
}

[SIZE="4"]Draw Box with Border Function(Credits To ac1d_bUrn, he gave it to me to add to the list)(You will need above 2 functions to use it)[/SIZE]
Kod:

void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
   FillRGB( x, y, w, h,      BoxColor, pDevice );
   DrawBorder( x, y, w, h, 1,   BorderColor, pDevice );
}

[SIZE="4"]Draw CrossHair Function(Credits To ac1d_bUrn(giving it to me)):[/SIZE]

Kod:

void DrawCrosshair(LPDIRECT3DDEVICE9 pDevice, int size, int strong,  D3DCOLOR xcolor)
{
   int iCenterX = GetSystemMetrics( 0 ) / 2;
   int iCenterY = GetSystemMetrics( 1 ) / 2;
   if( iCenterX < 20 && iCenterY < 20 )
   {
      iCenterX = ( GetSystemMetrics( 0 ) / 2 );
      iCenterY = ( GetSystemMetrics( 1 ) / 2 );
   }
   D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
   D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
   pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 1000,  0);
   pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 100,  0);
}
[SIZE="4"]
Draw Healthbar Function(Credits To Crash for Coding it, ac1d_bUrn, he gave it to me to add to the list)
[/SIZE]
Kod:

void DrawHealthBar(int x, int y, int w, int h, D3DCOLOR color, D3DCOLOR BorderColor, int hp, int maxhp)
{
   FillRGB(x, y, ( hp / (double)maxhp ) * w, h, color, g_pDevice);
   DrawBorder(x, y, w, h, 1, BorderColor, g_pDevice);
}
[SIZE="4"]
Moving Your Menu to Mouse Coordinates On Button(Credits to Zanza):
[/SIZE]
Kod:

int MoveMenu;

if(GetAsyncKeyState(VK_DELETE)) MoveMenu = (!MoveMenu);

if( MoveMenu ) {
  POINT myCursor;
  GetCursorPos(&myCursor); // get the cursor position.
  if(GetAsyncKeyState(VK_LBUTTON)) {
      menu.x = myCursor.x; // set the x of your menu to the cursor x position.
      menu.y = myCursor.y; // set the y of your menu to the cursor y position.
  }
}

[SIZE="4"]Generate Material(Credits to Crash):[/SIZE]
Kod:

D3DMATERIAL9 GenerateMaterial(int r, int g, int b){

   D3DMATERIAL9 myMaterial;
   D3DCOLORVALUE myColor;

   myColor.a = 255;
   myColor.r = (float)r / 255;
   myColor.g = (float)g / 255;
   myColor.b = (float)b / 255;

   myMaterial.Ambient = myColor;
   myMaterial.Diffuse = myColor;
   myMaterial.Emissive = myColor;
   myMaterial.Specular = myColor;

   return myMaterial;

}

[SIZE="5"]Cham Alterations(NOOB PROOF):[/SIZE]

[SIZE="4"]Light Chams(Credits to Kernel, modified for D3D9 by CodeDemon):[/SIZE]
Kod:

void SetLightChams(float A, float R, float G, float B, IDirect3DDevice9 *pDevice)
{
    D3DMATERIAL9 pMaterial;
    ZeroMemory(&pMaterial, sizeof(D3DMATERIAL9));
   pDevice->SetRenderState(D3DRS_LIGHTING, TRUE); //Enable Lighting
   //Ambient
   pMaterial.Ambient.a    =  (A/255);
    pMaterial.Ambient.r    =  (R/255);
    pMaterial.Ambient.g    =  (G/255);
    pMaterial.Ambient.b    =  (B/255);
   //Diffuse
   pMaterial.Diffuse.a    = (A/255);
    pMaterial.Diffuse.r    = (R/255);
    pMaterial.Diffuse.g    = (G/255);
    pMaterial.Diffuse.b    = (B/255);
   //Specular
   pMaterial.Specular.a = (A/255);
   pMaterial.Specular.r = (R/255);
    pMaterial.Specular.g = (G/255);
    pMaterial.Specular.b = (B/255);
    pDevice->SetMaterial(&pMaterial);
}

How To Use(In DIP):
Kod:

//ZBUFFER OFF(Any Real Coder would know what this is! )
SetLightChams(255,255,0,0, pDevice);

pDIP;
//ZBUFFER ON
SetLightChams(255,0,0,255, pDevice);

Result:



[SIZE="4"]Overlay Chams/No Texture Chams(Credits to Pheron):[/SIZE]

Kod:

//ZBUFFER OFF
pDevice->SetRenderState(D3DRS_LIGHTING, true);
pDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT);
pDevice->SetRenderState(D3DRS_FOGENABLE, false);
pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,255,0,0));

pDIP;
//ZBUFFER ON
pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_ARGB(255,0,255,0));

Result:


[SIZE="4"]Ghost Chams(Credits to Blood):[/SIZE]
Kod:

pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTCOLOR);
pDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCCOLOR);
//ZBUFFER OFF
      
pDIP;

pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTCOLOR);
pDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCCOLOR);
//ZBUFFER ON

Result:


[SIZE="4"]Phantom Chams(Credits to Blood):[/SIZE]
Kod:

pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTCOLOR);
pDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCALPHA);
//ZBUFFER OFF

pDIP;

pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTCOLOR);
pDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_INVSRCALPHA);
//ZBUFFER ON
Result:


[/QUOTE]
avatar
EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 184
Puan : 107393
Rep Puanı : 5
Doğum tarihi : 28/11/89
Kayıt tarihi : 18/05/11
Yaş : 27
Nerden : EMO world
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Kullanıcı profilini gör

Sayfa başına dön Aşağa gitmek

Önceki başlık Sonraki başlık Sayfa başına dön


 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz