WarRock EU - Code Snippets

12/20/2010 16:25 joki4444#586
Ich habe ein kleines problem :-D9
Ich möchte einen D3D hack coden aber leider fehlt mir
ein wichtiger teil
also hat einer vielleciht eine neuere DrawBox für mich ???
sonst würde der hack funzen :-D
oder könnt ihr ihn überarbeiten

Hier die source von der DrawBox:

Problem ist jetzt nur das cih D3D9 benutze und i wie funzt das da nciht.

void DrawBox(IDirect3DDevice8 *pD3Ddev, int x, int y, int w, int h, D3DCOLOR col)
{
struct QuadVertex {
float x,y,z,rhw;
DWORD dwColor;
};
IDirect3DVertexBuffer8 *pVertexBuffer = NULL;
QuadVertex qV[4];
BYTE *pVertexData = NULL;

if (pD3Ddev->CreateVertexBuffer((4*sizeof(QuadVertex)),(D3DU SA GE_WRITEONLY|D3DUSAGE_DYNAMIC),(D3DFVF_XYZRHW|D3DF VF_DIFFUSE),D3DPOOL_DEFAULT,&pVertexBuffer)<0) return;

pD3Ddev->SetRenderState(D3DRS_ZENABLE , FALSE);
pD3Ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
pD3Ddev->SetRenderState(D3DRS_LIGHTING, FALSE);

pVertexBuffer->Lock(0,0,&pVertexData,D3DLOCK_NOSYSLOCK | D3DLOCK_DISCARD);
if(pVertexData)
{
qV[0].dwColor = qV[1].dwColor = qV[2].dwColor = qV[3].dwColor = col;
qV[0].z = qV[1].z = qV[2].z = qV[3].z = 0.0f;
qV[0].rhw = qV[1].rhw = qV[2].rhw = qV[3].rhw = 0.0f;

qV[0].x = (float)x;
qV[0].y = (float)(y + h);
qV[1].x = (float)x;
qV[1].y = (float)y;
qV[2].x = (float)(x + w);
qV[2].y = (float)(y + h);
qV[3].x = (float)(x + w);
qV[3].y = (float)y;

memcpy(pVertexData,qV,sizeof(QuadVertex)*4);
pVertexBuffer->Unlock();
pVertexData = NULL;

pD3Ddev->SetStreamSource(0,pVertexBuffer, sizeof(QuadVertex));
pD3Ddev->SetVertexShader( D3DFVF_XYZRHW | D3DFVF_DIFFUSE );
pD3Ddev->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );
}
if (pVertexBuffer) {
pVertexBuffer->Release();
pVertexBuffer=NULL;
}
pD3Ddev->SetRenderState(D3DRS_LIGHTING, true);
}
12/20/2010 17:07 Eragon5555#587
meinst du sowas in der Richtung?:

Quote:
void D3D9Menu::DrawTextR(int x,int y,DWORD color,char *text, ID3DXFont* pFont1)
{
RECT rect, rect2;
SetRect( &rect, x, y, x, y );
SetRect( &rect2, x - 0.1, y + 0.2, x - 0.1, y + 0. );
pFont1->DrawTextA(NULL,text,-1,&rect2, DT_RIGHT|DT_NOCLIP, BLACK );
pFont1->DrawTextA(NULL,text,-1,&rect, DT_RIGHT|DT_NOCLIP, color );
}

void D3D9Menu::DrawTextL(int x,int y,DWORD color,char *text, ID3DXFont* pFont1)
{
RECT rect, rect2;
SetRect( &rect, x, y, x, y );
SetRect( &rect2, x - 0.1, y + 0.2, x - 0.1, y + 0. );
pFont1->DrawTextA(NULL,text,-1,&rect2, DT_LEFT|DT_NOCLIP, BLACK );
pFont1->DrawTextA(NULL,text,-1,&rect, DT_LEFT|DT_NOCLIP, color );
}

void D3D9Menu::DrawTextC(int x,int y,DWORD color,char *text, ID3DXFont* pFont1)
{
RECT rect, rect2;
SetRect( &rect, x, y, x, y );
SetRect( &rect2, x - 0.1, y + 0.2, x - 0.1, y + 0. );
pFont1->DrawTextA(NULL,text,-1,&rect2, DT_CENTER|DT_NOCLIP, BLACK );
pFont1->DrawTextA(NULL,text,-1,&rect, DT_CENTER|DT_NOCLIP, color );
}
mhh war einfach zu finden ich hab einfach 10min gegoogelt^^
12/20/2010 17:09 ɣʌȥȥn#588
Quote:
if (EnableRain)
_asm
{
push,ADR_ENABLERAIN
call push
}
Sieht fail aus.
Denk nochmal logisch nach ;)

send mir mal addy per PM (kb auf Kernel Detective Blue Screen fressen.. ) und ich mach dir schnell asm function dafür.


@joki: IDirect3DDevice8 *pD3Ddev .. und du arbeitest in d3d9? ^.^
12/20/2010 17:13 joki4444#589
Ty Ok jetzt noch ein paar sachen ändern und dann mal hofen obs klappt
12/20/2010 18:13 CyberRazzer#590
Quote:
Sieht fail aus.
Denk nochmal logisch nach

send mir mal addy per PM (kb auf Kernel Detective Blue Screen fressen.. ) und ich mach dir schnell asm function dafür.


@joki: IDirect3DDevice8 *pD3Ddev .. und du arbeitest in d3d9? ^.
PUSH 0A58A78 // ASCII "EnableRain"
CALL 0044D2C0 // Unter Enable Rain..
12/20/2010 18:42 Eragon5555#591
ok jetzt hab ich mal ein problem

also ich bin grad an einem d3d menu dran, aber dennoch kommen immer diese zwei fehler(die kommen bei jedem d3dmenu hack den ich erstelle...):

Quote:
1>------ Erstellen gestartet: Projekt: Full VIP Source, Konfiguration: Debug Win32 ------
1>LINK : error LNK2001: Nicht aufgelöstes externes Symbol "__DllMainCRTStartup@12".
1>C:\Users\Andre\documents\visual studio 2010\Projects\Full VIP Source\Debug\Full VIP Source.dll : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
ich weiß echt nicht mehr weiter.
Habe schon sehr lange bei google gesucht aber nix gutes gefunden, so dass die fehler nicht mehr auftreten....
Hoffe es kann mir einer hier helfen...

EDIT:

und irgendwie ist wenn ich auf release gehe, steht da das die dll erstellt wurde, aber wenn ich in den ordner gehe wo es gespeichert sein sollte, dann ist da keine .dll( des release läuft auch bei dem hack so schnell(also es läd keine dateien wie ....cpp oder so.)) (es macht eben gar nix nur steht halt da das es erstellt worden ist aber eigentlich wurde es gar nicht erstellt)^^
Hoffe ich habs nich zu umständlich formuliert xD
12/20/2010 18:58 xxfabbelxx#592
In die Verweis Verzeichnisse das D3D SDK Verzeichnis eingefügt?
12/20/2010 19:03 Eragon5555#593
mhh warte ich schau mal
oder sag mir mal wie das geht damit ich´s gleich machen kann falls nicht eingefügt ist...
sry ich kenn mich mit sowas nicht sooooo gut aus^^

hatte ja auch noch nie solche fehlermeldungen^^
12/20/2010 19:06 xxfabbelxx#594
Quote:
Originally Posted by Eragon5555 View Post
mhh warte ich schau mal
oder sag mir mal wie das geht damit ich´s gleich machen kann falls nicht eingefügt ist...
sry ich kenn mich mit sowas nicht sooooo gut aus^^

hatte ja auch noch nie solche fehlermeldungen^^
Also Extras -> Optionen -> C/C++ Verweise -> Verweisdateien

