[Tutorial] Part II: How to make a Working (Fake) Keygen using AutoIt 3
2013-08-19, 01:06 PM,
#1
I’m glad to get some responses and requests based on my previous AutoIt tutorial here. So in this part, I’ll continue with things I’ve missed and we move onto creating a working (fake) keygen.


Skinning (Contd.)

For those users who want to create a custom skin for their game hack, should definitely checkout SkinBuilder. It allows us to customize every small detail of the GUI but it seems tedious to start everything from scratch.

TIP: Do you remember customizing your Windows XP with .msstyles? These formats can be imported and exported as .skf skins. You can get .msstyles from http://www.skinbase.org/Skins/msstyles/135 and some other sites. I got my Zune style back!


Making the Keygen to Work

Ah! The hard part of adding interactivity to the program, but believe me its fun! It’ll will be a lot easier when you understand “what happens next” i.e., the program flow and for help with the coding, there is always Google.

I’ll show you a complete example of creating a keygen with some basic functions which may help you to get started .


The Program

The program we will be making is Grand Theft Auto 5 Beta Key Generator, which upon open, prompts the user to enter a licence key. If the user doesn’t have the key, they must click Get Key button which will send them to FileIce survey containing Password.txt
After the user unlocks it, there will be a Generate button. On clicking it, a progress bar will load for 10 seconds and the key is displayed.


Design

First, we will start Koda Form Designer and design two forms: one for Enter License Key and another for Generator. Copy the code and keep them handy.

[Image: design_01.png]


Linking Both GUIs

Now merge the code in SciTE Editor, declaring include statements only once. Also be sure to check no two variables are same. On loading, the License GUI only should be visible. So we wrap up the Generator GUI in a function (so it will not execute at start) and call the function in License GUI where we require – through Continue button after the user enters the correct key.


Button & Msg Box

There are two modes supported in AutoIt for interactivity: Message Loop and On-Event. We’ll work on Message Loop mode as it is easy Grin

In Message Loop mode, the program will continously polls itself to see if something happened. There is atleast one event which will happen in all program which is user clicks the close button

Code:
While 1
        ;After every loop check if the user clicked something in the GUI window
        $msg = GUIGetMsg()
        Select
            ;Check if user clicked on the close button
            Case $msg = $GUI_EVENT_CLOSE
                ;Destroy the GUI including the controls
                GUIDelete()
                ;Exit the script
                Exit
        EndSelect
WEnd

Now if we want to check if the Continue Button is clicked, we add another Case statement:

Code:
While 1
        ;After every loop check if the user clicked something in the GUI window
        $msg = GUIGetMsg()
        Select

            ;Check if user clicked on the close button
            Case $msg = $GUI_EVENT_CLOSE
                ;Destroy the GUI including the controls
                GUIDelete()
                ;Exit the script
                Exit
            Case $msg = $ContinueBtn
                If GUICtrlRead($CodeIn) = "Springfire" Then
                    GUIDelete()
                    Generate()
                Else
                    MsgBox(48,"Error","You've entered incorrect code")
                EndIf
        EndSelect
WEnd

What it does is on clicking Continue Button, the GUI checks the input box and if it is correct, it deletes itself and call Generate() function containing Generator GUI. If its wrong, it throws a error msg box

TIP: Check C:\Program Files (x86)\AutoIt3\Examples\GUI\Advanced\msgboxwizard.au3for different types of msg boxes


Open link in Default Browser

Same way, for Get Unlock Code button we add another Case statement:

Code:
Case $msg = $UnlockBtn
        ShellExecute("http://fileice.net")


Embedding Images

In the previous tutorial, you may have noticed a big header image, which I just drag and drop using KFD. If you compile, the image is not embedded into EXE rather points to the location of the file on YOUR hard disk. So, your keygen may not render properly on other PCs.

A user from AutoIt forum created a useful User Defined Function (UDF) called Resources.au3 to solve this. It works along with AutoIt3Wrapper.

Download:

Quote:Resources.au3

SciTE4AutoIt + AutoIt3Wrapper

We use three edits to force the compiler to embed the image to EXE.

At the top of the script, add your images like this:

Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=gta.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_File_Add=Images/unlock.gif, rt_rcdata, UNLOCKIMG
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Note I’ve included unlock.gif and given the name UNLOCKIMG to it.


