Thread: check this while loop...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    22

    Cool check this while loop...

    i have a while loop and is confusing; can someone help me to understand it.

    Code:
     void *v3; // esp@1
      int v5; // [sp+14h] [bp-14h]@1
      int v6; // [sp+18h] [bp-10h]@1
      int v7; // [sp+1Ch] [bp-Ch]@1
      int v8; // [sp+20h] [bp-8h]@1
      int v9; // [sp+24h] [bp-4h]@1
    
      v3 = alloca(16);
      __main();
      v9 = 1337;
      v8 = 1000000000;
      v7 = 2;
      printf((int)&dword_4433C0, "############################\n");
      printf((int)&dword_4433C0, "#____[ AC1D Materie#1 ]____#\n");
      printf((int)&dword_4433C0, "#__[ by #ParadoxX[AC1D] ]__#\n");
      printf((int)&dword_4433C0, "############################\n\n");
      printf((int)&dword_4433C0, "First Serial: ");
      scanf("%d", &v6);
      printf((int)&dword_4433C0, "\nSecond Serial: ");
      scanf("%d", &v5);
      while ( v9 )
      {
        v5 ^= v7++;
        --v9;
      }  printf((int)&dword_4433C0, "\nChecking...\n");
      Sleep(0x3E8u);

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    It's obviously disassembled code interpreted and translated to C. My guess is you are trying to crack an application, maybe write a key generator.

    Anyways, the code is not too hard to understand. It simply XORs v5 with a constant. At least, that's the net effect of the entire loop. I don't know what this constant is (I'll have to code up an application of 5 lines or do some maths to find out and I'm too lazy for either of that), and I'll leave it as an exercise for you to find out. It's not that difficult. If you can't do it, you're not up to whatever it is you're doing here.
    Okay, I'll give one more hint: (a XOR b) XOR c == a XOR (b XOR c)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. HELP!!!!emergency Problem~expert please help
    By unknowppl in forum C++ Programming
    Replies: 9
    Last Post: 08-21-2008, 06:41 PM
  3. I need help as soon as possible.
    By hyrule in forum C++ Programming
    Replies: 7
    Last Post: 11-09-2005, 05:49 PM
  4. Replies: 4
    Last Post: 11-23-2003, 07:15 AM
  5. writing/reading from file produces double results.
    By stumon in forum C Programming
    Replies: 4
    Last Post: 03-20-2003, 04:01 PM