Getting Payload with Delphi

Home Forums Discussions Support Getting Payload with Delphi

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5264
    HannesG
    Participant

      Hi

      I am trying to get the actual payload with delphi but it seems an impossible task.

      I do this:
      dwDataLength := PacketBuffer[liIndex].m_Length – (SizeOf(pEthHeader) + (pIPHeader.hl_vl and $F)*4 + (pTcpHeader.Offset and $F)*4);
      pData := PChar(pEthHeader) + (SizeOf(pEthHeader) + (pIPHeader.hl_vl and $F)*4 + (pTcpHeader.Offset and $F)*4);

      This however does not even remotely work as (pTcpHeader.Offset and $F)*4 always returns 0.

      When i do this: ((pTcpHeader.Offset-6) and $F)*4 it returns 40 and I can get hold of *some* of the payload. This also is not ideal as the payload is never the correct or complete payload.

      Any ideas?

      #6773
      Vadim Smirnov
      Keymaster

        Most probably there is something wrong with structures definitions. Or you may be trying to process non TCP packet.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.