Next, include resources.au3 along with other includes. Make sure resources.au3 is in same folder.

Code:
#include <resources.au3>

Now change this line:

Code:
$Pic1 = GUICtrlCreatePic("Images/unlock.gif", 8, 16, 137, 137)

To this:

Code:
$Pic1 = GUICtrlCreatePic("", 8, 16, 137, 137)
_ResourceSetImageToCtrl($Pic1, 'UNLOCKIMG')

Important: Images will not appear in preview (F5). Press F7 to compile the script and check the image.


Bonus:

Resouces.au3 has added advantage of properly displaying transparent GIFs without blue background.

[Image: transillus_01.png]


Adding Progress Bar

After you add progress bar through Koda Form Designer, its declaration looks something like this. Note the variable used. Here it is $ProgressBar

Code:
$ProgressBar = GUICtrlCreateProgress(352, 208, 281, 33)

We create a For Loop to update progress bar, sleep for some time, update, sleep and so on.. Reduce the Sleep() value to speed up the progress bar and vice versa.

Code:
For $i = 0 To 100
GUICtrlSetData($ProgressBar,$i)
Sleep(160)
Next


Generating Random Alpha-Numeric Key

Here is a ready-to-use function to create random keys. By default, calling randm() anywhere returns key of 5 characters eg., JQ76L. For 4 characters, call as randm(4).

Code:
Func randm($digits = 5)
$pwd = ""
Dim $aSpace[3]
For $i = 1 To $digits
    $aSpace[0] = Chr(Random(65, 90, 1)) ;A-Z
    $aSpace[1] = Chr(Random(97, 122, 1)) ;a-z
    $aSpace[2] = Chr(Random(48, 57, 1)) ;0-9
    $pwd &= $aSpace[Random(0, 2, 1)]
Next
Return $pwd
EndFunc


Adding Icon

Icon can be added to exe with a single line of code:

Code:
#AutoIt3Wrapper_Icon=gta.ico

TIP: Convert your image to 256x256 windows .ico using http://iconverticons.com/online/


The Complete Program

Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=gta.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_File_Add=Images/locked.gif, rt_rcdata, LOCK
#AutoIt3Wrapper_Res_File_Add=Images/gta5.gif, rt_rcdata, GTA5
#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Resources.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Media\Desktop\Form1.kxf

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GTA 5 Beta Key Generator v1.02", 356, 158, -1, -1)
$Label1 = GUICtrlCreateLabel("Enter Unlock Code to Continue:", 168, 24, 152, 17)
$CodeIn = GUICtrlCreateInput("", 168, 56, 169, 21)
$ContinueBtn = GUICtrlCreateButton("Continue", 168, 88, 169, 25)
$UnlockBtn = GUICtrlCreateButton("Get Unlock code", 168, 120, 169, 25)

$LockedImg = GUICtrlCreatePic("", 8, 16, 137, 137)
_ResourceSetImageToCtrl($LockedImg, 'LOCK')

GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
        ;After every loop check if the user clicked something in the GUI window
        $msg = GUIGetMsg()

        Select

            ;Check if user clicked on the close button
            Case $msg = $GUI_EVENT_CLOSE
                ;Destroy the GUI including the controls
                GUIDelete()
                ;Exit the script
                Exit
            Case $msg = $ContinueBtn
                If GUICtrlRead($CodeIn) = "Springfire" Then
                    GUIDelete()
                    Generate()
                Else
                    MsgBox(48,"Error","You've entered incorrect code")
                EndIf
            Case $msg = $UnlockBtn
                ShellExecute("http://fileice.net")
        EndSelect

WEnd

Func Generate()
$Generator = GUICreate("GTA 5 Beta Key Generator v1.02", 651, 301, 294, 164)
$BlackBG = GUICtrlCreateGraphic(0, 0, 193, 300)
GUICtrlSetBkColor(-1, 0x000000)
$Logo = GUICtrlCreatePic("", 0, 0, 193, 177)
_ResourceSetImageToCtrl($Logo, 'GTA5')

