View Single Post
Old Oct 9th, 2006, 1:31 AM   #1
backstabber
Newbie
 
Join Date: Oct 2006
Posts: 9
Rep Power: 0 backstabber is on a distinguished road
Question read access violation

this program is compiled using mingw and borland c++ and it gives a read access violation error (olly debug) when it starts the search for "the"

#include <cstdlib>
#include <iostream>
#include "file.h"
#include "alpha.h"

using namespace std;

int main(int argc, char *argv[])
{
    char fileout[302];
    char key;
    int iter =0;
    for (int w = 0; w < 102; w++)
    {
        key = alpha[w];
    for (int i = 0; i < 302; i++)
    {
        fileout[i] = key ^ file[i];
        }
    for (int f = 0; f < 302; f++)
        {
             iter++;
             if (fileout[iter] == 0x74 && fileout[iter+1] == 0x68 && fileout[iter+2] == 0x65)
             {
                            for (int d = 0; d < 302; d++)
                            {
                                cout << fileout[d];
                            }
             }
        }
}
}
it a little messy but this app pulls a single char from the alpha[] array and xors it with ever char in the file array this is a challenge please only fix the access violation not any thing else and a few hints as to good code production would help
this is an xor brute forcer
backstabber is offline   Reply With Quote