Showing posts with label Tutorials. Show all posts
Showing posts with label Tutorials. Show all posts

Saturday, July 9, 2011

Tutorial on Making Key Generators


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


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 Swi ftsearch 2.0!

 Swiftsearch is a useful litt le 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 regis tration 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<="" span="">
        { 
          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'. 

Step 2: Enter (CTRL-D) Soft ice 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 calculat ing 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<="" span="">
        { 
           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);
}

  For feedback and suggestions pls contact me :)

How to Crack CD Protections


Chapters:
1). About, Programs needed … etc.
2). The easy protection.
3). Finding the right file – and the right error.
4). Finding the right line number.
5). Editing the line.
6). Testing.
7). Quick order list.
 
Here we go (again)!
Chapter I: About, Programs needed … etc.

Hrp! This tutorial is written by FANATIK, member of the #WAREZFRANCE CREW. It is the
second part of my first tutorial: RiPPing 
Tutorial, that explains all about RiPPing except how to crack the CD 
protections… so here is the other part – how to finish the RiPPing by cracking 
the protection. This will help you w/ the most basic system of protection, 
called C- dilla, that is the most usual one…
   The programs we will use are 2: first, and decompiler – the files we will 
work with are in ExE format, and we need a program that will HeX them (transfer 
to 16 base, hexa, form) and locate the orders given in the code, then we will 
find the line we need and change it to remove the protection with... – the 
second program: we need a program that will *edit* the files, and fetch the 
right line number we got using the first program… all those action are easly 
done w/ the programs: Win32Dasm (the disassembler - decompiler program, added in 
the dir [root/Win32Dasm]), and Hiew (the editing program added in the dir 
[root/Hiew]). The programs are added to the tutorial, because I’m not so sure 
you can find then on a stable location on the net, in the dir [root/programs].
 
Chapter II: The easy protection.

Okay! To save you from reading this entire tutorial for nothing you’re not going 
to use I made this chapter, because there is a good chance you won’t be needing 
it!     Some games comes w/ protection as a files in the [/Setup] dir (or root 
dir) called:  [00000001.TMP], [CLCD16.DLL], [CLCD32.DLL] and most important 
[CLOKSPL.EXE]... if you see any of them delete it and the protection should 
disappear (Important! delete them after making a mirror of the game on your HD, 
using the info in the next chapter) … if you are still getting an error message 
just keep on reading.
  Chapter III: Finding the right file – and the right error.

The files we are going to work w/ will be the main ExE of the game: you will 
find it on the CD, in a dir called [/Setup] or [/data], but the easy way to find 
it is just installing the game, and the ExE that starts the game – will be the 
ExE we need! ... once you’ve got it make some room on your HD, because we are 
going to copy the hole CD to it… before you do that: some games have am option, 
when Installing, to Install the full game to the CD (but still needing it to 
play), use it if possible, The files you  need to copy are all the game files, 
in some games it is the root dir of the CD, in others it is the [root/data] dir… 
the worst case is when the game is inside a CAB file, then you have to use a CAB 
extractor (WinZip 8 should do the job), and if it is protected a different 
program that can compile CAB format (I’ll try to put it on the tutorial as 
well). Once you’ve done all that – press the ExE, and if the game opens close it 
and exit the CD, then press again- you will get an error window! … usually the 
line goes like: “Error, please enter CD to run game” or “CD error” or “Error 
reading CD-ROM” .. what ever error you get – write it down and remember it, we 
are about to look for it in the ExE code, and change it!
 
 
Chapter IV: Finding the right line number.

Open the first program - Win32Dasm, by unzipping it and clicking on 
[/w32dsm89.exe], now we have to load the file we know is the main ExE of the 
game, so click on “Disassembler“ in the main menu, then “Open File to 
Disassemble...” (Important! Make sure you got 50-100MB free on your HD) before 
then pick the file from the clone game dir you made in your HD (Important! make 
a backup of the ExE) … after you’ve success fully w8ed while the program 
disassembled the file, you will see *a lot * of gibberish… don’t worry! You 
don’t have to understand what is says (I don’t, and I’m not so sure ne1 does… 
except the programs of course) … (Important! If you can’t read and the font 
shows only numbers and bizarre letters, click on “Disassembler” in main menu, 
then “Font…” then “select Font” then pick Arial or something in English) … now 
you have to find the exact line number out of the 2 million in the file that has 
the error message in it, do that by clicking the “String Data references” 
button, from the buttons menu (under the main menu) – the second one from the 
right (-your right)… now you get a list of all the lines in the ExE that refers 
to actions, and you have narrowed the lines from 2 million – to 2 thousand… to 
find the error message click the first letter it started w/ (for example, if the 
message was “Error reading CD-ROM” click  E) then search ‘till you find the 
error line you are looking for! … once you’ve found it… it will mark the title, 
pick the first line, and it should change color to green (that means the line 
can be edited and is important)… to be sure you have taken the right line: if 
there is a line like:
“:0044XBCK EB08    ….. (lots of spaces)  …. Jmp 0044EBD8” or:
“:0044XBCK EB08    ….. (lots of spaces)  …. Call 0044EBD8” or:
“:0044XBCK EB08    ….. (lots of spaces)  …. Push 0044EBD8”
you at the right line, it says the command is a function, effected by the user, 
and probably the protection we are looking for (notice the words: Jmp = Jamp, 
Call = Call, Push = Push)… now that we got the right line we have to find her  number! That is done by looking at the bottom of the program window and in the 
line, that should look similar to this one:
“Line:*** Pg *** of *** Code Data @:0045821 @Offset 00045821h in file:***.exe“
notic the number that comes after the word „Offet“ in this line: 00045821h that 
is the line number! But notice the letter „h“ at the end of it – you don’t need 
it, and don’t forget to remove it from the number, now – the only thing left to 
do is changing the line and removing the protection!
 
