help needed with streams

Discussion in 'C' started by tootypegs, Apr 1, 2008.

  1. tootypegs

    tootypegs New Member

    Joined:
    Nov 25, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    hello, i am completelt stuck and i have no idea how to proceed and hoping that you guys may help. using memcmp i loop through my file finding every instance of a search criteria and return its byte position in 'pos'.

    Everytime i get a return for pos, i want to start at that byte and stream the data into another file until i hit another search criteria. An example of my file could be


    blahblahblahblahblahblahSTART datadatadatadatadatadatadatadata STOPblahblahblahblahblahblahblahblahblahblahblahblahblahblahblah
    blahblahblahblahblahblahblahblahblah START datadatadatadatadatadatadatadata STOP blah

    so far i loop through my file and return the byte position of each start fine. Could anyone help me to contruct a stream that starts at this position and streams the data until it reaches the end criteria

    I am using memcmp because the end criteria for each stop position is a hex string
    0xFF, 0xD9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00


    i would be EXTREMELY greatful for any help and can post the code i have if it will be of help?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice