help basic example, Autohotkey_H encrypt source code Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

help basic example, Autohotkey_H encrypt source code

Post by joekingcool » 26 Dec 2020, 20:56

im trying to hide source code for a certain exe i made for sale. i used impress and made it an exe, although that can be easily viewed. i then tried

Code: Select all

/*
;-------------------------------
  AHK Source Code Encryptor v3.1  By FeiYue

  1. This tool can encrypt the AHK script into a self decode script.

  2. Then you can use ahk2exe to compile the script into a program,
     combined with mpress.exe or upx.exe packers.
     Note: To compile the script, you must have a AutoHotkey.exe
     in the script directory.

  3. When you want to use the directory relative to the script(eg 001.jpg),
     Don't use A_ScriptDir, but use A_WorkingDir. It is recommended to backup
     the working directory to a variable at the beginning of the script,
     Then change the path to absolute path based on the variable (eg %dir%\001.jpg).

  4. When you want to Reload your own script, the built-in Reload command will fail,
     You can use Reload() function instead (it's added when encrypted).

;-------------------------------
*/

#NoEnv
#SingleInstance force
ListLines, Off
SetBatchLines, -1
Version = 3.1

fs=
(` %

; You can compile and set icons by using Ahk2Exe.exe.
; If AutoHotkey.exe wants to change its name to abc.exe,
; please modify Ahk=%A_ScriptDir%\abc.exe.

#NoEnv
#NoTrayIcon
#SingleInstance off
SetBatchLines, -1
Ahk=%A_ScriptDir%\AutoHotkey.exe
if (A_IsCompiled)
  FileInstall, AutoHotkey.exe, %Ahk%
Exec(s, Ahk)
ExitApp

Exec(str, Ahk="", args="") {
  static MyFunc, base
  Ptr:=(A_PtrSize ? "UPtr":"UInt"), AStr:=(A_IsUnicode ? "AStr":"Str")
  Ahk:=Ahk ? Ahk : A_ScriptDir "\AutoHotkey.exe"
  Ahk:=InStr(Ahk,"\\.\pipe\") ? A_AhkPath : Ahk
  IfNotExist, %Ahk%
  {
    MsgBox, 4096, Error!, `nCan't Find:`n`n%Ahk%`n`t
    return
  }
  if (!MyFunc)
  {
    x32:="5557565381EC9C0100008B9C24B80100008BAC24BC01000"
    . "08B433C01D88038500F85BF080000807801450F85B50800008"
    . "B4860BA8800000085C90F85820800008B3C10C744246400000"
    . "00001DF89F88B4F188B7F1C8B50208B40248944243031C085C"
    . "98D34137513E9430800008D760083C00139C10F84350800008"
    . "B1486813C134765745075E9817C1304726F634175DF8B74243"
    . "08D04430FB704308D04838B3C3885FF897C24640F840208000"
    . "08D842494000000BE6500000001DF6689B4249C000000891C2"
    . "4C784249400000057726974C78424980000006546696C89442"
    . "404FFD783EC088944243C8D8424A9000000891C24C78424A90"
    . "00000476C6F62C78424AD000000616C416CC78424B10000006"
    . "C6F630089442404FFD783EC0889442450B865650000891C246"
    . "6898424A60000008D84249E000000C784249E000000476C6F6"
    . "2C78424A2000000616C4672C68424A80000000089442404FFD"
    . "783EC088944244CB873410000891C2466898424D90000008D8"
    . "424CD000000C78424CD00000043726561C78424D1000000746"
    . "55072C78424D50000006F636573C68424DB000000008944240"
    . "4FFD783EC08894424548D8424FD000000891C24C78424FD000"
    . "00043726561C784240101000074654E61C78424050100006D6"
    . "56450C784240901000069706541C684240D010000008944240"
    . "4FFD783EC08894424408D84240E010000891C24C784240E010"
    . "000436F6E6EC78424120100006563744EC7842416010000616"
    . "D6564C784241A01000050697065C684241E010000008944240"
    . "4FFD783EC08894424588D8424B5000000891C24C78424B5000"
    . "000436C6F73C78424B90000006548616EC78424BD000000646"
    . "C650089442404FFD783EC08894424308D842434010000891C2"
    . "4C784243401000051756572C784243801000079506572C7842"
    . "43C010000666F726DC7842440010000616E6365C7842444010"
    . "000436F756EC78424480100007465720089442404FFD783EC0"
    . "88944245C8D442479891C24C74424796C737472C744247D636"
    . "17441C68424810000000089442404FFD783EC08894424388D8"
    . "42482000000891C24C78424820000006C737472C7842486000"
    . "0006C656E41C684248A0000000089442404FFD783EC0889442"
    . "4348D8424C1000000891C24C78424C100000043726561C7842"
    . "4C500000074654669C78424C90000006C65410089442404FFD"
    . "783EC0889C68D84248B000000891C24C784248B00000052656"
    . "164C784248F00000046696C65C68424930000000089442404F"
    . "FD783EC0889C78D4C2464C744241000000000C744240800000"
    . "000896C2404C7042400000000894C240CFF54243C83EC148B5"
    . "C246485DB895C24440F85510500008B9C24B0010000891C24F"
    . "F54243483EC043DE27F00000F8FA70500008B8424C00100008"
    . "D0485040000003DFF7F0000894424480F86BE0400008944246"
    . "489442404C7042400000000FF54245083EC0885C089C30F84A"
    . "00500008B8424B0010000C744241800000000C744241400000"
    . "000C744241003000000C744240C00000000C74424080300000"
    . "0C744240400000080890424FFD683EC1C83F8FF89C60F848C0"
    . "500008D442464C744241000000000C744240800040000895C2"
    . "4048934248944240CFFD783EC14893424FF5424308B433C83E"
    . "C0401D88038500F853C040000807801450F85320400008D442"
    . "470C784241F0100005C5C2E5CC784242301000070697065C78"
    . "424270100005C41484BC784242B01000031323334C784242F0"
    . "1000035363738C684243301000000890424FF54245C83EC048"
    . "B4424708DB4241F01000089342489442464FF54243483EC048"
    . "D14068D7C06F88B4C24648D76008DBC270000000089C883EA0"
    . "1C1E90483E00F83C041880239D775EC8B8424B0010000894C2"
    . "464B92022000066894C246DC744246922202F66C644246F00C"
    . "60322C643010089442404891C24FF54243883EC088D7C24698"
    . "91C24897C2404FF54243883EC0889742404891C24FF5424388"
    . "3EC08897C2404C644246B00891C24FF54243883EC08891C24F"
    . "F54243483EC0489C78B8C24B4010000890C24FF54243401C78"
    . "3EC0481FFFF7F00000F8E2A030000893424C744241C0000000"
    . "0C744241800000000C744241400000000C744241000000000C"
    . "744240CFF000000C744240800000000C744240402000000FF5"
    . "4244083EC2089C7893424C744241C00000000C744241800000"
    . "000C744241400000000C744241000000000C744240CFF00000"
    . "0C744240800000000C744240402000000FF54244083EC2083F"
    . "FFF89C60F846503000083F8FF0F845C0300008D8C244C01000"
    . "08D942490010000C74424644400000089C8908D742600C6000"
    . "083C00139D075F68D8424DC000000C784244C0100004400000"
    . "0894C2420C744241C00000000C74424180000000089442424C"
    . "744241400000000C744241000000000C744240C00000000C74"
    . "4240800000000895C2404C7042400000000FF54245483EC288"
    . "5C00F849B0200008B8424DC000000890424FF54243083EC048"
    . "B8424E0000000890424FF54243083EC048B9424C001000085D"
    . "274228B8C24C001000031C08B54850089148383C00139C175F"
    . "28B44244883E804894424448B442444C78424EC0000000B000"
    . "000BA0B000000C78424F00000000D000000C78424F40000001"
    . "1000000C78424F800000013000000C704030000000031C0EB0"
    . "F8D760089C283E2038B9494EC00000069D28300000089C183E"
    . "10301C283C00183F86489948CEC00000075D88B8424C001000"
    . "085C00F845D0100008B8C24C001000031D289D083E00369AC8"
    . "4EC0000008300000001D589AC84EC0000008B0493D1C029E8D"
    . "1C029E88944246489049383C20139D175CE8B6C2458893C24C"
    . "74424040000000089E8FFD083EC08893C248B7C243089F8FFD"
    . "083EC0489E8C744240400000000893424FFD083EC088B6C244"
    . "88D442464C744241000000000895C24048934248944240C896"
    . "C2408FF54243C83EC1489F8893424FFD08D542BFC83EC0489D"
    . "86690C7000000000083C00439C275F3891C24FF54244C83EC0"
    . "431C081C49C0100005B5E5F5DC214008D76008DBC270000000"
    . "0B8FEFFFFFF81C49C0100005B5E5F5DC214008378640119D28"
    . "3E21083C278E96DF7FFFFC744246400800000B800800000E93"
    . "4FBFFFF81C49C010000B8FFFFFFFF5B5E5F5DC21400891C24F"
    . "F54244C83EC04B8F9FFFFFF81C49C0100005B5E5F5DC214008"
    . "B8424B4010000891C2489442404FF54243883EC08E9BCFCFFF"
    . "FB8FDFFFFFFEB818B6C2458893C24C74424040000000089E8F"
    . "FD083EC08893C248B7C243089F8FFD083EC0489E8C74424040"
    . "0000000893424FFD083EC088D442464C744241000000000895"
    . "C24048934248944240C8B44244889442408FF54243C83EC148"
    . "9F8893424FFD083EC04E9EEFEFFFFB8FCFFFFFFE90CFFFFFF8"
    . "93C248B7C243089F8FFD083EC0489F8893424FFD083EC04891"
    . "C24FF54244CB8F7FFFFFF83EC04E9E0FEFFFFB8FBFFFFFFE9D"
    . "6FEFFFF893C248B7C243089F8FFD083EC0489F8893424FFD08"
    . "3EC04891C24FF54244CB8F8FFFFFF83EC04E9AAFEFFFF891C2"
    . "4FF54244CB8FAFFFFFF83EC04E996FEFFFF90"
    x64:="4157415641554154555756534881EC78020000B8FFFFFFF"
    . "F8B9C24E002000048899424C8020000418B503C4D89C448898"
    . "C24C00200004C89CE4C01C2803A500F85A6070000807A01450"
    . "F859C070000448B5260B8880000004585D20F85A60700008B0"
    . "402C784249C000000000000004C01E08B48188B5020448B481"
    . "C448B502431C085C94D8D04147512E971070000904883C0013"
    . "9C10F8664070000418B148041813C144765745075E641817C1"
    . "404726F634175DB498D0444420FB70410498D0484428B2C088"
    . "5ED89AC249C0000000F842B07000048B8577269746546696CB"
    . "A6500000048BF476C6F62616C416C4C01E566899424F800000"
    . "04C89E1488D9424F000000048898424F0000000FFD54889BC2"
    . "41001000048BF476C6F62616C4672488D9424100100004C89E"
    . "14889442460C78424180100006C6F6300FFD54889BC2400010"
    . "000B96565000048BF437265617465507266898C24080100004"
    . "88D9424000100004C89E14989C7C684240A01000000FFD541B"
    . "8734100004889BC244001000048BF4372656174654E6166448"
    . "984244C010000488D9424400100004C89E14889442470C7842"
    . "4480100006F636573C684244E01000000FFD54889BC2460010"
    . "00048BF6D65645069706541488D9424600100004889BC24680"
    . "1000048BF436F6E6E6563744E4C89E14889442478C68424700"
    . "1000000FFD54889BC248001000048BF616D656450697065488"
    . "D9424800100004889BC248801000048BF436C6F736548616E4"
    . "C89E14889442468C684249001000000FFD54889BC242001000"
    . "0488D9424200100004C89E14889842488000000C7842428010"
    . "000646C6500FFD548B95175657279506572488D9424C001000"
    . "04889C748898C24C001000048B9666F726D616E636548898C2"
    . "4C801000048B9436F756E7465720048898C24D00100004C89E"
    . "1FFD548B96C73747263617441488D9424C0000000488984248"
    . "000000048898C24C0000000C68424C8000000004C89E1FFD54"
    . "8B96C7374726C656E41488D9424D0000000488944245848898"
    . "C24D0000000C68424D8000000004C89E1FFD548B9437265617"
    . "4654669488D942430010000488944245048898C2430010000C"
    . "78424380100006C6541004C89E1FFD548B95265616446696C6"
    . "5488D9424E00000004989C648898C24E0000000C68424E8000"
    . "000004C89E1FFD5488DAC249C0000004531C031C94989C548C"
    . "7442420000000004889F24989E94C8B5C246041FFD3448B8C2"
    . "49C000000B8FDFFFFFF4585C90F8556040000488B8C24C0020"
    . "000488B442450FFD03DE27F00000F8FED040000448D249D040"
    . "000004181FCFF7F00000F86560400004489A4249C000000448"
    . "9E231C941FFD74885C04989C70F84E40400004531C948C7442"
    . "43000000000C744242800000000C74424200300000041B8030"
    . "00000BA00000080488B8C24C002000041FFD64883F8FF4989C"
    . "60F84CD0400004989E941B8000400004C89FA4889C148C7442"
    . "4200000000041FFD54C89F1FFD7418B473C4C01F88038500F8"
    . "5E0030000807801450F85D603000048B85C5C2E5C706970654"
    . "88D8C24B0000000C78424B00100003536373848898424A0010"
    . "00048B85C41484B31323334C68424B40100000048898424A80"
    . "10000488B8424800000004C8DAC24A0010000FFD08B8424B00"
    . "000004C89E98984249C000000488B442450FFD08B8C249C000"
    . "0008D50FF448D48F789C84189D083EA0183E00FC1E90483C04"
    . "14439CA42888404A001000075E24C8DB424A0000000B820220"
    . "000898C249C00000066898424A4000000C78424A0000000222"
    . "02F664C89F9C68424A600000000488B9424C002000041C6072"
    . "241C6470100488B442458FFD04C89F24C89F9488B442458FFD"
    . "04C89EA4C89F9488B442458FFD04C89F24C89F9C68424A2000"
    . "00000488B442458FFD04C89F9488B442450FFD04189C6488B8"
    . "C24C8020000488B442450FFD04101C64181FEFF7F00000F8EA"
    . "D0200004531C04C89E941B9FF000000BA0200000048C744243"
    . "800000000C744243000000000C744242800000000C74424200"
    . "0000000488B442468FFD04989C64531C04C89E948C74424380"
    . "0000000C74424300000000041B9FF000000C74424280000000"
    . "0C744242000000000BA02000000488B442468FFD04983FEFF4"
    . "989C50F84B90200004883F8FF0F84AF020000488D8C2400020"
    . "000C784249C00000068000000488D51684889C80F1F8000000"
    . "000C600004883C0014839D075F4488D8424E001000048894C2"
    . "4404531C94531C031C9C784240002000068000000488944244"
    . "848C7442438000000004C89FA48C744243000000000C744242"
    . "800000000C744242000000000488B442478FFD085C00F84010"
    . "20000488B8C24E0010000FFD7488B8C24E8010000FFD731C08"
    . "5DB7416908B1486418914874883C00139C377F189D848C1E00"
    . "241C7040700000000C78424500100000B000000BA0B000000C"
    . "78424540100000D000000C78424580100001100000031C0C78"
    . "4245C01000013000000EB0C89C283E2038B94945001000069D"
    . "28300000089C183E10301C283C00183F86489948C500100007"
    . "5D831D285DB0F84130100004889D083E003698C84500100008"
    . "300000001D1898C8450010000418B0497D1C029C8D1C029C88"
    . "984249C000000418904974883C20139D377C7488BB42488000"
    . "00031D24C89F14889F0FFD04C89F1FFD731D24C89E94889F0F"
    . "FD04C89FA4989E94589E04C89E948C744242000000000488B4"
    . "42460FFD04C89E9FFD78D53FF4C89F8498D549704660F1F440"
    . "000C700000000004883C0044839C275F14C89F9488B442470F"
    . "FD031C04881C4780200005B5E5F5D415C415D415E415FC390B"
    . "8FEFFFFFFEBE4837A64014819C083E0104883C078E947F8FFF"
    . "FC784249C00000000800000BA00800000E9A0FBFFFF4C89F94"
    . "88B442470FFD0B8F9FFFFFFEBAB488B9424C80200004C89F94"
    . "88B442458FFD0E93CFDFFFF488BB424880000004C89F14889F"
    . "0FFD04C89F1FFD731D24C89E94889F0FFD04C89E948C744242"
    . "0000000004989E94589E04C89FA488B442460FFD04C89E9FFD"
    . "7E943FFFFFFB8FCFFFFFFE945FFFFFF4C89F1FFD74C89E9FFD"
    . "74C89F9488B442470FFD0B8F7FFFFFFE927FFFFFFB8FBFFFFF"
    . "FE91DFFFFFF4C89F1FFD74C89E9FFD74C89F9488B442470FFD"
    . "0B8F8FFFFFFE9FFFEFFFF4C89F9488B442470FFD0B8FAFFFFF"
    . "FE9EBFEFFFF"
    MCode(MyFunc, A_PtrSize=8 ? x64:x32)
    base:=DllCall("GetModuleHandle", "Str","Kernel32", Ptr)
    IfExist, %A_ScriptFullPath%
      EnvSet, My_ScriptFullPath, %A_ScriptFullPath%
  }
  GetArgs(args)
  s:=RegExReplace(str,"\s"), RegExReplace(s,"u","",size)
  VarSetCapacity(str,(size+1)*4,0), s:=SubStr(s,InStr(s,"u")+1)
  ListLines, % (lls:=A_ListLines=0 ? "Off":"On") ? "Off":"Off"
  Loop, Parse, s, u
    NumPut(A_LoopField, str, (A_Index-1)*4, "uint")
  ListLines, %lls%
  hThread:=DllCall("CreateThread", Ptr,0, Ptr,0, Ptr
    , RegisterCallback("Thread","F"), Ptr,0, "uint",0, Ptr,0)
  DllCall(&MyFunc,AStr,Ahk,AStr,args,Ptr,base,Ptr,&str,"int",size)
  if (hThread)
  {
    DllCall("TerminateThread", Ptr,hThread, Ptr,0)
    DllCall("CloseHandle", Ptr,hThread)
  }
}

