1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[help] Packet Sending

Discussion in 'Programming' started by Wallz, Aug 21, 2010.

  1. Wallz

    Wallz Member

    I am using this function posted by Unknown

    Code (Text):
    1. typedef struct {
    2.     DWORD  Null;
    3.     LPVOID lpvData;
    4.     DWORD  nSize;
    5.     DWORD  Null2;
    8. typedef DWORD (__stdcall *SENDPACKET)(LPPACKET);
    9. void __stdcall SendPacket(__inout_bcount(cb) LPVOID lpvPacket, __in SIZE_T cb)
    10. {
    11.     SENDPACKET  SendCall = (SENDPACKET)g_dwSend;
    12.     PACKET      pPacket;
    14.     ZeroMemory(&pPacket, sizeof(PACKET));
    15.     pPacket.nSize     = cb;
    16.     pPacket.lpvData = lpvPacket;
    18.     __asm mov ecx,[g_dwClass]
    19.     __asm mov ecx,[ecx]
    21.     SendCall(&pPacket);
    22. }
    24. /*
    25.         BYTE bPacket[6] = { 0x26, 0x00, 0xFF, 0xFF, 0xFF, 0x00 };
    26.         SendPacket((LPVOID)&bPacket, 6);
    27. */
    And I have got it to work fine on ems, however I have one problem, after I send one packet I can't send anymore. For example if I send the CC packet I can't send any others. I am calling this function the same way that is commented out. I will be thankful for any help

    Regards Wallz.
  2. DarkSpace

    DarkSpace Well-Known Member Coder

    yeah i had the same problem.

    ZeroMemory() cleans the packet you sent, totally removes it form existance so you cant send it again.

    i made a function for example

    void sendMyPacket(String Packet )
    //convert packet from string to BYTE or something
    packet.data = convertedPacket
    then send the packet like normal.

    now every time you say sendMyPacket("00 00 00 00") there is a fresh variable that exists.

    or another way is to just remove ZeroMemory =P
  3. Wallz

    Wallz Member

    Thanks, I had a look over pro surfs source and figured it out

Share This Page