Jump to content
pelican

Ceva usor..

Recommended Posts

P?i, abia înv?? cum se folose?te Ollydbg.

Am v?zut c? te mai joci ?i cu ni?te stringuri f?r? importan?? (toUpper, toLower). Am pus breakpoint inainte de afisarea mesajului "Gresit" si am v?zut ce compar?ri faci pe acolo, bingo, pe undeva pe stiv? era parola.

Link to comment
Share on other sites

Codul sursa pentru cine e interesat..daca e cineva :))

VC++ 2010

// pelican @RST.

#pragma once

#include "targetver.h"



#include "stdafx.h"
#include <string>
#include <conio.h>
#include <iostream>
#include <stdio.h>
#include <tchar.h>
#include <dos.h>
#include <windows.h>
#include <cstdlib>
using namespace std;

int main(void)
{
char g[80]="!@#$%^&FdfgBANANAdsadsTEAPAdasdsaNUsdadsvbgfE", s[70]="lmdasnLOL,dadasdLMFAOadsasf*******SUCKSsada", a[9]="o*#s", b[9]="Fr@u", c[8], d[8], e[33]="rqweRFAscSAWQ@#!@DSASA";
int i=0, j=0, x=0, n=0, q=0;


SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 666);
cout<<"pelican@RST Ghiceste sirul de caractere ";

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 711);
cout<<"Este un sir din 8 caractere, L & U case, format din doua cuvinte pe care le intalnim foarte des :)";
cout<<endl;
strupr(e);
c[0]=e[0];
c[1]=a[3];
c[2]=g[22];
c[3]=b[0];
c[4]=a[0];
strupr(s);
c[5]=b[1];
c[6]=b[3];
c[7]=s[1];
cout<<endl;
cout<<endl;
for (x=0;x<8;x++)
cin>>d[x];
for (q=0;q<8;q++)
{
if (c[q]==d[q])
n=n+1;}


if (n==8)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 964);
cout<<endl<<endl;
cout<<"*******************"<<endl;
cout<<"*Corect!..si usor.*"<<endl;
cout<<"*******************"<<endl;
Sleep(10000);
{return 0;}
}

else
{
cout<<endl<<endl;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 241);
cout<<"G";
Sleep(250);
cout<<"r";
Sleep(250);
cout<<"e";
Sleep(250);
cout<<"s";
Sleep(250);
cout<<"i";
Sleep(250);
cout<<"t";
Sleep(250);
cout<<"!";
Sleep(250);

Sleep(4000);
{return 0;}
}
}


Link to comment
Share on other sites

Tu l-ai declarat pe c[8]. (Deci i s-a alocat o zon? de memorie). Când ai început s? faci atribuirile a început s? se umple o zon? compact?. Ce m-a încurcat pe mine foarte mult este acel strupr(s) în mijlocul atribuirii.

A?tept?m mai multe challenges. Cine încearc? s? le rezolve sigur înva?? ceva. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...