Thread: Searching for strings in a large group of characters and numbers

  1. #1
    Registered User levitylek's Avatar
    Join Date
    Sep 2010
    Location
    Orlando
    Posts
    19

    Searching for strings in a large group of characters and numbers

    I've been tasked with creating a program that reads in 2 virus signatures as strings, i.e.
    Code:
    '2A40 020E 0788 0002 33C9 8BD1 419C' and '10BC B801 33C9 8BD1 ABCD'
    Then given a text file such as:
    Code:
    14011795FECFEBFF00D7A3CAFF0067F5FF00EBD52A40020E0788001233C98BD1419C8A66C1EA0040B801020E0788000233C98BD1419C7F5FFEBD1E57FB3FAFFF005EA5D83D410BCB90133C9BBD1ABCDFE9FE146C1EA7F4FF000A008BCAF2A40020E0788000233C98BD1419CF0067F5FF00EBD1E57FB3FAFF00F5EA5D83D4FE9FE146C1EA7F4FF0A008A8A9760F53FA7F851B07A9FD3FC28022A3CAFF0067F5FF00EBD4BB07A9F0040B80A33C98BD10BCB800133C98BD1A1BCD1AB53D3FC28D83D4FE9FE14011795FECFEBFFD7A2A5D83D4FE9FE146C1EA7F4FF0A008BCAFF67F5FFEBD152EC1EA7F4FF0A360F53FA7F850045E57FB3FAFFF005E8F2BFD9FD7FF00AF52EC1EA7F4FF000A7D0057F2BFD9
    I have to scan through that and find if there are any exact matches to those virus signatures or if there's a number/letter that is replaced with another, or if any of the characters in the found virus signature has swapped.

    Like
    Code:
    2A40 020E 0878 0002 33C9 8BD1 419C
    where the bolded 8 & 7 have swapped
    or
    Code:
    2A40 020E 0788 0002 33C9 88D1 419C
    where the bolded 8 replaced a B

    I know how to read everything in and what not but I have no clue how to even go about scanning through the text for those exact or close to exact strings. Can anyone please shed a little light on this mystery?

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Ok, nice project... Get started on it, write as much as you can. Then if you get stuck (really stuck, not lazy stuck) post your code, explain the problems and maybe we'll help you out.

    click here---> Announcements - General Programming Boards

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to read characters, strings and numbers
    By VelvetMirror in forum C Programming
    Replies: 3
    Last Post: 05-16-2010, 07:16 PM
  2. help searching words in large files
    By nick2 in forum C Programming
    Replies: 5
    Last Post: 05-30-2009, 02:51 AM
  3. Searching a VERY large text file
    By Tankndozer in forum C Programming
    Replies: 4
    Last Post: 07-29-2004, 02:45 AM
  4. Need a way to divide a group of numbers
    By adrianxw in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 09-11-2003, 12:44 PM
  5. a way to group characters?
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 09-02-2001, 07:34 AM