C, C++ and VC++ Snippets
Even better, use a using declaration instead of a using directive (at function scope). get/set methods are pointless if they are literally just assignments (might as well make the class member public because it is public in all but name).
Tell my idiotic university professors that :3. Spent first year of Uni having to comply with their bollocks checkstyle which basically said NO PUBLIC VARIABLES and also that EVERY METHOD must be javadoc'd. So you'd end up with ridiculous classes like (note: Java):
It's enough to make you want to slit your wrists.
Code:
class Foo
{
private string Name;
private int Id;
private double Bar;
....
/**
* Get the name of this class instance
* @ return string the name of this class
**/
public string GetName()
{
return this.Name;
}
/**
* Get the identifying number of this class instance
* @ return int id of this class instance
**/
public int GetId()
{
return this.Id;
}
/**
* Get the value of Bar for this class instance
* @ return double value of Bar
**/
public double GetBar()
{
return this.Bar;
}
/**
* Set the name of this class instance
* @ param newName the new name for this class instance
**/
public void SetName(string newName)
{
this.Name = newName;
}
/**
* Set the id of this class instance
* @ param newId the new Idfor this class instance
**/
public void SetId(int newId)
{
this.Id = newId;
}
/**
* Set the bar value of this class instance
* @ param newBar the new Bar for this class instance
**/
public void SetBar(double newBar)
{
this.Bar = newBar
}
}
DLL in open Form Application => Borland C++
Tüm herkese selamlar 
Embarcadero C++ => Form Applicaton in DLL OPEN bla bla bla/little speak english...

Code:
#include "Unit1.h"
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
void FormApp()
{
Application->Initialize();
Application->Title = "MPGH";
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
if (fwdreason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL,NULL, (LPTHREAD_START_ROUTINE)FormApp, NULL, NULL, NULL);
}
else if (fwdreason == DLL_PROCESS_DETACH)
{
ExitProcess(0);
}
return true;
}
C++ in ASM REGİSTERS
read and write for very important,necessary...
Sample game code;
DWORD ADDR_CHARB = RDWORD(KO_CHARB); read 4 bit KO_CHARB = Pointer...
Code:
DWORD RDWORD(DWORD paddy); void MDWORD(DWORD paddy, DWORD pval);
Code:
DWORD RDWORD(DWORD paddy){
DWORD retval;
__asm {
mov ebx,[paddy]
xor eax,eax
mov eax,DWORD PTR DS:[ebx]
mov retval,eax
}
return retval;
}
void MDWORD(DWORD paddy, DWORD pval){
__asm {
mov ebx,paddy
xor eax,eax
mov eax,pval
mov DWORD PTR DS:[ebx],eax
}
}
DWORD ADDR_CHARB = RDWORD(KO_CHARB); read 4 bit KO_CHARB = Pointer...
Nice snippet. One thing I'd point out is that using inline assembly ties this to 32-bit MSVC. For newer projects I'd generally prefer standard C++ pointer access or compiler intrinsics where possible. Still a clean example for legacy code and game memory work.
I could be rusty with my knowledge of assembly but isn't this:
the same as:
?
Code:
DWORD RDWORD(DWORD paddy){
DWORD retval;
__asm {
mov ebx,[paddy]
xor eax,eax
mov eax,DWORD PTR DS:[ebx]
mov retval,eax
}
return retval;
}
Code:
DWORD RDWORD(DWORD* paddy)
{
return *paddy;
}
?
makes your dll smaller:
Code:
#pragma optimize("gsy", on)
Similar Threads
Visual Basic Programming[Tutorial/Snippet][VB6] Reading and writing INI Files
6 Runescape Private Servers[Snippet] ButtonHandler - A cleaner and easier way to add button clicking
0 Combat Arms Hack Coding / Programming / Source Code[Snippet]Controlable speed and gravityAP 8 WarRock - International Hacksi need short icq number pls and hack to wr..BO 1 General GamingLineag2 and Ragnarok
12
