Getting Payload with Delphi

Home Forums Discussions Support Portal Getting Payload with Delphi

This topic contains 1 reply, has 2 voices, and was last updated by  Vadim Smirnov 9 years, 1 month ago.

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



    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?


    Vadim Smirnov

    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.