Jump to content

How to Bind an application to a single computer?


Recommended Posts

Hello. I have many products I have that I have made in autoit and I have already started to sell a few to friends. Well, these people have distributed my programs to other and some are even trying to sell my products...

I have already searched and researched this for a few days now but nothing is working. I need something simple I can add to the start of my script that will bind it to that computer.

From what I have read, I need something like this but have no idea how to get it to work. ( I am great with what I do in autoit but clueless about these things and just need a few simple lines of code)

Look for ini file, if it is there then skip this next step.. If not then do below code


$pass = 1234
$password = InputBox ( "Password", "What is the password?")

if $password = $pass then
bindtocomputer()
else
exit 0
EndIf

Func bindtocomputer() ; < This is where I need help...
Get Computer Name ; < how?
Create .dll with that computer name in it, set to hidden 
EndFunc

Func checkname() ; ran at start of script
$boundto = the name in .ini file
$computer = the current computers name

if $boundto = $computer then 
;nothing, run the script
else
exit 0
EndIf
EndFunc

Will somebody help me with this or simply give me the code that is not written.. It would be very helpful.. Because I will not be able to distribute this or make any $ until this simple task is done. Thank you very much!!!

Link to comment
Share on other sites

Well I am still learning how to use Autoit. But I was thinking and came up with this idea.

I used to do stuff like this with batch and C#. Haven't got my source code though sorry.

But the idea is to make a key in the registry of the computer.

Then have the program find that registry key. If it cannot find that key then simply terminate the process.

___________________________________________________________________________________________________________

If you want to put this piece of software onto other computers.

1st : have a way of generating random code and put a password on it. Then the software puts this code some where in

the registry.

#include <crypt.au3>
$data = Random(0,999999)
$crypted_data = _Crypt_EncryptData($data,"Some passord to encrypt with", $CALG_AES_256)
Then figure out a way to send $crypted_data into the registry.

2nd : Now there is a registry with the $crypted_data. All we need to do is retrieve that crypted_data and decrypt it.

#include <crypt.au3>
$data = "line/lines of code here that retrieves the value from the registry."
$decrypted_data = BinaryToString(_Crypt_DecryptData($data,"Some password to encrypt with",$CALG_AES_256))
SOME SCRIPT HERE: that will check if it was decrypted right with the right password.

Sorry I am not thinking too well at the moment. But hope this helps in any way and hope that some other members can make something out of what i have just said..

if you'd like to play around with encryption here is a tiny example if you don't understand anything about encryption.

#include <crypt.au3>
;DATA :
$data = "Dumpling"
;ENCRYPTING DATA :
$crypted_data = _Crypt_EncryptData($data,"1234", $CALG_AES_256)
MsgBox(0,"hi", $crypted_data)
;DECRYPTING DATA :
$decrypted_data = BinaryToString(_Crypt_DecryptData($crypted_data,"1234",$CALG_AES_256))
MsgBox(0,"hi", $decrypted_data)
Link to comment
Share on other sites

1) Put your name and email on somewhere, maybe a wintitle of gui, a splash screen etc...

2) Tell your friends to stop selling your script for their gain.

3) Stop selling stuff to your friends.

3) get new freinds.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

You can get the computers mac address this way:

Local $LTxt_MAC_Address = _GetMACaddress()

msgbox(0,"", $LTxt_MAC_Address)

Func _GetMACaddress()
    Local $ERR_NO_INFO = "Array contains no information"
    Local $ERR_NOT_OBJ = "$colItems isnt an object"
    Local $lArr_ComputerInfo = _GetNetworkInfo()

    If @error Then
        $error = @error
        $extended = @extended
        Switch $extended
            Case 1
                _ErrorMsg($ERR_NO_INFO)
            Case 2
                _ErrorMsg($ERR_NOT_OBJ)
        EndSwitch
    Else
        Return $lArr_ComputerInfo[1][10]
    EndIf
EndFunc   ;==>_GetMACaddress

