Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8

Thread: CRC Heaven

  1. #1
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Huh? CRC Heaven

    Trying to get the CRC value of a pic using this code (On Show Event) the cue.txt has the same crc # and the code compairs the two:

    --Checks to see if the realtor pic is the right one.
    crc_result = File.GetCRC("AutoPlay\\Realtor\\realtor.bmp");
    cue_result = TextFile.ReadToString("AutoPlay\\Realtor\\cue.txt" );
    Input.SetText("Input1", crc_result);
    Input.SetText("Input2", cue_result);
    x = crc_result;
    y = cue_result;
    if (x ~= y) then
    -- Do something here, they are not equal
    result = Dialog.Message("Notice", "Contact Diginetx at 805-555-5555.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

    The two #s are the same but it says they’re not. What am I doing wrong?
    Last edited by Bruce; 06-09-2005 at 10:44 PM.

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Here's an example project. If you change the image, it exits...
    Attached Files

  3. #3
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Thanks Corey-
    But I am trying to do this dynamically... Can you tell me what my code/I is doing wrong?

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    But how can you verify it dynamically, you need an "anchor" value don't you? If the verification value is grabbed at runtime from a plain file then you are just as open to abuse as before, no? I must be misunderstanding what the task is. If the goal is to protect your images then you would not store the original CRC values in a text file, you would add them to your project. That way you can be sure your reference or "anchor" values are not tampered with.

  5. #5
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Good point. All I am attempting to do is make sure some terd head realtor does not switch out the information thats on the CD (all dynamic) for he's or her own.

    I tryed some of your code here but it does the same thing:

    crc = String.ToNumber(File.GetCRC("AutoPlay\\Realtor\\re altor.bmp"));
    cue = TextFile.ReadToString("AutoPlay\\Realtor\\cue.txt" );
    x = crc;
    y = cue;
    if (x ~= y) then
    -- Do something here, they are not equal
    result = Dialog.Message("Notice", "Contact Diginetx at 805-555-5555.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    end

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    You are attempting to compare a number to a string, try this:

    cue = String.ToNumber(TextFile.ReadToString("AutoPlay\\R ealtor\\cue.txt"));

    Instead of this:

    cue = TextFile.ReadToString("AutoPlay\\Realtor\\cue.txt" );


  7. #7
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    You are the man! Thanks once again!

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Always happy to help.

Similar Threads

  1. Problem: Comparing CRC value
    By brianlesker in forum Setup Factory 7.0
    Replies: 3
    Last Post: 10-18-2004, 08:58 AM
  2. ERROR: Demo image failed CRC validation whe building
    By morpheuskc in forum Setup Factory 6.0
    Replies: 6
    Last Post: 01-17-2003, 03:38 PM
  3. CRC COMPRESSION ERRORS WIN2K SUF6
    By John Jackson in forum Setup Factory 6.0
    Replies: 5
    Last Post: 03-12-2002, 04:03 PM
  4. CRC for files.
    By jassing in forum Setup Factory 6.0
    Replies: 1
    Last Post: 12-01-2001, 09:16 AM
  5. File CRC mismatch
    By wuaizui in forum Setup Factory 5.0
    Replies: 4
    Last Post: 08-24-2000, 01:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts