CRC Heaven

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2134

    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, 10:44 PM.
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Here's an example project. If you change the image, it exits... :yes
    Attached Files

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2134

      #3
      Thanks Corey-
      But I am trying to do this dynamically... Can you tell me what my code/I is doing wrong?

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        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. :yes

        Comment

        • Bruce
          Indigo Rose Customer
          • Jun 2001
          • 2134

          #5
          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

          Comment

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9745

            #6
            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" );

            :yes

            Comment

            • Bruce
              Indigo Rose Customer
              • Jun 2001
              • 2134

              #7
              You are the man! Thanks once again! :yes :yes

              Comment

              • Corey
                Indigo Rose Staff Alumni
                • Aug 2002
                • 9745

                #8
                Always happy to help. :yes

                Comment

                Working...
                X