Func _GetNetworkInfo()
    Local $wbemFlagForwardOnly = 0x20
    Local $wbemFlagReturnImmediately = 0x10

    Local $colItems, $objWMIService, $objItem
    Dim $NetworkInfoEx[1][13], $i = 1

    $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $NetworkInfoEx[UBound($NetworkInfoEx) + 1][13]
            $NetworkInfoEx[$i][0] = $objItem.Caption
            $NetworkInfoEx[$i][1] = $objItem.description
            $NetworkInfoEx[$i][2] = $objItem.IPAddress
            $NetworkInfoEx[$i][3] = $objItem.IPSubnet
            $NetworkInfoEx[$i][4] = $objItem.DefaultIPGateway
            $NetworkInfoEx[$i][5] = $objItem.DHCPEnabled
            $NetworkInfoEx[$i][6] = $objItem.DHCPServer
            $NetworkInfoEx[$i][7] = $objItem.DNSDomain
            $NetworkInfoEx[$i][8] = $objItem.DNSHostName
            $NetworkInfoEx[$i][9] = $objItem.DNSServerSearchOrder
            $NetworkInfoEx[$i][10] = $objItem.MACAddress
            $NetworkInfoEx[$i][11] = $objItem.WINSPrimaryServer
            $NetworkInfoEx[$i][12] = $objItem.WINSSecondaryServer
            $i += 1
        Next
        $NetworkInfoEx[0][0] = UBound($NetworkInfoEx) - 1
        If $NetworkInfoEx[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
    Return $NetworkInfoEx
EndFunc   ;==>_GetNetworkInfo

Func _ErrorMsg($message, $time = 0)
    MsgBox(48 + 262144, "Network Error", $message, $time)
EndFunc   ;==>_ErrorMsg

I think It will help you.

You can associate the MAC address with the account.

Link to comment
Share on other sites

I learned to strongly dislike online validation.

There is a game 'Swords and Sandals 2'. I decide the game is neat and I like, so I purchase it...

Along comes a couple of weeks were I don't have internet. I can play all of my roms, diablo 1 and 2, but not swords and sandals cause it has to make sure I purchased it with it's online database. This has happened about 6 times, and at this point I know there is no sense playing the game when i'm bored with no internet. Well that's crap, I can't play it on the bus either without roaming internets... wtf, the game wasn't even all that good, now it blows.

Not to mention i'm into making tools, and who wants to buy a hammer that doesn't work while it's raining? that's a gay hammer...

I wouldn't want to tie it to there computer name either, because as a computer technician I don't see any reason to have to keep my computer name the same. Don't wanna tie it to there MAC or other replaceable hw, if I can help it. But what I would do is tie it to their encrypted Windows key I mean the key is already encrypted (so we wouldn't have their install key if processed it on a server to give them a new encrypted key back to them, that would then decrypt on their machine and equal their original encrypted key.

FileEncryption.au3

by RazerM

My code used the include file above,

it's a rough draft, (it's always so much fun to pull an all nighter, but I need this too and wanted to see if I could do it)

removed, by songersoft.

I don't know how dedicated you'd have to be to crack this. and i'm sure it needs work, it's a dough draft... but if we could send their key to a server and only release one back to the user, telling them to record it by every means possible cause there is no getting another one. Then our server crosses off the receipt code. and only we have the decryption key, hmm wait the program would still know the decode key... idk

The other problem I see is Windows Volume Licences, I think they all have the same product id, idk

but these methods do provide a string unique to many systems.

(no offence was directed by myself at homosexuals, I have homosexual friends and relatives, they would agree with me about the hammer...)

Edited by songersoft
Link to comment
Share on other sites

I found this which seems easy to intigrate, allows you to generate and validate serial numbers.

if you wanted it to be full proof you would have to have some sort of online "verifation" of the key just when the program is installed. i'm not sure how easily it could be cracked.

it creates a "Rules" file that validates the serial number but you may be able to do an inital rules generation and then just intigrate the results into the scirpt itself?

otherwise you would have to encrypt the file and verify the md5 value of the file before you verify the key.

Link to comment
Share on other sites

Put your name on it, copywrite it if you must, and prosecute your friends.

not bad, I like it

Sorry, but I think the OP is flogging a dead horse.

maybe it'll get back up...

It wouldn't be the first horse to be resurrected, ever played Dungeon Siege?

Edited by songersoft
Link to comment
Share on other sites

I've used cheat engine, to find .dat when I listed the random file types in an array.

I found the type by hitting scan first twice then searching a text field for .dat

$extnamemax= 3
    dim $extname[$extnamemax]= [".dat", ".html", ".tmp"]; this code was easily sniffed, and we don't want that

the same search did not find the file type with the items stored the way they are now in the code. all ".dat" like.

The randomness farther makes it difficult to find the address of even the $program_unlocked value.

I've never used a decompiler, so I have very little idea of how easy the code wound be to read decompiled. Speaking of this however is forbidden. and i'll leave it up to the Mods to see if there is anywhere we can take this logic from here. At the very least i'll probably hear I'm pushing the lines and to stop it.

edit: by the way, the script in my post above pretty much works. you just have to have a key creation phase for each machine the script will run on and it will create a unique key that will only work on that machine. (or the machine that has the same Windows key installed on it)

and of course i'm hoping for some feed back to improve it.

edit: I retract this statement I made in error "the same search did not find the file type with the items stored the way they are now in the code. all ".dat" like.". It simply is not true, I found the data types and the encrypt key 'loki-ikol', but of course I knew what it was ahead of time it could be any string I think.

Edited by songersoft
Link to comment
Share on other sites

It wouldn't be the first horse to be resurrected, ever played Dungeon Siege?

OI im playing Dungeon Seige III at the minute

edit: by the way, the script in my post above pretty much works. you just have to have a key creation phase for each machine the script will run on and it will create a unique key that will only work on that machine. (or the machine that has the same Windows key installed on it)

and of course i'm hoping for some feed back to improve it.

Of course its possible to crack anything, this so far seems a viable method for a "simple" ish way and as such general purpose method of protection from people that dont know how to do advanced stuff, like decompiling etc

As we know you wont stop everyone and it has been discussed many times but..

Wouldn't a general purpose method be a worthwhile thing?, i would use it for any of my stuff that goes out into the web

The Valuator project seems a bit to complicated for a noob like me to grasp so why not have 2 levels something easy then the big stuff

btw Valuators is here

Chim

PS there was some discussion on unique ID here

and

and

and

and

and ive seen a few other discussion around

If @OSArch='x86' Then
    $reg='HKEY_LOCAL_MACHINE'
Else
    $reg='HKEY_LOCAL_MACHINE64'
EndIf
$UUID=RegRead($reg & '\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')
MsgBox(0,'Machine Guid','{' & $UUID & '}')
Edited by Chimaera
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...