und da den Pfad für das Direct X SDK Raussuchen...

Fürs 2010er C++ weiß ich grad garnet :D
12/20/2010 19:09 Eragon5555#595
mist ich hab nämlich genau des 2010 naja ich such's später raus ich geh mal offline aber danke dir...
12/20/2010 19:54 joki4444#596
ok doch noch das glecihe problem "-_-
wenn das richtig wär in SDK 2009 wür de mein hack laufen pls help

void DrawBox(IDirect3DDevice8 *pD3Ddev, int x, int y, int w, int h, D3DCOLOR col)
{
struct QuadVertex {
float x,y,z,rhw;
DWORD dwColor;
};
IDirect3DVertexBuffer8 *pVertexBuffer = NULL;
QuadVertex qV[4];
BYTE *pVertexData = NULL;

if (pD3Ddev->CreateVertexBuffer((4*sizeof(QuadVertex)),(D3DUSA GE_WRITEONLY|D3DUSAGE_DYNAMIC),(D3DFVF_XYZRHW|D3DF VF_DIFFUSE),D3DPOOL_DEFAULT,&pVertexBuffer)<0) return;

pD3Ddev->SetRenderState(D3DRS_ZENABLE , FALSE);
pD3Ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
pD3Ddev->SetRenderState(D3DRS_LIGHTING, FALSE);

pVertexBuffer->Lock(0,0,&pVertexData,D3DLOCK_NOSYSLOCK | D3DLOCK_DISCARD);
if(pVertexData)
{
qV[0].dwColor = qV[1].dwColor = qV[2].dwColor = qV[3].dwColor = col;
qV[0].z = qV[1].z = qV[2].z = qV[3].z = 0.0f;
qV[0].rhw = qV[1].rhw = qV[2].rhw = qV[3].rhw = 0.0f;

qV[0].x = (float)x;
qV[0].y = (float)(y + h);
qV[1].x = (float)x;
qV[1].y = (float)y;
qV[2].x = (float)(x + w);
qV[2].y = (float)(y + h);
qV[3].x = (float)(x + w);
qV[3].y = (float)y;

memcpy(pVertexData,qV,sizeof(QuadVertex)*4);
pVertexBuffer->Unlock();
pVertexData = NULL;

pD3Ddev->SetStreamSource(0,pVertexBuffer, sizeof(QuadVertex));
pD3Ddev->SetVertexShader( D3DFVF_XYZRHW | D3DFVF_DIFFUSE );
pD3Ddev->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );
}
if (pVertexBuffer) {
pVertexBuffer->Release();
pVertexBuffer=NULL;
}
pD3Ddev->SetRenderState(D3DRS_LIGHTING, true);
}
12/20/2010 20:01 Eragon5555#597
Quote:
IDirect3DDevice8
wolltest du nicht d3d9 machen?^^
ich schau mal nach bei meinem ganzen source codes ob ich da was für dich hab^^
falls es das ist was ich mein (DrawBox)^^
12/20/2010 20:06 joki4444#598
ok fänd cih wirklich nett von dir :-D
12/20/2010 20:20 Eragon5555#599
joki ich bin noch nicht fertig ich schau gleich mal intensiv nach^^

Aber ich hätte mal eine Frage

Funktioniert Mineview so etwa in der Art?:

Quote:
if (CH_MineV==1){
if (MINEV){
WriteAsm((void *)ADR_MINEVIEW,NOPS,6);
WriteAsm((void *)ADR_MINEVIEW2,NOPS,6);
MINEV=false;
}
}
else {
if (!MINEV){
WriteAsm((void *)ADR_MINEVIEW,MV1OFF,6);
WriteAsm((void *)ADR_MINEVIEW2,MV2OFF,6);
MINEV=true;
}
}
12/20/2010 20:22 joki4444#600
OK fänd cih nett :-D
ka mach das erste mal D3D hack