PLY

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: if i have two or more adapter connect to the Internet #5703
    PLY
    Participant

      Can you give me an example for WaitForMultiplyObjects? i can’t create thread for each adapter because it waste my time for recreate the whole system.

      in reply to: Modify packet [DELPHI] #5579
      PLY
      Participant

        @PLY wrote:

        Why i can’y calc TCP checksum? Please help

        first, i declare this


        TIPHeaderPtr = ^TIPHeader;
        TIPHeader = packed record
        VerLen: Byte; //HL
        TOS: Byte;
        TotalLen: Word;
        Identifer: Word;
        FragOffsets: Word;
        TTL: Byte;
        Protocol: Byte;
        CheckSum: Word;
        SourceIp: DWORD;
        DestIp: DWORD;
        // Options: DWORD;
        end;

        TTCPHeaderPtr = ^TTCPHeader;
        TTCPHeader = packed record
        SourcePort:Word;
        DestPort:Word;
        SequenceNumber:DWord;
        AcknowledgementNumber:DWord;
        Offset:Byte; //only left 4 bits. Header length in 32-bit segments
        Flags:Byte;
        Window:Word;
        Checksum:Word; //includes speudo header instead of TCP header.
        UrgentPointer:Word;
        end;

        pTCPData: PChar;

        after that i get IP header and calc IP check sum is collect but why i can’t calc TCP checksum. the code like below.


        pTCPHeader.Checksum := 00;
        pTCPHeader.Checksum := htons(Checksum(Pword(pTCPHeader), (sizeof(TTCPHeader)+length(pTCPData)) div 2));

        i forgot something? or i should not use PChar for get the TCP data?

        in reply to: Modify packet [DELPHI] #5578
        PLY
        Participant

          Why i can’y calc TCP checksum? Please help

          first, i decare this


          TIPHeaderPtr = ^TIPHeader;
          TIPHeader = packed record
          VerLen: Byte; //HL
          TOS: Byte;
          TotalLen: Word;
          Identifer: Word;
          FragOffsets: Word;
          TTL: Byte;
          Protocol: Byte;
          CheckSum: Word;
          SourceIp: DWORD;
          DestIp: DWORD;
          // Options: DWORD;
          end;

          TTCPHeaderPtr = ^TTCPHeader;
          TTCPHeader = packed record
          SourcePort:Word;
          DestPort:Word;
          SequenceNumber:DWord;
          AcknowledgementNumber:DWord;
          Offset:Byte; //only left 4 bits. Header length in 32-bit segments
          Flags:Byte;
          Window:Word;
          Checksum:Word; //includes speudo header instead of TCP header.
          UrgentPointer:Word;
          end;

          pTCPData: PChar;

          after that i get IP header and calc IP check sum is collect but why i can’t calc TCP checksum. the code like below.


          pTCPHeader.Checksum := 00;
          pTCPHeader.Checksum := htons(Checksum(Pword(pTCPHeader), (sizeof(TTCPHeader)+length(pTCPData)) div 2));

          i forgot something? or i should not use PChar for get the TCP data?

          in reply to: Auto-Choose Internet Network Adapter #5569
          PLY
          Participant

            Can you give me an example code for use IP HELPER API to find the network adapter that connected the Internet ?

            in reply to: problem with winpkfilter #5494
            PLY
            Participant

              Thank you very much. this is very simple solution that i forgot it 😆 so sorry for waste your time.

              in reply to: problem with winpkfilter #5492
              PLY
              Participant

                i think your winpkfilter can work on GUI app but problem is the example code of winpkfilter. i try copy two example code (passthru and packetsniffer) to GUI app and problem still occure when other application try call SendMessage or GetMessage for broadcast windows message. so the other application will not respond because SendMessage and GetMessage wait for return message from process and i think the problem are few line of code (i use delphi )

                while counter <> 0 do begin
                WaitForSingleObject ( hEvent,INFINITE);
                ResetEvent(hEvent);
                while (ReadPacket (hFilt, @ReadRequest) <> 0) do begin
                Dec (counter);
                …..
                end;
                end;

                i think because we use 2 while loop and WaitForSingleObject. if we don’t exit 2 while loop, the app can’t process any win message and also WaitForSingleObject , Can WaitForSingleObject not use INFINITE? or Can we use other method instead WaitForSingleObject?

                Please Help

                in reply to: Calculate Tcp checksum in delphi #5484
                PLY
                Participant

                  don’t have any one use Delphi? T_T

                Viewing 7 posts - 1 through 7 (of 7 total)