Chapter V: Editing the line.

After writing down the line number you can minimize Win32Dasm, because for now 
we have finished using it. Open the second program: Hiew (added in the 
tutorial), this is an editor that will work bad for searching the right line, 
but will do if you know the line number and just wanna change it…
Open again the same game ExE you have processed in Win32Dasm. When you enter you 
see a lot of gibberish, that’s the code, and you need to change it to the 
decoded language… do that by pressing the F4 key and then pick the option 
“Decode“ .. heh! Alot better now... now click F5 key, to search the right line, 
you will see the line numbers at the left end of the screen is gray, enter the 
line number you got from Win32Dasm and it will jump you to the right loction in 
the file... now, this is the difficult part, not hard to do – but hard to 
explain, near the line number (just at the right) you will see the command in 
HeX form, it should be something like  BC1BB3D2D1 that is in HeX code (base 16) 
which means a number (=byte) is represented by 2 letters/number, so that the 
group (BC1BB3D2D1) is made of 5 bytes: BC – 1B – B3 – D2 – D1 ... (10 numbers = 
5 bytes, 8 numbers = 4 bytes and so on...), we are about to change evrey byte 
from D1 or BC to 90 this is done by pressing the key F3 (activates Editing 
option) and pressing, for every byte, the number 90 (90 is the noop number, that 
will disable the action)... and in our case, the command will change from 
BC1BB3D2D1 to 9090909090 ... once it is done click the key F10 to save the 
offset, and exit.
 
Chapter VI: Testing.

Now that you have an ExE w/out the error line, activate it from the same clone 
dir of the game you made to test it, if its working – congratulation! You have 
just cracked a CD protection! … if you are getting another error message redo 
the same steps you have do w/ the first error message (in chapters 3-5) to 
change it as well (Important! Do it on the same ExE you have edited, and backup 
this one as well) and then test it again. You might be needed to do it several 
number of times, until you are getting no error message and the game runs!
 
Chapter VII: Quick order list. 

- Start without Cd then look at the error message and write it down.
- Search the msg in Win32Dasm referance and copy nmber w/out the H at the end!.
- Open Hiew, F4 to Decode, F5 to seach the line, and change the command – 90 for 
every 1 byte.
- F10 to save and then get out, don’t forget to test!
   
Good luck CraCKing!

Friday, June 24, 2011

How to hack the Computer using Hardware Keylogger?


Demits of Key logger Software: 


  •    Easily detectable
  •    User can block the Key logger Software using any Security system.

Key logger software captures each key strokes.  Likewise our Key logger hardware is going to work. The Hardware Keylogger is a tiny plug-in device that records every keystroke typed on any PC computer.

Hardware key logger is connected with Keyboard wire ,then  it is connected to system port.  It is small in size so victim can not know that key logger is connected.

Why you need hardware keylogger?

  • As a key logger tool for computer fraud investigations.
  • As a monitoring device for detecting unauthorised access.
  • As a deterrent, to prevent unacceptable use of company resources.
  • As a back up tool which creates a log of all keystrokes typed on a keyboard.

Advantages of Hardware Keylogger

Easy to install in a few seconds! Simply plug it in
It records every keystroke, even those typed in the critical period between computer switch on and the operating system being loaded.


Buy the Keyghost Hardwar Key logger


KeyGhost installation demonstration


keyghostThe KeyGhost hardware keylogger can be easily connected in under 5 seconds, even when computer is logged out, password protected, locked or switched off. Just plug it in! Its quite unobtrusive. Most users go months without examining the back of their computer. Think now ... can you picture what the back of your computer looks like at the moment?

Once the KeyGhost is installed, it quietly records every key pressed on the keyboard to it's own internal Flash memory (same as in smart cards).

To install the KeyGhost you simply unplug the keyboard cable from the back of the PC, plug it into one end of the KeyGhost, then plug the other end back into the PC. No software installation is necessary!

Learn how easy it is to operate the KeyGhost here

 

Popular Posts

Recent Posts

Blog Archive