Page 1 sur 1

[Func] Véritable compilateur code machine pour Autoit petit executable

Posté : mer. 13 mars 2019 12:20
par Ghost911
Bonjour tout le monde alors voila j'ai créé un fichier à inclure pour pouvoir coder en autoit dans un autre langage (Purebasic) et compiler le code source en code machine avec un véritable exécutable de petite taille !

AutoIt Code : Taille executable 415 kb avec UPX Language interpréter

Code : Tout sélectionner


$Time=TimerInit()
MsgBox (16,"Autoit",StringIsDigit ("123a"))
MsgBox (16,"Autoit",StringIsDigit ("123"))
$VarBin=StringToBinary("Hello")
MsgBox (64,"Autoit",@Hour)
MsgBox (64,"Autoit",@TempDir)
MsgBox (64,"Autoit",$VarBin)
MsgBox (64,"Autoit",BinaryToString($VarBin))
MsgBox (0,"Autoit",StringLen ("bonjour"))
MsgBox (1,"Autoit",@DesktopCommonDir)
MsgBox (2,"Autoit",@ProgramFilesDir)
Sleep (1000)
MsgBox (3,"Autoit",FileGetSize("test.pb"))
MsgBox (4,"Autoit",Random (1,10,1))
$Variable=FileGetSize("test.pb")
MsgBox (0,"Autoit",$Variable)
;InetGet ("https://jardinage.lemonde.fr/images/dossiers/2018-07/language-chat-170054.jpg","image.jpg")
MsgBox (0,"Autoit",StringReplace ("Hella","a","o"))
MsgBox (0,"Autoit",StringTrimLeft ("Hello",1))
MsgBox (0,"Autoit",StringTrimRight("Hello",1))
    If  FileExists ("test.pb") Then
        MsgBox(0,"Title","the file exist")
    Else
        MsgBox(0,"Title","the file does not exist")
    EndIf
MsgBox(0,"Autoit",FileGetTime ("UPX.exe",1,1))
MsgBox(0,"Autoit",FileGetTime ("UPX.exe",1,1))
MsgBox(0,"Autoit",FileGetVersion("UPX.exe"))
MsgBox(0,"Autoit",TimerDiff($Time))
If IsAdmin() Then
    MsgBox(0,"Autoit", "IsAdmin You are administrator !.")
Else
	MsgBox(0,"Autoit", "IsAdmin You are not administrator !.")
EndIf
MsgBox(0,"Autoit",String (10))
MsgBox(0,"Autoit",Ping ("google.fr"))

;################## StringSplit
$Split = StringSplit("ABC*DEFG*JKL","*")
MsgBox(0,"Autoit",$Split[1])
MsgBox(0,"Autoit",$Split[2])
MsgBox(0,"Autoit",$Split[3])
;################## StringSplit
IniWrite("setup3.ini", "General", "Title", "AutoIt")
$inivar= IniRead("setup3.ini", "General", "Title",Default)
MsgBox (0,"Autoit",$inivar)
PureBasic Code : Taille Executable : 12 kb avec UPX Exécutables en code machine ( code source est sécurisé)

Code : Tout sélectionner

IncludeFile "AutoitCoding.PB"
;MsgBox (16,"Autoit",StringIsDigit ("123a")) ;StringIs.PB be sure to activate it in AutoitCoding.PB this increases the size of the executable
;MsgBox (16,"Autoit",StringIsDigit ("123"))  ;StringIs.PB be sure to activate it in AutoitCoding.PB this increases the size of the executable
;InetGet ("https://jardinage.lemonde.fr/images/dossiers/2018-07/language-chat-170054.jpg","image.jpg") ; InetFonctions be sure to activate it in AutoitCoding.PB this increases the size of the executable
ProcessClose ("5936")

Time$=TimerInit()
VarBin$=StringToBinary("Hello")
MsgBox (0,"Autoit",ComSpec ())
MsgBox (64,"Autoit",GetCPUName ())
MsgBox (64,"Autoit",CpuSerialNumber ())
MsgBox (64,"Autoit",AutoItVersion ())
MsgBox (64,"Autoit","Hello"+CRLF ()+"Hello")
MsgBox (64,"Autoit",Hours ())
MsgBox (64,"Autoit",TempDir ())
MsgBox (64,"Autoit",VarBin$)
MsgBox (64,"Autoit",BinaryToString(VarBin$))
MsgBox (48,"Autoit",StringLenS ("bonjour"))
MsgBox (1,"Autoit",DesktopCommonDir ())
MsgBox (2,"Autoit",ProgramFilesDir ())
Sleep (1000)
MsgBox (3,"Autoit",FileGetSize("test.pb"))
MsgBox (4,"Autoit",Randoms (1,10))
Variable$=FileGetSize("test.pb")
MsgBox (0,"Autoit",Variable$)
MsgBox (0,"Autoit",StringReplace ("Hella","a","o"))
MsgBox (0,"Autoit",StringTrimLeft ("Hello",1)) 
MsgBox (0,"Autoit",StringTrimRight("Hello",1))
If  FileExists ("test.pb")
  MsgBox(0,"Autoit","the file exist")
Else
  MsgBox(0,"Autoit","the file does not exist")
