View Single Post
Old 01-29-2004, 01:43 PM   #1 (permalink)
magguz
BattleForums Junior Member
 
Join Date: Dec 2002
Location: germany
Posts: 196
Question on creating modules for d2hackit.

If this is the wrong place plz move that.



My problem is i know a bit of C (i study it now 1 semester) and C++ is not that much different but there a lot of things i do not understand especially with d2hackit.

Is it only posible to interact with recieved and send packets with this 2 functions?
Quote:
DWORD EXPORT OnGamePacketBeforeSent(BYTE* aPacket, DWORD aLen)
{
return aLen;
}

DWORD EXPORT OnGamePacketBeforeReceived(BYTE* aPacket, DWORD aLen)
{
return aLen;
}
Am i forced to use many global variables and check with flags between my functions? For example:

Quote:
/*****ing globals i want locals:*/
BOOL flag = TRUE;
BYTE = pac;

DWORD EXPORT OnGamePacketBeforeReceived(t(BYTE* aPacket, DWORD aLen)
{
if (aPacket == 0x9c && FLAG = FALSE)
{
memcpy(pac, aPacket+1, 4);
flag = TRUE;
}

return aLen;

BOOL PRIVATE OnGameCommandMyCommand(char** argv, int argc)
{

if (flag == TRUE)
{
server->GameSendPacketToServer(pac, 9);
flag = FALSE;
}
else
HOW DO I TELL THE ****ING PROGRAMM HERE THAT IT SHOULD WAIT TILL THAT PACKET IS RECIVED ????
Thats my main problem.

return true;
}
And another problem:

Is it posible to convert BYTE to CHAR anyhow?? I want to logg some packets into a ini file myself for example:
Quote:
BYTE pac;
char buffer[100];

/*[convert here somehow]
buffer should contain than the human readable bytes like 0x19 0x9c 0xa0 ..... */

server->SetHackProfileString("mephduper","1","2",buffer );
magguz is offline   Reply With Quote