-4

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!

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Narek
  • 38,779
  • 79
  • 233
  • 389
  • 5
    -1 Sounds like you're trying to get someone's code for free... – Patrick Oct 01 '09 at 12:53
  • 2
    Few serial key implementations are as naive as you think they are. Usually they are not simple strings, but numbers which goes through an algorithm. There might not be 'one' correct serial number; there could be millions. So a valid key wouldn't be stored in memory either. Your question is formed on the wrong premises. If you use brute-forcing, you're probably done just when the sun burns out. –  Oct 01 '09 at 12:54
  • aww... let him find out by practise. Beside I bet you're wrong and many implementations have been done by divvy programmers who think its easy to implement their own encryption algorithm. – Preet Sangha Oct 01 '09 at 12:57
  • 6
    @ Patrick: What happened with "assume good faith"? @ Gamecat: Reverse engineering isn't illegal in most countries, but circumventing copy-protections might be illegal in some countries for some cases. –  Oct 01 '09 at 12:57
  • 1
    -1 Don't ask software developers to help you with getting their work for free. – Frerich Raabe Oct 01 '09 at 12:59
  • -1 looks too much like homework, and if it isn't, for such topics you should work out the basics on your own; resources are available on the net more than enough. – gimpf Oct 01 '09 at 13:00
  • 3
    Does it really hurt to assume good faith? Within reverse engineering communities it is common place to create CrackMe's/ReverseMe's which are small programs designed to provide a person interested in low level programming a chance to practice their skills by circumventing serial keys or protections. And I'd hardly claim "reverse engineering is illegal in most countries" (http://lwn.net/Articles/134642/) – Falaina Oct 01 '09 at 13:03
  • Hey, it is just for my knowledge. You can beliеve and you can not beliеve. That is your problem! by the way I am a software developer too! – Narek Oct 01 '09 at 13:03
  • is Russian numerous tools for this activity, locate them. – lsalamon Oct 01 '09 at 13:04
  • For windows for example. – Narek Oct 01 '09 at 13:06
  • 1
    Um, since you have the code (your first line) why not read the code and your are done ;) – Robert MacLean Oct 01 '09 at 13:15
  • @ Mads, hard day at the office I guess – Patrick Oct 01 '09 at 13:19
  • You don't want to know how we do it; you want us to tell you how to crack a program. Do your own homework. – dstibbe Oct 01 '09 at 13:27

6 Answers6

3

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

Andrew Sledge
  • 10,163
  • 2
  • 29
  • 30
  • How can I use a debugger if the code compiled for not debugging but for release. – Narek Oct 01 '09 at 13:05
  • 2
    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 Oct 01 '09 at 13:12
  • 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... –  Oct 01 '09 at 13:19
  • 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. –  Oct 01 '09 at 13:20
2

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
  • 6,625
  • 29
  • 31
1

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
  • 64,563
  • 18
  • 145
  • 216
1

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
  • 38,779
  • 79
  • 233
  • 389
0

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
  • 34,255
  • 14
  • 110
  • 165
-2

gray hat python http://nostarch.com/images/ghpython_cov.png

Let's assume you're not doing something illegal. I can recommend the gray hat book for reverse engineering especially if you're already fluent with python.

phoku
  • 2,082
  • 1
  • 18
  • 16