MCode(ByRef code, hex) {
  ListLines, % (lls:=A_ListLines=0 ? "Off":"On") ? "Off":"Off"
  SetBatchLines, % (bch:=A_BatchLines) ? "-1":"-1"
  VarSetCapacity(code, len:=StrLen(hex)//2)
  Loop, % len
    NumPut("0x" SubStr(hex,2*A_Index-1,2),code,A_Index-1,"uchar")
  Ptr:=A_PtrSize ? "UPtr" : "UInt"
  DllCall("VirtualProtect",Ptr,&code,Ptr,len,"uint",0x40,Ptr "*",0)
  SetBatchLines, %bch%
  ListLines, %lls%
}

GetArgs(ByRef args) {
  global
  Loop, %0%
    args.=" """ (%A_Index%) """"
}

Thread(p) {
  SetBatchLines, -1
  DllCall("Sleep", "int",3000)
  ExitApp
}

)

if 0>0
{
  file:=%True%
  IfExist, %file%
    Gosub, Encrypt
  ExitApp
}
Gui, +AlwaysOnTop
Gui, Color, DDEEFF
Gui, Font, cRed s28
Gui, Add, Text,, Drag the AHK script here to Encrypt`n`n
Gui, Show,, AHK Source Code Encryptor v%Version%  -  By FeiYue
OnMessage(0x201, "LButton_Down")
LButton_Down() {
  SendMessage, 0xA1, 2
}
return

GuiClose:
ExitApp

GuiDropFiles:
Gui, +OwnDialogs
Loop, parse, A_GuiEvent, `n
{
  file:=A_LoopField
  MsgBox, 4100, Tip, Do you want to encrypt this file ?`n`n%file%
  IfMsgBox, Yes
  {
    Gosub, Encrypt
    MsgBox, 4096, Tip, Encryption is completed !
  }
}
return

Encrypt:
SplitPath, file,, dir
IfNotExist, % Ahk:=dir "\AutoHotkey.exe"
{
  MsgBox, 4096, Error!, `nCan't Find:`n`n%Ahk%`n`t
  Exit
}
FileRead, s, %file%
s:=RegExReplace(Encode(s), ".{1,60}", "s.=""$0""`n")
s:=RegExReplace(fs,"i)Exec\([^\n]+\s+ExitApp","`ns=`n" s "`n$0")
f:=RegExReplace(file,"\.[^.]+$") . "-encoded.ahk"
FileDelete, %f%
FileAppend, %s%, %f%
s:=""
return

Encode(s) {
  static MyFunc
  Ptr:=A_PtrSize ? "UPtr" : "UInt"
  if (!MyFunc)
  {
    x32:="5756BA0B0000005331C083EC108B5C24208B742424C7042"
    . "40B000000C74424040D000000C744240811000000C744240C1"
    . "3000000EB128D76008DBC270000000089C283E2038B149469D"
    . "28300000089C183E10301C283C00183F86489148C75E031D28"
    . "5F674318D76008DBC270000000089D783E7036904BC8300000"
    . "08D0C108B0493890CBC01C8D1C801C8D1C889049383C20139D"
    . "675D983C41031C05B5E5FC3"
    x64:="4883EC1841B80B00000031C0C704240B000000C74424040"
    . "D000000C744240811000000C744240C13000000EB0E0F1F004"
    . "189C04183E003468B04844569C0830000004189C14183E1034"
    . "101C083C00183F8644689048C75D84531C085D27433904D89C"
    . "24183E2034269049483000000468D0C00428B048146890C944"
    . "401C8D1C84401C8D1C8428904814983C0014439C277CE31C04"
    . "883C418C390909090909090"
    MCode(MyFunc, A_PtrSize=8 ? x64:x32)
  }
  add=
  (` %
;-----------------------
ListLines, Off
OnlyOne()
OnlyOne(flag="") {
  if (flag="")
  {
    EnvGet, file, My_ScriptFullPath
    if RegExMatch(file, "i)\.(exe|com|scr|bat|cmd)\s*$")
      Menu, Tray, Icon, %file%
    SetWorkingDir, % RegExReplace(file, "\\[^\\]*$")
    flag:=file
  }
  DetectHiddenWindows, % (dhw:=A_DetectHiddenWindows) ? "On":"On"
  hash:=0, Ptr:=(A_PtrSize ? "UPtr":"UInt")
  Loop, Parse, flag
    hash:=(hash*31+Asc(A_LoopField))&0xFFFFFFFF
  Name:="Ahk_OnlyOne_" hash
  While Mutex:=DllCall("OpenMutex","int",0x100000,"int",0,"str",Name)
  {
    DllCall("CloseHandle", Ptr,Mutex)
    While WinExist("<<" flag ">> ahk_class AutoHotkey")
    {
      WinGet, pid, PID
      WinClose,,, 3
      IfWinExist
      {
        Process, Close, %pid%
        Process, WaitClose, %pid%, 3
      }
    }
  }
  DllCall("CreateMutex", Ptr,0, "int",0, "str",Name)
  IfEqual, A_LastError, 0xB7, ExitApp
  pid:=DllCall("GetCurrentProcessId")
  WinSetTitle, ahk_pid %pid% ahk_class AutoHotkey,, <<%flag%>>
  DetectHiddenWindows, %dhw%
}
Reload(args="") {
  global
  Loop, %0%
    args.=" """ (%A_Index%) """"
  local file
  EnvGet, file, My_ScriptFullPath
  if (file="")
    return
  if RegExMatch(file, "i)\.(exe|com|scr|bat|cmd)\s*$")
    Run, "%file%" /f %args%,, UseErrorLevel
  else
    Run, "%A_AhkPath%" /f "%file%" %args%,, UseErrorLevel
  ExitApp
}
ListLines, On
;-----------------------
  )
  s:="`n" add "`n" s "`nExitApp`n#SingleInstance off`n"
  ;  . togetcode(s)
  s:=(A_IsUnicode ? chr(0xfeff) : chr(0xEF) chr(0xBB) chr(0xBF))
    . RegExReplace(s,"\R","`r`n") . "`t`t`t"
  size:=VarSetCapacity(s,-1)//4
  VarSetCapacity(str, size*11*(!!A_IsUnicode+1))
  DllCall(&MyFunc, Ptr,&s, "int",size, "Cdecl")
  Loop, % size
    str.="u" . NumGet(s,(A_Index-1)*4,"uint")
  return str
}

; If you need to read the script itself, you need it
togetcode(s) {
  s:=RegExReplace(s,"\R","`n")
  StringReplace, s, s, #, #0, 1
  r:="`n"";``"
  Loop, Parse, r
    StringReplace, s, s, %A_LoopField%, #%A_Index%, 1
  s:="`ngetcode(k) {`nListLines, Off`n"
    . "IfNotEqual,k,[email protected],return`ns=`n"
    . RegExReplace(s,".{1,60}","s.=""$0""`n")
    . "r:=""``n"""";````""`n"
    . "Loop, Parse, r`n"
    . "  StringReplace, s, s, #%A_Index%, %A_LoopField%, 1`n"
    . "StringReplace, s, s, #0, #, 1`n"
    . "return s`n}`n"
  return s
}

MCode(ByRef code, hex) {
  ListLines, % (lls:=A_ListLines=0 ? "Off":"On") ? "Off":"Off"
  SetBatchLines, % (bch:=A_BatchLines) ? "-1":"-1"
  VarSetCapacity(code, len:=StrLen(hex)//2)
  Loop, % len
    NumPut("0x" SubStr(hex,2*A_Index-1,2),code,A_Index-1,"uchar")
  Ptr:=A_PtrSize ? "UPtr" : "UInt"
  DllCall("VirtualProtect",Ptr,&code,Ptr,len,"uint",0x40,Ptr "*",0)
  SetBatchLines, %bch%
  ListLines, %lls%
}

;======== The End ========

;

/******** The C source code ********

#include <windows.h>

typedef HANDLE (WINAPI * _GetProcAddress)(
  HMODULE hModule,
  LPCSTR  lpProcName
);

typedef BOOL (WINAPI * _WriteFile)(
  HANDLE       hFile,
  LPCVOID      lpBuffer,
  DWORD        nNumberOfBytesToWrite,
  LPDWORD      lpNumberOfBytesWritten,
  LPOVERLAPPED lpOverlapped
);

typedef HGLOBAL (WINAPI * _GlobalAlloc)(
  UINT   uFlags,
  SIZE_T dwBytes
);

typedef HGLOBAL (WINAPI * _GlobalFree)(
  HGLOBAL hMem
);

typedef BOOL (WINAPI * _CreateProcessA)(
  LPCSTR                lpApplicationName,
  LPSTR                 lpCommandLine,
  LPSECURITY_ATTRIBUTES lpProcessAttributes,
  LPSECURITY_ATTRIBUTES lpThreadAttributes,
  BOOL                  bInheritHandles,
  DWORD                 dwCreationFlags,
  LPVOID                lpEnvironment,
  LPCSTR                lpCurrentDirectory,
  LPSTARTUPINFOA        lpStartupInfo,
  LPPROCESS_INFORMATION lpProcessInformation
);

typedef HANDLE (WINAPI * _CreateNamedPipeA)(
  LPCSTR                lpName,
  DWORD                 dwOpenMode,
  DWORD                 dwPipeMode,
  DWORD                 nMaxInstances,
  DWORD                 nOutBufferSize,
  DWORD                 nInBufferSize,
  DWORD                 nDefaultTimeOut,
  LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

typedef BOOL (WINAPI * _ConnectNamedPipe)(
  HANDLE       hNamedPipe,
  LPOVERLAPPED lpOverlapped
);

typedef BOOL (WINAPI * _CloseHandle)(
  HANDLE hObject
);

typedef BOOL (WINAPI * _QueryPerformanceCounter)(
  LARGE_INTEGER *lpPerformanceCount
);

typedef LPSTR (WINAPI * _lstrcatA)(
  LPSTR  lpString1,
  LPCSTR lpString2
);

typedef int (WINAPI * _lstrlenA)(
  LPCSTR lpString
);

typedef HANDLE (WINAPI * _CreateFileA)(
  LPCSTR                lpFileName,
  DWORD                 dwDesiredAccess,
  DWORD                 dwShareMode,
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  DWORD                 dwCreationDisposition,
  DWORD                 dwFlagsAndAttributes,
  HANDLE                hTemplateFile
);

typedef BOOL (WINAPI * _ReadFile)(
  HANDLE       hFile,
  LPVOID       lpBuffer,
  DWORD        nNumberOfBytesToRead,
  LPDWORD      lpNumberOfBytesRead,
  LPOVERLAPPED lpOverlapped
);

int WINAPI DecodeAndRun(
  LPCSTR ahk_path, LPCSTR args,
  HMODULE hMod, LPDWORD str, DWORD size )
{
  DWORD i, j, k, name_num;
  PUCHAR base, addr;
  LPDWORD Addr_func, Addr_name, hMen;
  PUSHORT Addr_ord;
  HANDLE p1, p2;
  //-----------------------------
  base = (PUCHAR)hMod;
  addr = base+(*(LPDWORD)(base+0x3C));
  if (addr[0] != 'P' || addr[1] != 'E')
    return -1;
  if ((*(LPDWORD)(addr+0x60))==0||(*(LPDWORD)(addr+0x64))==0)
    k=0x88;
  else
    k=0x78;
  addr = base+(*(LPDWORD)(addr+k));
  name_num  = *(LPDWORD)(addr+0x18);
  Addr_func = (LPDWORD)(base+(*(LPDWORD)(addr+0x1C)));
  Addr_name = (LPDWORD)(base+(*(LPDWORD)(addr+0x20)));
  Addr_ord  = (PUSHORT)(base+(*(LPDWORD)(addr+0x24)));
  char str0[] = "GetProcAddress";
  for (i=0, k=0; i<name_num; i++)
  {
    j=Addr_name[i];
    if ( (*(LPDWORD)(base+j)) == (*(LPDWORD)(str0))
    && (*(LPDWORD)(base+j+4)) == (*(LPDWORD)(str0+4)) )
    {
      k=Addr_func[Addr_ord[i]];
      break;
    }
  }
  if (k==0)
    return -2;
  //-----------------------------
  _GetProcAddress GetProcAddress = (_GetProcAddress)(base+k);

  char str1[] = "WriteFile";
  _WriteFile WriteFile = (_WriteFile)GetProcAddress(hMod,str1);

  char str2[] = "GlobalAlloc";
  _GlobalAlloc GlobalAlloc = (_GlobalAlloc)GetProcAddress(hMod,str2);

  char str3[] = "GlobalFree";
  _GlobalFree GlobalFree = (_GlobalFree)GetProcAddress(hMod,str3);

  char str4[] = "CreateProcessA";
  _CreateProcessA CreateProcessA = (_CreateProcessA)GetProcAddress(hMod,str4);

  char str5[] = "CreateNamedPipeA";
  _CreateNamedPipeA CreateNamedPipeA = (_CreateNamedPipeA)GetProcAddress(hMod,str5);

  char str6[] = "ConnectNamedPipe";
  _ConnectNamedPipe ConnectNamedPipe = (_ConnectNamedPipe)GetProcAddress(hMod,str6);

  char str7[] = "CloseHandle";
  _CloseHandle CloseHandle = (_CloseHandle)GetProcAddress(hMod,str7);

  char str8[] = "QueryPerformanceCounter";
  _QueryPerformanceCounter QueryPerformanceCounter = (_QueryPerformanceCounter)GetProcAddress(hMod,str8);

  char str9[] = "lstrcatA";
  _lstrcatA lstrcatA = (_lstrcatA)GetProcAddress(hMod,str9);

  char str10[] = "lstrlenA";
  _lstrlenA lstrlenA = (_lstrlenA)GetProcAddress(hMod,str10);

  char str11[] = "CreateFileA";
  _CreateFileA CreateFileA = (_CreateFileA)GetProcAddress(hMod,str11);

  char str12[] = "ReadFile";
  _ReadFile ReadFile = (_ReadFile)GetProcAddress(hMod,str12);

  //-----------------------------
  WriteFile(0, str, 0, &k, 0);
  if (k!=0)
    return -3;
  if (lstrlenA(ahk_path)>32768-30)
    return -4;
  k=(size+1)*4; if (k<32768) k=32768;
  hMen=(LPDWORD)GlobalAlloc(0, k);
  if (hMen==0)
    return -5;
  p1=CreateFileA(ahk_path, 0x80000000, 3, 0, 3, 0, 0);
  if ((HANDLE)-1 == p1)
  {
    GlobalFree(hMen);
    return -6;
  }
  ReadFile(p1, hMen, 1024, &k, 0);
  CloseHandle(p1);
  base = (PUCHAR)hMen;
  addr = base+(*(LPDWORD)(base+0x3C));
  if (addr[0] != 'P' || addr[1] != 'E')
  {
    GlobalFree(hMen);
    return -7;
  }
  //-----------------------------
  char pipe_name[] = "\\\\.\\pipe\\AHK12345678";
  LARGE_INTEGER count;
  QueryPerformanceCounter(&count);
  k=count.LowPart; j=lstrlenA(pipe_name);
  for (i=1; i<=8; i++, k>>=4)
    pipe_name[j-i]=(k&0xF)+'A';
  //-----------------------------
  LPSTR cmdline=(LPSTR)hMen;
  char t1[]="\" /f \"";
  cmdline[0]='\"'; cmdline[1]=0;
  lstrcatA(cmdline, ahk_path);
  lstrcatA(cmdline, t1);
  lstrcatA(cmdline, pipe_name); t1[2]=0;
  lstrcatA(cmdline, t1);
  if (lstrlenA(cmdline)+lstrlenA(args)<32768)
    lstrcatA(cmdline, args);
  //-----------------------------
  p1=CreateNamedPipeA(pipe_name, 2, 0, 255, 0, 0, 0, 0);
  p2=CreateNamedPipeA(pipe_name, 2, 0, 255, 0, 0, 0, 0);
  if ((HANDLE)-1 == p1 || (HANDLE)-1 == p2)
  {
    CloseHandle(p1);
    CloseHandle(p2);
    GlobalFree(hMen);
    return -8;
  }
  STARTUPINFOA si;
  PROCESS_INFORMATION pi;
  k=sizeof(STARTUPINFOA); addr=(PUCHAR)&si;
  for (i=0; i<k; i++)
    addr[i]=0;
  si.cb=k;
  if (!CreateProcessA(0, cmdline, 0,0,0, 0,0,0, &si, &pi))
  {
    CloseHandle(p1);
    CloseHandle(p2);
    GlobalFree(hMen);
    return -9;
  }
  CloseHandle(pi.hProcess);
  CloseHandle(pi.hThread);
  for (i=0; i<size; i++)
    hMen[i]=str[i];
  hMen[i]=0;
  //-----------------------------
  // Copy the contents of Decode()
  //-----------------------------
  // My private encryption algorithm is not published here.
  // You can write your own encryption algorithm. Such as:
  for (int i=0; i<size; i++)
    hMen[i] = (hMen[i] ^ i) - 666;
  //-----------------------------
  ConnectNamedPipe(p1, 0);
  CloseHandle(p1);
  ConnectNamedPipe(p2, 0);
  WriteFile(p2, hMen, (size+1)*4, &k, 0);
  CloseHandle(p2);
  for (i=0; i<size; i++)
    hMen[i]=0;
  GlobalFree(hMen);
  return 0;
}

//******** Encode() ********

int Encode(unsigned int * hMen, int size)
{
  // My private encryption algorithm is not published here.
  // You can write your own encryption algorithm. Such as:
  for (int i=0; i<size; i++)
    hMen[i] = (hMen[i] + 666) ^ i;
}

//******** Decode() ********

int Decode(unsigned int * hMen, int size)
{
  // My private encryption algorithm is not published here.
  // You can write your own encryption algorithm. Such as:
  for (int i=0; i<size; i++)
    hMen[i] = (hMen[i] ^ i) - 666;
}

*/

but im a little concerned with not knowing whats in the machice code portition. and also im not exactly sure how to decode the script. i understand if someone shows the method then the encryption is broke, but only for that one example. i assume if they show there code there will be some sort of unique key, that can be changed. i realize in his example there is a unique key that can be changed to decode our source. but there needs to be some unique key of sorts in the machine code of his source code that can be changed . although his script does a fantastic job! just want to know all the code thats going to be put in my script, for security of those i give it too.

ive also seen some topics on autohotkey_h to encrypt source code using visal studio. although the tutorials are hard to follow.


some links to posts i keep coming back too and trying to decifer.


https://www.autohotkey.com/boards/viewtopic.php?t=62308

https://www.autohotkey.com/boards/viewtopic.php?f=76&t=72986&hilit=autohotkey_h+encrypt

https://www.autohotkey.com/boards/viewtopic.php?f=76&t=82378&hilit=AutoHotkey_H+encrypt

https://translate.google.com/translate?sl=auto&tl=en&u=https://www.autohotkey.com/boards/viewtopic.php?t%3D18405



i would be interested in a simple example of a ahk script just showing (msbox hello) with encrypted source code. im sure if this can be dont simply in autohotkey_H or if the author above would reveal how they designed there script simply. but as long as the method is straight forward, i dont care how long it takes to setup the process to do so. and based on the amount of questions on this topic in the forums i belief this would help the community greatly.

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: help basic example, Autohotkey_H encrypt source code  Topic is solved

Post by joekingcool » 27 Dec 2020, 02:21

My results ....


autohotkey_h hides code from resourcehacker, also shows less false positives on virustotal by choosing the x64w_mt setting. it also has the ability to set password for the code as well, although i dont know how to check that since resourchacker couldnt view it.

mpress.exe by its self does also hide code from resourcehacker but shows slightly more false positives on virus total. since it dont have the password ability i assume the right person could easly unpack the the exe and then view code.

AHK Source Code Encryptor v3.1 By FeiYue, great program, easy to use, hides code from resourcehacker, although much more false positives on virus total. also there is unknown code added to your source code.

its to bad autohotkey its self didnt have a built in feature to password protect the finial compiled scripts code.

ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: help basic example, Autohotkey_H encrypt source code

Post by ananthuthilakan » 27 Dec 2020, 02:52

hey i have gone through what you are searching for a couple of months back and succeeded with a better solution.

when compiled with ahk_h

Autohotkey_h will encrypt your script and then compress into a special zip and put it into an exe.

Now when executing exe , it will uncompress the zip automatically to read the script using the password that you set when you created your own version of ahk_h , which no one can guess ( this is what happens behind the scene -- over simplified explanation ).

So basically No other person can read your source with out this password.

already available decompilers in the ahk will fail to decompile if you compile with ahk_h

i wouldnt recommend mpress or upx as it will cause some issues with antivirus. mpress is more problamatic with antivirus.


So what i basically did was [ has some additional info if you want to go down this route ]

created a licensing system that will be unique to each PC

then created a server authentication with another automatic api key.

then compiled with ahk_h with own password.

So Now if a person purchase script from my platform , he will automatically receive an api key.

when he start the script it will prompt a registration.

once he enter this api key it will authenticate with server and then registration will succeed and then a unique pc key generate inside his PC.

So next time he start the script it will verify the unique pc key first, then it will authenticate with server.

This will help in protecting from copying from one system to other. even if he copy the key file along with the script it wont authenticate and delete the key file.

You can try implementing this .
if you need further help you can pm me

thank you
Last edited by ananthuthilakan on 27 Dec 2020, 06:01, edited 1 time in total.

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: help basic example, Autohotkey_H encrypt source code

Post by SOTE » 27 Dec 2020, 05:05

joekingcool wrote:
26 Dec 2020, 20:56
but im a little concerned with not knowing whats in the machice code portition. and also im not exactly sure how to decode the script.

Code: Select all

/******** The C source code ********
It would probably better to post a question on FeiYue's thread, if the question is specific to his Encryptor and there is a lot of examples. Also, if you read the bottom of FeiYue's script, he provides his C source code, just not the exact encryption method because that clearly has to be kept secret. If you don't trust his machine code, then you can find a C encryption function and turn it into machine code, that is read by the MCode function. To do those parts, you might want to learn a bit of C programming and then study the MCode tutorials.

Possible suggestion learning:

https://www.tutorialspoint.com/cprogramming/index.htm
(C Tutorial)

Note- The below YouTube C programming encryption algorithms are simplistic and good for learning.

https://youtu.be/8Aiy1q1SsqA
(how to encrypt text file using C language program)
(also includes source code example, but make sure to scan that or any .rar file with Anti-Virus)

https://youtu.be/5ufUhxFF5wE
(C Program to Encrypt and Decrypt A File)
(also includes source code examples)

https://www.autohotkey.com/boards/viewtopic.php?t=32
(MCode Tutorial)

https://www.autohotkey.com/boards/viewtopic.php?f=6&t=4642
(MCode4GCC -- C/C++ to MCode Generator)

https://www.autohotkey.com/boards/viewtopic.php?t=18405
(FeiYue made his own MCode Generator, that people might want to check out)

https://www.autohotkey.com/boards/viewtopic.php?t=73099
(Online MCode Generator(Beta, Tool))

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: help basic example, Autohotkey_H encrypt source code

Post by SOTE » 27 Dec 2020, 05:23

joekingcool wrote:
27 Dec 2020, 02:21
its to bad autohotkey its self didnt have a built in feature to password protect the finial compiled scripts code.
Arguably, Lexikos's decision to not include any type of encryption was a good one. AutoHotkey has to deal with plenty of false-positives and stigmas as it is. The primary point of compiling (binding the script to the interpreter) into an executable was for sharing. The other person doesn't need AutoHotkey installed. In addition, allowing the source code to be easily recoverable and seen is helpful for many people, businesses, and IT. Various people encrypt their program, forget the password, then start whining about they can't recover it. In a business or work situation, it can be not a good thing when somebody makes a useful script that people rely on, but it's encrypted or obfuscated. If they leave the job or something unexpected happens to their health, nobody can access the source nor can be sure exactly what was in it. However, the opposite can be true, where a business needs the source code protected by encryption or obfuscation.

It's debatably better that any type of encryption or obfuscation is on the AHK user, business, or using a script/fork that allows for such a feature. The situation of AHK_L no encryption/obfuscation by default, AHK_L Encryptor script by FeiYue, and AHK_H is a good one. People have choices.

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: help basic example, Autohotkey_H encrypt source code

Post by joekingcool » 27 Dec 2020, 13:52

i agree ahk gets a bad rap from the av's. and it makes no sense why a person cant encrypt there code. since the other languages do that to a certain degree. just because its more user friendly for people to get started programming, it shouldn't be a reason to flag anything made by it. i used to loath programming, when i started in IT some 20yrs ago. then slowly realized i needed batches, scripts, then gradually became addicted to ahk. i understand the av's need a way to determine if exe's are safe. they could still give the warning this app is not popular so it could be dangerous, but never list it as a particular type of virus, like Trojan that receives commands from attacker. the app i made was labeled as such, although it had no open ports, didnt write anything to hard drive unless it was for the direct purpose of writing to an ini file within the same folder the app was running for settings, never acessed system protected files. but yet all the av's including chrome browser and microsft defender, would not only deem it the most dangrous thing on the web, but it wouldnt even give me the chance to allow it, they eventually started removing it first and ask questions later. but now after last night, i did ahk_H and it hid the code and only a few generic warnings from virus total. although i still belief they shouldnt assume its a trojan just because its made by ahk, i understand if you list it as unpopluar or untrusted until it is used more.

i like the key exchange idea using apis. it would be good for one app i was thinking of tring to sell licenses. but the main project i have is a portable toolkit on usb. so it would be impossible to license it. i do a little bit of deterrence. i made a simple cifers based on the email adddress entered to have a acceptable password. it does save the the creditals within the usb folder, to remember they have an activated version. yes people can just copy the whole folder, but it does show in the app the email adress that paid for the activation. so if they give to others then there email address will be shared as well. but i did want to hide the cifer inside the program so people didnt make a key generator for it. although they could still figure it out. i guesss i try to keep the padlock mentality. its like people cant break into it or crack it, just dont leave an open door. sense it was so easy using resourcehacker to view everything, i felt the need for some type of padlock. (although if there was a specific id asigned to each usb drive, then mayby i could retrieve that and tie the passphrase to it).

FeiYue's does have a great program, and simple to use. although i prefer the autohotkey_h method since all the pieces are open source. when something is completely open source it leaves it up to the community to find the flaws or back doors. although changing the default passcode is becoming a real chore, but as soon as i get a working method, i will be creating ascript asap to minimize those steps for sure. i will be reviewing the links you gave, because i would like to learn more on this topic. and in the future like to learn more about your idea with using api for licensing, very interesting, i will pm you.

i still need to figure out how to get ahk_H to acept the password change and also update the file details like author and file version number. thank goodness for the tutorial that was made, becuase there would be no way i would of had the apteince to figure that out, to change the password but i must be missing something.

thanks so much for your help! thats another thing i love about ahk is the great community of helpers like your self !

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: help basic example, Autohotkey_H encrypt source code

Post by SOTE » 27 Dec 2020, 14:56

I'm a bit suspicious that part of the the false-positive issue is various bad actors. For instance, I've used WinBatch which is a similar closed source automation scripting language and it gets zero hits on VirusTotal, AutoIt gets only 1 hit and is closed source, yet AutoHotkey gets multiple hits and is open-source. That's complete insanity that has no excuse whatsoever. You can literally inspect every line of the AutoHotkey interpreter's code, in addition to hash it and separate it from the script. Looks like some foul play is going on. Another possible factor is that the other languages have more presence on VirusTotal to contest some of these assessments.

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: help basic example, Autohotkey_H encrypt source code

Post by joekingcool » 27 Dec 2020, 15:14

i totally agree open source is transparent as it gets. just because its the most popular i suppose. i guess kinda like java got a bad rap years ago when people had javascript in there browser. the regular population learned (from the news)how much control can be taken from a web browser without knowing, javascript was popular, so someone with little knowledge made it public enemy number one. i might be wrong but that was my impression. yes web browsers give way to much of our privacy away to the highest bidder ( but yet thats ok) and yes no matter what programming script that is used in web browsers has the potential to take a control of a persons pc(thats how we have zoom and remote desktop) . they shouldn't be so hard on the program languages, but make more secure web browsers and operating systems. both of which can be done. leave software makers alone. of course someone will misuse the software no matter what it is. once again im no seasoned programmer, so i might be wrong, more of network admin and security.

ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: help basic example, Autohotkey_H encrypt source code

Post by ananthuthilakan » 01 Jan 2021, 01:59

joekingcool wrote:
27 Dec 2020, 13:52
in the future like to learn more about your idea with using api for licensing, very interesting, i will pm you.

i still need to figure out how to get ahk_H to acept the password change and also update the file details like author and file version number. thank goodness for the tutorial that was made, becuase there would be no way i would of had the apteince to figure that out, to change the password but i must be missing something.

thanks so much for your help! thats another thing i love about ahk is the great community of helpers like your self !
Add this in the starting of script before compiling with ahk_h to set filename, version etc
dont need to remove the comment ";"

icon.ico need to be there in the compiling folder set as icon ( you can rename it though )

Code: Select all

;@Ahk2Exe-SetName        appname.exe 
;@Ahk2Exe-SetVersion      	        0.0.0 
;@Ahk2Exe-SetDescription        appname.exe
;@Ahk2Exe-SetCopyright    	Copyright (c) since year 
;@Ahk2Exe-SetCompanyName  	company name 
;@Ahk2Exe-SetOrigFilename 	orig name
;@Ahk2Exe-SetMainIcon     	icon.ico

i like the key exchange idea using apis. it would be good for one app i was thinking of tring to sell licenses.
no you misunderstood it
the idea with using licensing system is pretty straight forward.
There will be license generator in the server it will generate a license and sent it to the customer when he purchases.
you just need some http get request to validate this license in your script.
if you don't want to start your own server i can help you with that.
i am running a multivendor market place, you can visit https://www.cloudgud.com/ to see it.
public open registration is not yet started.
i did learned about this licensing system and successfully tested and confirmed to be working for this platform so that , people can sell software through this platform.
At the moment i have only tested it for ahk
it should work for other languages as well since license validation, activation, deactivation etc call are working with ahk.

https://autohotkey.com/board/topic/5427-sw-copy-protection/

i have also incorporated this as well into ahk with slight modification it will autogenerate pc fingerprint inside customer pc when he activate license through api call.
so next time he start the application , it will verify pc fingerprint first and then the license validation with server, if pc fingerprint not correct it delete the license file. [ So basically he cannot copy whole folder to another pc, since fingerprint verification fails ]
This method will be much more respectful in terms of privacy bcz pc fingerprint is generated inside his system and stored in his system only not transferred any where else.

costomer can deactivate license by login into website in his dashboard

have a nice day.
Last edited by ananthuthilakan on 02 Jan 2021, 04:31, edited 1 time in total.

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: help basic example, Autohotkey_H encrypt source code

Post by SOTE » 01 Jan 2021, 07:06

costomer can deactivate license by login into website in his dashboard
The linked SW copy protection thread was not referring to a web based license protection scheme, with such deactivation abilities. How the two are connected is not clearly shown.
the idea with using licensing system is pretty straight forward.
There will be license generator in the server it will generate a license and sent it to the customer when he purchases.
you just need some http get request to validate this license in your script.
if you don't want to start your own server i can help you with that.
i am running a multivendor market place, you can visit ... to see it.
This is more of telling a story, then directing people to a payware website being used. If that's what is going on, this should be clearly stated and probably posted in a different section. Maybe try Other Utilities & Resources (https://www.autohotkey.com/boards/viewforum.php?f=22). If it is a utility or website that is useful to the AutoHotkey community, and not SPAM.

As has been stated in other threads, there are various ways to crack software. People should be aware and clear that this will be more of a burden with interpreted languages like AutoHotkey, AutoIt, Python, Java, C#, etc... Might also be good to look at the legal aspects of selling software or having a lawyer. For more, Joe Glines videos on the topic (https://youtu.be/hS4tiHq3jXk, https://youtu.be/P8sN5FNSm_8). A person getting into such a business should also be prepared to address customer service, bugs, complaints, competing software, marketing, etc...

ananthuthilakan
Posts: 188
Joined: 08 Jul 2019, 05:37
Contact:

Re: help basic example, Autohotkey_H encrypt source code

Post by ananthuthilakan » 01 Jan 2021, 22:28

SOTE wrote:
01 Jan 2021, 07:06
costomer can deactivate license by login into website in his dashboard
The linked SW copy protection thread was not referring to a web based license protection scheme, with such deactivation abilities. How the two are connected is not clearly shown.
the idea with using licensing system is pretty straight forward.
There will be license generator in the server it will generate a license and sent it to the customer when he purchases.
you just need some http get request to validate this license in your script.
if you don't want to start your own server i can help you with that.
i am running a multivendor market place, you can visit ... to see it.
This is more of telling a story, then directing people to a payware website being used. If that's what is going on, this should be clearly stated and probably posted in a different section. Maybe try Other Utilities & Resources (https://www.autohotkey.com/boards/viewforum.php?f=22). If it is a utility or website that is useful to the AutoHotkey community, and not SPAM.

As has been stated in other threads, there are various ways to crack software. People should be aware and clear that this will be more of a burden with interpreted languages like AutoHotkey, AutoIt, Python, Java, C#, etc... Might also be good to look at the legal aspects of selling software or having a lawyer. For more, Joe Glines videos on the topic (https://youtu.be/hS4tiHq3jXk, https://youtu.be/P8sN5FNSm_8). A person getting into such a business should also be prepared to address customer service, bugs, complaints, competing software, marketing, etc...
@SOTE WOW JUST WOW!! you are master at straw manning....and misrepresentation
in the pvt msg you sent me last .....there also you did the same thing..... i just let it go there.... but you are doing this more often.....its incredible to see at the same time disappointing.....


first of all its MY WEBSITE, not yet opened to public registration,( it is clearly mention in the previous post ....@SOTE you simply dodged it ) but if he needed a space i can get him a space there , that's all.
https://www.autohotkey.com/boards/viewforum.php?f=22 I will definitely post it here once i open it for public. I need to do some more work inside it before opening to public sellers..

In this thread he never actually asked anything specific to licensing system , or any direct question regarding it, So i just shared a possibly way forward rather than going into details.

if you want know how the sw copy protection and web based licensing protection scheme is connected ........ ask for it straight forward , rather than pointing out , it is not clearly shown or something, bcz it was never asked here!!!

i gave him the information that both sw copy protection and web based licensing can be combined to get better protection, as well as can have deactivation capability if its combined.
if he wants to know it , he will ask for it , then i will be more than happy to explain it........,

If he has his own web based licensing , or wants to start his own webs server he can try combining it to get better copy protection
If he don't want to start his own webserver he can use my webserver to generate license for his script.


its his call , and i respect his decision here , in either case i will be happy to help him.......

he never mentioned he wants to go this route of web based license in the first hand
So in this context should i explain each and every steps to be taken to get there in one route , or should i present these are possible routes , possible outcomes ???

i like people when presenting possible routes that i can take , and i have all the right to decide which route i should take rather people pointing , you should do this or that, it may be your be your cup tea @SOTE
A person getting into such a business should also be prepared to address customer service, bugs, complaints, competing software, marketing, etc...
i agree that he should but i don't agree that someone pointing it to him as if he doesn't know it by assuming he is ignorant enough to look upon what he needs..., he might have already looked upon it and have great understanding on it...., if he doesn't he can always seek help

i did said this to you once , now i am repeating....
are you assuming people are more ignorant than they really are ????@SOTE

NOW what's in it for me if he uses my webserver??!!.

I get to test some features of the website from a live seller's perspective....and get feedback from him
And possibly if he want to stick with my platform, i get a user for my platform.....its a win win for both him and me.

Post Reply

Return to “Ask for Help (v1)”