EndIf
MsgBox(0,"Autoit",FileGetTime ("UPX.exe",1,"%mm/%dd/%yyyy %hh:%ii:%ss"))
MsgBox(0,"Autoit",FileGetTime ("UPX.exe",1,"%hh:%ii:%ss"))
MsgBox(0,"Autoit",FileGetVersion("UPX.exe",#FV_FileVersion))
MsgBox(0,"Autoit",TimerDiff(Time$))
If IsAdmin()
  MsgBox(0,"Autoit", "IsAdmin You are administrator !.")
  Else
	MsgBox(0,"Autoit", "IsAdmin You are not administrator !.")
EndIf
MsgBox(0,"Autoit",String(10))
MsgBox(0,"Autoit",Ping ("google.fr"))

iLife = 42
If IsNumber(iLife)
    MsgBox(0, "", "Is Number")
Else
    MsgBox(0, "", "Is not Number")
  EndIf
;################## StringSplit
Dim Split.s(1) ; Create array
StringSplit (split(), "ABC*DEFG*JKL", "*")
MsgBox(0,"Autoit",Split(0))
MsgBox(0,"Autoit",Split(1))
MsgBox(0,"Autoit",Split(2))
;################## StringSplit

;################## ProcessList
Dim ProcessName.s(1) ; Create array
Dim PID.s(1)         ; Create array
ProcessList (ProcessName (),PID ())
MsgBox(0,"Autoit","ProcessName: "+ProcessName(10)+"YourPID: "+PID (10))
;################## ProcessList

IniWrite("setup3.ini", "General", "Title", "AutoIt")
inivar$= IniRead("setup3.ini", "General", "Title")
MsgBox (0,"Autoit",inivar$)
;Bonus Function
MsgBox(0,"Autoit",HostNameToIp ("google.fr"))


( il y a une légère différence mais rien d'important, je compte sur vous pour améliorer le projet et ajouter des fonctions! )

(L'inconvenant du system c'est que Purebasic est payant on peut pas tout avoir )

Fonctions compatibles :




Msgbox

Sleep

FileGetSize

ClipPut

ClipGet

Randoms

DirCopy

DirCreate

DirRemove

StringReplace

StringLen

Macros :




ProgramFilesDir ()

MyDocumentsDir ()

DesktopCommonDir ()

Add Fonctions : (11/03/2019)




StringTrimLeft

StringTrimRight

FileCopy

FileMove

StringUpper

StringLower

Add Fonctions : (12/03/2019)


StringIsFloat

StringIsAlpha

StringIsDigit

StringReverse

BinaryToString

StringToBinary

FileExists

Msgbox ADD :

MB_ICONERROR = 16

MB_ICONQUESTION = 32

MB_ICONWARNING = 48

MB_ICONINFORMATION=64

Vous pouvez contrôler la taille de l'exécutable

Division de la taille de l'exécutable par 10 (119 kb à 12 kb)

(J'ai séparé les fonctions dans plusieurs fichiers à activer si nécessaire dans le fichier AutoitCoding.PB retirer les commentaires des includes)

Add functions:  (20/03/2019)


String

IsAdmin

TimerDiff

TimerInit

Ping

FileGetVersion

add :

#FV_FileVersion

#FV_FileDescription

#FV_LegalCopyright

#FV_InternalName

#FV_OriginalFilename

#FV_ProductName

#FV_ProductVersion

#FV_CompanyName

#FV_LegalTrademarks

#FV_SpecialBuild

#FV_PrivateBuild

#FV_Comments

#FV_Language

FileGetTime

Flag :

 0 Last modified (default)
 1 Created
 2 Last accessed

Msgbox ADD :

MB_DEFBUTTON2 = 256 Flag

MB_DEFBUTTON3 = 512 Flag

MB_DEFBUTTON4 = 768 Flag

MB_SYSTEMMODAL = 4096 Flag

MB_TASKMODAL = 8192 Flag

MB_DEFAULT_DESKTOP_ONLY = 131072 Flag

MB_RIGHT = 524288 Flag

MB_RTLREADING = 1048576 Flag

MB_SETFOREGROUND = 65536 Flag

MB_TOPMOST = 262144 Flag

MB_SERVICE_NOTIFICATION = 2097152 Flag



Bonus Function :

HostNameToIp


Add Functions: (22/03/2019)




-----------------------

ADD Macros : (thank @AZJIO)

DesktopCommonDir ()

MyDocumentsDir ()

ProgramFilesDir ()

ScriptFullPath ()

ScriptName ()

ScriptDir ()

-----------------------

OSVersions ()



Add Functions: (26/03/2019)




-----------------------

ADD Macros :

TempDir ()

Hours ()

Min ()

Sec ()

MDAY ()

MON ()

Years ()

LF ()

CR ()

CRLF ()

-----------------------

Functions:

Floor

Ceiling

Stringlen ( Update :Return Number)

StringlenS (Temporary function asks for reflection)

Add Functions: 06/04/2019


Macro :

AutoItVersion () ; it's for fun haha

SystemDir ()

UserProfileDir ()

AppDataDir ()

ComSpec () ; Bug fixed

UserName ()

LogonServer ()

HomeShare ()

HomeDrive ()

HomePath ()

HomeDrive ()

LocalAppDataDir ()

UserProfilDir ()

Bonus Macro :

ProcessorsThreadNumber ()

Functions :

Change of procedure in macro (optimization)

Optimization of msgbox

Fix a constant messagebox

Beep

StringSplit ( thank @AZJIO )

FileGetAttrib

Bonus features :

CpuSerialNumber()

GetCPUName()

Add Functions: 16/04/2019




Optimization UserName ()
Optimization CpuName () change of the name of the function GetCpuName ()

ProcessList () :
Return PID
Return ProcessName

ProcessClose (); PID or ProcessName

IniWrite ()
IniRead ()

Macro :

ProcessorArch ()
DesktopHeights ()
DesktopWidths ()
DesktopRefresh ()
DesktopDepths ()
AutoItX64 ()



UPX site officiel pour compresser vos fichiers exécutables :

https://upx.github.io/




je suis déjà sur le forum anglais :forum Officiel

Re: [Func] Véritable compilateur code machine pour Autoit petit executable

Posté : mer. 17 avr. 2019 08:13
par Ghost911
Mise a jour 16/04/2019