views:

468

answers:

6

I have the following code:

#include <iostream>
#include <string>

void main()
{

    std::string str;
    std::cin>>str;

    if(str == "TheCorrectSerialNumber")
     std::cout<<"Hello world!!!"<<std::endl;
}

I need a decompilation or disassemblering tool which can help me by doing below listed steps find the "TheCorrectSerialNumber". So the steps are:

  1. decompile or diassembler the executable of my code
  2. run the exe and type not the Correct Serial but something like “AAA”
  3. find my “AAA” with what string is being compared and finally find out the "TheCorrectSerialNumber".

Please provide me also with directions how your suggested tool is doing above listed steps.

Thanks a lot!!!

NOTE: For those who tend to think that I want to crack someone’s code! First look ant my questions that I've asked just before and just after this question. I am a programmer and I need to concern about my codes security. Thus I have decided to crack my codes and to do some exercises on the other codes (on the sites that teach cracking there are a bunch of softs that are designed to be cracked) to understand how to deliver a secure code. If you know how people do cracking you probably will create more secure code that someone who doesn't know. And if you what to study how to crack you have to try. That is my point!

A: 

Either you're doing something unethical or you're not. Either way you need something called a debugger and there will be one for your platform.

A debugger is a tool designed to help debug programs by attaching to a running piece of code and letting you examine it's state while running. Essentially you can view the state of the code (what's running where when etc) and state if the data. After all its all just a program counter and some memory, with a few registers thrown in to make life easy.

Preet Sangha
+1, it does not deserve to be negative.
gimpf
+3  A: 

Depending on what platform you are on, you can use GDB (Gnu debugger) or IDA Pro.

Andrew Sledge
How can I use a debugger if the code compiled for not debugging but for release.
Narek
A debugger does not NEED debugging symbols (which are what a debugging build provides). Without debugging symbols it means you have to debug the binary at the assembly level, as you have no information about source constructs.
Falaina
IDA Pro used to have a free version, which is probably still available if you look hard enough, though it must be 5 or 6 years out of date by now at least. Anyway, IDA Pro can do a lot to figure out API call names and sensible parameter names even with release code. Of course it can do much better with a debug build...
Steve314
Just to clarify - the *free* version must be out of date, since they only offered it for a short while. AFAIK, the full IDA Pro is still under active development.
Steve314
+1  A: 

I don't have much experience in reverse engineering on Windows, however Lena's tutorials are probably the best place to start in regards to reversing basic binaries. It'll run you through the basics of analyzing binaries at the assembly level and patching them. I believe it primarily makes use of ollydbg

Falaina
A: 
phoku
but what if my hat is blue???
Longpoke
you are a pimp!
Bartosz Wójcik
A: 

Dude .. for something as trivial as this, just open it up in notepad, you'll find your "TheCorrectSerialNumber" .. probably right next to "Hello World!!!".

Jacob
A comment with the downvote would be appreciated .. as always.
Jacob
+1  A: 

It is very easy to do with disassembling. You need HIEW and W32DASM tools or OllyDbg (for example). Just look at some examples of using this tools in youtube (cracking).

www.wasm.ru www.cracklab.ru

Very helpful sites!!!!

Narek
if you are russian...
Bartosz Wójcik