$ProgressBar = GUICtrlCreateProgress(352, 208, 281, 33)
$GenerateBtn = GUICtrlCreateButton("Generate Beta Key", 208, 208, 129, 33)
$KeyDisplay = GUICtrlCreateInput("XXXX-XXXX-XXXX-XXXX-XXXX", 208, 256, 425, 28, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_UPPERCASE,$ES_READONLY))
GUICtrlSetFont(-1, 13, 400, 0, "Verdana")
$LogDisplay = GUICtrlCreateEdit("", 208, 16, 425, 177, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetData(-1, StringFormat("******************** GRAND THEFT AUTO 5 BETA KEY GENERATOR ****************\r\n\r\nPress Generate"))
GUISetState()
#EndRegion ### END Koda GUI section ###


While 1
        ;After every loop check if the user clicked something in the GUI window
        $msg = GUIGetMsg()

        Select

            ;Check if user clicked on the close button
            Case $msg = $GUI_EVENT_CLOSE
                ;Destroy the GUI including the controls
                GUIDelete()
                ;Exit the script
                Exit

                ;Check if user clicked on the "OK" button
            Case $msg = $GenerateBtn
                For $i = 0 To 100
                    If $i = 5 Then
                        $Data = GUICtrlRead($LogDisplay)
                        GUICtrlSetData($LogDisplay, $Data & @CRLF & @CRLF & "Checking installation..")
                    ElseIf $i = 20 Then
                        $Data = GUICtrlRead($LogDisplay)
                        GUICtrlSetData($LogDisplay, $Data & @CRLF & @CRLF & "Connecting to Server..")
                    ElseIf $i = 40 Then
                        $Data = GUICtrlRead($LogDisplay)
                        GUICtrlSetData($LogDisplay, $Data & @CRLF & @CRLF & "Connected. Waiting for reply..")
                    ElseIf $i = 100 Then
                        $Data = GUICtrlRead($LogDisplay)
                        GUICtrlSetData($KeyDisplay, randm() & "-" & randm() & "-" & randm() & "-" & randm() & "-" & randm())
                        GUICtrlSetData($LogDisplay, $Data & @CRLF & @CRLF & "Key successfully generated.")
                    EndIf
                    GUICtrlSetData($ProgressBar,$i)
                    Sleep(160)
                Next
        EndSelect

WEnd
EndFunc

Func randm($digits = 5)
$pwd = ""
Dim $aSpace[3]
For $i = 1 To $digits
    $aSpace[0] = Chr(Random(65, 90, 1)) ;A-Z
    $aSpace[1] = Chr(Random(97, 122, 1)) ;a-z
    $aSpace[2] = Chr(Random(48, 57, 1)) ;0-9
    $pwd &= $aSpace[Random(0, 2, 1)]
Next
Return $pwd
EndFunc


Download

Register or login to see this content
Latest Thanks - View all

AlexMagnus(2017-04-27 06:57 PM) Crap(2017-04-20 06:24 PM) Starf0x(2017-02-07 04:51 PM) bartolhc(2017-01-25 11:14 PM) naromo(2017-01-20 02:42 AM) UltraPrime(2016-08-29 10:20 AM) turbozx2(2016-08-20 01:29 PM) toobanasir(2016-04-24 06:22 PM) honeydew(2016-04-07 09:32 PM) yassinegtx(2016-03-30 06:13 AM) cvaoops(2016-02-08 01:39 AM) auto2exe(2015-11-03 05:42 PM) rinor4ever(2015-05-18 04:34 AM) g3lux(2015-03-16 03:46 AM) benhurs(2015-02-28 02:24 AM) Nepsoul!!(2015-02-24 06:16 PM) caiolps(2015-02-17 09:48 AM) today1991(2015-02-05 09:36 AM) mantas090(2015-01-19 03:41 PM) YCDI(2015-01-10 04:22 AM) nextlevel131(2015-01-06 08:32 PM) rh619(2014-12-30 03:33 AM) WDD2016(2014-12-28 08:48 PM) donbaxt3r(2014-12-27 02:36 AM) aloneak(2014-12-25 03:41 PM) Eau2vie(2014-12-18 09:16 AM) zoikz(2014-12-13 12:56 AM) salbag(2014-12-12 01:52 PM) AbiPod(2014-12-12 10:18 AM) Atamnoon(2014-12-11 10:56 PM) ReverseLNG(2014-12-11 07:53 PM) faiMan(2014-12-10 11:29 PM) avenuedee(2014-12-10 05:13 PM) pkaluza77(2014-12-10 02:17 PM) kmedwin72(2014-12-10 01:53 PM) shywolf91(2014-12-10 02:43 AM) rz1(2014-12-10 01:51 AM) daywalker79(2014-12-09 10:37 PM) meows1121(2014-12-09 10:17 PM) prabhavikki(2014-10-23 01:26 PM) Wezzlan(2014-09-30 03:11 AM) lacky01(2014-08-16 05:58 PM) Sandeep(2014-07-01 04:29 AM) Aser80(2014-06-22 09:23 PM) dommla(2014-06-04 08:07 PM) exzsyth(2014-05-31 01:05 AM) sam222(2014-05-18 07:07 PM) MrJohnnieWalker(2014-04-24 11:27 PM) SpeedZ(2014-04-18 08:17 AM) BustaSeo(2014-04-16 05:36 AM) uyaganteng(2014-04-01 05:50 PM) bmn(2014-03-30 01:25 AM) Oldman(2014-03-23 02:06 PM) Nick(2014-03-07 09:31 AM) bigboy(2014-03-05 01:27 AM) bell70(2014-02-20 07:44 AM) firebatlooper(2014-02-19 09:21 AM) LieToMe(2014-02-16 03:34 AM) luwiz(2014-02-11 01:27 PM) pepe471(2014-02-05 10:07 PM) nasgaroth(2014-01-26 08:03 PM) ThinkableWeb(2014-01-23 08:33 PM) Number23(2014-01-23 05:58 PM) UpFilee(2014-01-23 10:49 AM) Padix(2014-01-19 10:55 PM) NetFreak(2014-01-18 11:29 PM) iqbal1992(2014-01-13 03:50 PM) nsdown(2014-01-06 08:47 PM) Pyromaniac(2014-01-01 02:28 AM) frankso(2013-12-25 03:10 PM) Altima_(2013-12-24 06:27 AM) karimon(2013-12-23 06:27 AM) iconsis(2013-12-22 03:33 AM) ganesh8(2013-12-18 12:43 AM) Ant(2013-12-16 04:44 AM) Jokondo(2013-12-15 09:26 PM) mean969(2013-12-15 07:01 PM) edurasta(2013-12-15 12:06 PM) nagimastipipit(2013-12-13 08:33 PM) gorez(2013-12-10 03:18 PM) notallowed(2013-12-10 01:56 AM) gytautasra(2013-12-04 08:47 PM) jinji(2013-12-04 02:35 PM) tekitechie(2013-12-02 05:50 PM) sinn0021(2013-12-02 03:03 PM) bushido(2013-12-02 12:19 AM) jonath(2013-12-01 10:15 PM) kambing(2013-12-01 04:35 PM) tronicflower(2013-12-01 04:07 PM) abhimi(2013-11-18 01:14 PM) okome125(2013-11-16 08:38 PM) zarkokom(2013-11-07 05:48 AM) razeno(2013-10-26 07:39 PM) bogdanelu(2013-10-24 10:59 PM) Madpes(2013-10-24 11:42 AM) Synestrial(2013-10-22 07:18 AM) MotherLoadDolla(2013-10-21 05:24 AM) ebvr168(2013-10-20 12:30 AM) albothug(2013-10-17 01:52 AM) balkor(2013-10-16 04:50 PM) Captain Obvious(2013-10-16 03:46 PM) gogaiex(2013-10-16 01:44 AM) punktank(2013-10-15 08:28 PM) JohnWick(2013-10-15 06:55 PM) Cervantes(2013-10-15 03:06 PM) manasa(2013-10-15 12:26 PM) djkrmak02(2013-10-15 12:25 PM) Thief(2013-10-15 11:47 AM) wawangjan(2013-10-15 11:37 AM) chamacoe(2013-10-15 11:35 AM) Cornholio(2013-10-14 07:39 AM) kimple89(2013-10-13 02:01 PM) msi522(2013-10-05 06:52 PM) racker12(2013-09-27 02:45 PM) supermike(2013-09-25 09:33 AM) Andon(2013-09-21 11:24 PM) nmc.prodigy(2013-09-21 11:11 PM) - NiNSHUU -(2013-09-21 04:23 PM) hideki(2013-09-21 03:59 PM) kowego(2013-09-21 01:36 PM) donsenc(2013-09-21 12:43 PM) Doofenshmirtz(2013-09-21 10:41 AM) BO$$(2013-08-31 07:19 AM) lucky14(2013-08-29 04:31 AM) Georgegame(2013-08-23 09:23 PM) Illuminise(2013-08-22 06:30 AM) lisagosh(2013-08-21 07:06 PM) dziadek(2013-08-21 06:35 PM) Commoner(2013-08-21 03:17 PM) Quffs(2013-08-20 10:26 PM) Swizzy(2013-08-20 01:28 PM) Zrich(2013-08-20 05:35 AM) hopsa(2013-08-20 01:54 AM) T-Bag(2013-08-20 01:30 AM) boboMarley(2013-08-19 07:40 PM) Skouti(2013-08-19 06:44 PM) koolhunk(2013-08-19 05:56 PM) Seoinsection(2013-08-19 05:54 PM) Calisthenics(2013-08-19 04:28 PM) bongdem(2013-08-19 04:24 PM) d3wa(2013-08-19 02:56 PM) Mesina(2013-08-19 02:55 PM) Eion(2013-08-19 02:42 PM) d980xt(2013-08-19 02:41 PM) Toffyman(2013-08-19 02:22 PM) NYNF(2013-08-19 02:20 PM) 
Reply
2013-08-19, 02:41 PM,
#2
Great tut OP! You've just motivated me to work more! Thanks Again OP!
Latest Thanks - View all

caiolps(2015-02-17 09:42 AM) WDD2016(2014-12-28 08:48 PM) 
Reply
2013-08-19, 04:25 PM,
#3
thanks good man, nice tut
Reply
2013-08-19, 04:27 PM,
#4
Great tutorial for new and experienced, good job. Cool

Regards
LinX

PM ME TO JOIN OUR TRADING GROUP FOR FREE!
[Image: CyjquRg.png]
Reply
2013-08-20, 10:26 PM,
#5
Got many idea using this codes now. Thanks sir!
Reply
2013-08-21, 03:16 AM,
#6
Springfire how comes when i use the code you put in here and i compile i can't see the pictures?
Reply
2013-08-21, 04:06 AM,
#7
Thanks for the share! i will try now
Reply
2013-08-21, 08:53 AM,
#8
(2013-08-21, 03:16 AM)hopsa Wrote: Springfire how comes when i use the code you put in here and i compile i can't see the pictures?

Just to make sure, check that you have

1. Resources.au3 in the same folder as your-keygen.au3
2. Installed SciTE4AutoIt full install (It is NOT the SciTE which comes with AutoIT install, see link in the post)

If that does not help, PM your SciTE compile log to me

[Image: compile_log.png]
Reply
2013-08-21, 10:54 AM, (This post was last modified: 2013-08-21, 01:59 PM by Swizzy.)
#9
Nvm got I finally got it now. Thanks for the tutorial ;D
Reply
2013-09-21, 12:39 PM,
#10
(2013-08-21, 08:53 AM)Springfire Wrote:
(2013-08-21, 03:16 AM)hopsa Wrote: Springfire how comes when i use the code you put in here and i compile i can't see the pictures?

Just to make sure, check that you have

1. Resources.au3 in the same folder as your-keygen.au3
2. Installed SciTE4AutoIt full install (It is NOT the SciTE which comes with AutoIT install, see link in the post)

If that does not help, PM your SciTE compile log to me

[img]/tctaop673/compile_log.png[/img]

Can you explain more ? I install SciTE4AutoIt and Resources.au3 in the same folder as your-keygen.au3 but when I compile, file exe still not have image ?
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Email Marketing Guide - Delivery Optimization and Spam Trigger Circumvention (Part 1) lessleo14 1 53 Today, 04:05 AM
Last Post: ElitesHelper
  [VIP GUIDE] How To Make $99 Daily with Fresh News and Trends Ryan2kc 63 8,132 Yesterday, 09:43 AM
Last Post: notoriousCPA
  RIP Unlist Method - Alternative Methods (Tutorial) :) alexparris 56 6,380 2017-12-16, 10:22 PM
Last Post: tamnga
  [Tutorial] Extreme Keyword Research Method (NOOB FRIENDLY) Wopey 67 8,516 2017-12-15, 11:28 PM
Last Post: reshamanair
  Make $200 daily for a LIFETIME by Flipping Items Online Proster 9 731 2017-12-15, 05:31 PM
Last Post: ProBlackH34rt





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top