WarRock EU - Code Snippets

05/07/2011 12:17 Angel-Piece#3451
Quote:
Originally Posted by •~•Pr0Sk1ll•~• View Post
jop is net schwer
hier ne kleine OPKstructs fuer BSP
structs OPK
{
char jump[0x1021E4];
float pos1;
float pos2;
float pos3;
};

0x1021E4 = OFS_X richtig?
die structs sind fail xD
05/07/2011 14:06 CyberRazzor#3452
Mir ist in letzter Zeit aufgefallen das selbst NoMenu Hacks Crashen mit Funktionen wie SuperNoSpread.
Ich weiss nicht woran es liegt aber ich würde jede Funktion mit einem Protect schreiben und Patch Funktion, einfach eine Nummer sicher gehen! (Wenn die Crash freiheit wichtig ist...)

Beispiel:



if (CH_Funktion)
{
if (GetAsynKeyState(VK_LBUTTON))
{
//Funktion an
}
else if (!GetAsynKeyState(LBUTTON))
{
//Funktion aus
}
}
else
{
//Funktion aus
}

Das war die Patch Methode, nun kommt die Protect Methode.

void MakeFloat(int Adress , float Value)
{
unsigned long size;
VirtualProtect((void*)Adress, sizeof(Value), PAGE_READWRITE, &size);
memcpy((void*)Adress, &Value , sizeof(Value));
VirtualProtect((void*)Adress, sizeof(Value), size, 0);
}

//Für Long ändere ", float Value)" zu ", long Value) und für int und andere das gleiche.
05/07/2011 14:55 sirosix#3453
"protect methode"

was verstehst du dadrunter?
05/07/2011 15:16 CyberRazzor#3454
Virtual Protect

void MakeFloat(int Adress , float Value)
{
unsigned long size;
VirtualProtect((void*)Adress, sizeof(Value), PAGE_READWRITE, &size);
memcpy((void*)Adress, &Value , sizeof(Value));
VirtualProtect((void*)Adress, sizeof(Value), size, 0);
}
05/07/2011 15:21 sirosix#3455
nein was du wörtlich darunter verstehst -.-^^
05/07/2011 15:42 xxfabbelxx#3456
Quote:
Originally Posted by CyberRazzor View Post
Virtual Protect

void MakeFloat(int Adress , float Value)
{
unsigned long size;
VirtualProtect((void*)Adress, sizeof(Value), PAGE_READWRITE, &size);
memcpy((void*)Adress, &Value , sizeof(Value));
VirtualProtect((void*)Adress, sizeof(Value), size, 0);
}
Wortwörtlich von Anksels Base kopiert Oo
05/07/2011 15:50 Angel-Piece#3457
Quote:
Originally Posted by .Fabbel View Post
Wortwörtlich von Anksels Base kopiert Oo
nein hat hat die x durch value ersetzt^^
05/07/2011 16:02 CyberRazzor#3458
Quote:
void MakeFloat(int Adress , float Value)
{
unsigned long size;
VirtualProtect((void*)Adress, sizeof(Value), PAGE_READWRITE, &size);
memcpy((void*)Adress, &Value , sizeof(Value));
VirtualProtect((void*)Adress, sizeof(Value), size, 0);
}
Anskel-Base?
Nein danke, aus der Base neheme ich nichts.
1. Ich habe es aus der Willi27 v2.0 D3D Base...
2. Kann ich das auch aleine schreiben :rolleyes:
3. Ich Verstehe unter Protect Methode - VirtualProtect


Kleiner Tipp noch:
Hacks erst dann Aktivieren wenn man sie braucht.
Beispiel: NoSpread erst Ingame wenn man Rechte maustaste drückt und eine Waffe bzw Items in der Hand hat.
Oder 5 Slot geht nur an ingame und im shop...
oder supermaster nur ingame und im room somit ist auch der premium umrandungs fehler weg...
Ihr könnt ganz einfach mit Cheat Engine sachen wie ADR_INSHOP oder ADR_INGAME suchen...


PS:

NOT LOGGED IN: Server|Room|Maploading|Game = 0
LOGGED IN: Server = 1 ,Room,MapLoading,Game = 0
ROOM: Server|Room = 1, MapLoading|Game = 0;
MAPLOADING: Server|Maploading = 1, Game|Room = 0;
INGAME: Server|Game = 1,Room|Maploading = 0;



ADR_STATE_SERVER 0x00B02A60
ADR_STATE_ROOM 0x00BB8420
ADR_STATE_MAPLOADING 0x00B088F8
ADR_STATE_GAME 0x00B088F4


by CyberRazzor aka CyberRazzer
05/08/2011 01:30 .Crasy#3459
...

Anksel Base = Willi's Base Moddet..

Und dein "VirtualProtect" Hilft nicht bei allem, und es wird auch Crashen, vllt net gleich aber es wird..

Achja, für die Integer sache da..:

__int32 = 4 Bytes (Max von 2.14)
__int64 = 8 Bytes (Max von 9.99...)

Wobei man auch unsigned x usen kann :)
05/08/2011 08:45 _TradEmArk_˜#3460
fatal error C1014: Zu viele Headerdateien: Tiefe = 1024
Quote:
#include <windows.h>
#include <stdio.h>
#include <malloc.h>
#include "ADE32.h"
#include "cDetours.cpp"
lol weiss einer wiso? oder was dieser fehler überhaupt bedeutet?
05/08/2011 09:17 CyberRazzor#3461
Glaube du hast dann eine Header zu oft benutzt oder sowas...


@.Crasy (..)
Ja Klar kann es noch Crashen!
-Habe ja nicht gesagt das es dann 100% noch crash ist^^
05/08/2011 09:20 •~•Pr0Sk1ll•~•#3462
@Trade man kann keine cpp includen o.0

oder bin ich da falsch?
05/08/2011 09:23 CyberRazzor#3463
Hier ist die Patch Class von system32
Hier ist der Code umgeschrieben für VirtualProtect...
Code:
void cJoPatch<T>::Patch() 
{ 
    if (this->PatchStatus == NORMAL) 
    { 
        if (this->OffValueSaved == false) 
        { 
            if (!this->SaveOffValue()) 
                return; 
        } 
        else     
        { 
            //*(T*)(this->Address) = this->OnValue; old by system32...
	unsigned long size;
	VirtualProtect((void*)this->Address, sizeof(this->OnValue), PAGE_READWRITE, &size);
	memcpy((void*)this->Address, &this->OnValue , sizeof(this->OnValue));
	VirtualProtect((void*)this->Address, sizeof(this->OnValue), size, 0);
    this->PatchStatus = PATCHED; 
        } 
    } 
} 
.
..
....
........
...........................
Eine Frage:
Wenn ich das alles machen, müsste es weniger crashen oder?
-Dll Crypten
-Text Crypten
-Addys Crypten
-Funktionen alle mit VirtualProtect

???
Und ich wollte fragen wie man Addys Cryptet!
05/08/2011 09:26 xxkingskill#3464
@TradEmArk
Quote:
#include <windows.h>
#include <stdio.h>
#include <malloc.h>
#include "ADE32.h"
#include "cDetours.cpp"
Antwort...

Quote:
Originally Posted by •~•Pr0Sk1ll•~• View Post
@Trade man kann keine cpp includen o.0
05/08/2011 09:36 .CyberRazzer™#3465
Denkt daran das ihr in einer bsp: main.cpp keine main2.cpp als bsp includen könnt.