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

Partagez des fonctions et des UDF AutoIt.
Règles du forum
.
Répondre
Avatar du membre
Ghost911
Niveau 5
Niveau 5
Messages : 166
Enregistré le : mar. 21 oct. 2008 17:57
Localisation : Bordeaux
Status : Hors ligne

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

#1

Message 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
;##################Mouse

Dim xy (1)
MouseGetPos (xy())
Debug "Pos : X : "+xy(0)+" Y : "+xy(1)

Debug WinGetHandle ("Notepad")

;################## 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
For i = 0 To ArraySize (ProcessName ())
  Debug ProcessName (i)+" PID : "+ PID (i)
Next 
MsgBox (0,"Autoit",ProcessorArch ())
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
Dim SectionNames.s(1)
IniReadSectionNames(ScriptDir ()+"Example.ini",SectionNames ())
For i = 0 To ArraySize (SectionNames ())
  Debug SectionNames (i)
Next 

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 ()

Add Functions: 19/04/2019


Functions: ( THANK @AZJIO )

IniDelete ()

DriveGetType()

DriveGetLabel()

DriveGetSerial()

DriveSpaceFree()

DriveSpaceTotal()

DriveGetFileSystem()


Add Functions: 30/04/2019


Minor bug fixes :

DriveGetLabel() fixed function thank AZJIO

DriveGetFileSystem() fixed function thank AZJIO

ADD Functions :

BlockInput () thank AZJIO

FileGetShortName()

FileGetLongName()

MouseGetPos ()

WinGetHandle ()

Sqrt ()

Add Functions: 23/05/2019


ProcessExists ()
ClosePID ()
IniReadSectionNames()
WinWait ();2 in 1 finds the same handle with a title or a partial text
WinExists ();2 in 1 finds the same handle with a title or a partial text
WinWaitClose ();2 in 1 finds the same handle with a title or a partial text
WinWaitActive ();2 in 1 finds the same handle with a title or a partial text
WinGetProcess ();2 in 1 finds the same handle with a title or a partial text
HandleToHex ();x86 management Imitate autoit
HexToHandle ()

ADD Macro :

ScriptDir ()

Complete rewrite of functions with optimization :

ProcessList ()
ProcessClose ()
WinGetHandle ()

Delete function :

CountProcess ()
FileGetSize () ;Old function

All the old function are put in the OldFonctions.pb file



Add Fonctions : (18/07/2019)


WinMinimizeAll()
Winkill ();title or a partial text
SearchHandle ();Bonus function to simplify your life look for the handle of a window with a title or a text patiel
WinSetStade ();title or a partial text or Handle
#SW_HIDE = 0
#SW_SHOW = 5
#SW_MINIMIZE = 6
#SW_MAXIMIZE = 3
#SW_RESTORE = 9
#SW_DISABLE = 4
#SW_ENABLE = 1
WinActive () Title or Handle
WinList (); With the zero flag you can see the invisible windows and the flag 1 for visible windows more simplify than the original ;)
Default option :
VisibleWindow = 1
WinSetTitle () Title or Handle

Update :
WinExists () Handle Management
WinGetProcess () Handle Management




Add Fonctions : (09/04/2020)


IsHWnd (Return 0 or 1)
PixelGetColor (x,y)
WinSetTrans ;title or a partial text 0 To 255
Optimization of the msgbox function smaller and faster code (old msgbox function put in oldfunction.pb)
Msgbox Fix minors bug
MouseMoveSpeed Function under construction
MouseClick Function under construction
HibernateAllowed()
Suspend()
ShutdownPrivilege()
Shutdown (Flag)
#SD_LOGOFF=0
#SD_SHUTDOWN=1
#SD_REBOOT=2
#SD_FORCE=4
#SD_POWERDOWN=8
#SD_FORCEHUNG=16
#SD_STANDBY=32
#SD_HIBERNATE=64
ProcessSetPriority (Process.s, priority)
#PROCESS_LOW =0
#PROCESS_BELOWNORMAL =1
#PROCESS_NORMAL =2
#PROCESS_ABOVENORMAL =3
#PROCESS_HIGH =4
#PROCESS_REALTIME =5
EnvSet ()
EnvGet ()
FileRecycleEmpty()
add file in GuiExampleAutoitCoding (Hybrid Code) example method for window
GuiExampleAutoitCoding (Hybrid Code) update files
start of code to convert autoit to pb in construction

Add Fonctions : (01/12/2022)


#PB_OS_Windows_11 code upgrade OSVersion()
WinActivate(hWnd) adding a new function thank @AZJIO
#MB_SERVICE_NOTIFICATION1 I changed the name not compatible with purebasic 6 I added a 1 (msgbox)
DriveGetLabel bugfix for version 6 of purebasic
DriveGetFileSystem bugfix for version 6 of purebasic
ProcessorArch () optimization of the function and addition of flag for Purebasic 6
ARM64
ARM
ProcessorArch () the old function is moved to the file Old Functions.pb
ProcessorArch () bug fixed stack has been corrupted
ProcessorArch () add to file Example.pb
InitNetwork remove Deprecated function
HostNameToIp optimization of the function and addition of flag 0
HostNameToIp the old function is moved to the file Old Functions.pb
Ping () optimization of the function and addition of flag and timeout
Ping () fix minor bug
flag 0 return ping
flag 1 return PingStatus also returns errors
1 = Host disconnected
2 = Host unreachable
3 = Wrong destination
4 = Other errors
flag 2 return DataSize
timeout = 4000 like the original the setting :)
support written web address and ip address (www.google.com or 127.0.0.1)
Ping () the old function is moved to the file Old Functions.pb
remove ExampleGui I moved the files in the same folder it is more manageable

UPX site officiel pour compresser vos fichiers exécutables :

https://upx.github.io/




je suis déjà sur le forum anglais :forum Officiel
Fichiers joints
PureAutoitInclude.zip
(24.37 Kio) Téléchargé 448 fois
Modifié en dernier par Ghost911 le jeu. 01 déc. 2022 11:27, modifié 14 fois.
Avatar du membre
Ghost911
Niveau 5
Niveau 5
Messages : 166
Enregistré le : mar. 21 oct. 2008 17:57
Localisation : Bordeaux
Status : Hors ligne

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

#2

Message par Ghost911 »

Mise a jour 16/04/2019
Avatar du membre
Ghost911
Niveau 5
Niveau 5
Messages : 166
Enregistré le : mar. 21 oct. 2008 17:57
Localisation : Bordeaux
Status : Hors ligne

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

#3

Message par Ghost911 »

09/04/2020 “grosse” mise à jour
Avatar du membre
Ghost911
Niveau 5
Niveau 5
Messages : 166
Enregistré le : mar. 21 oct. 2008 17:57
Localisation : Bordeaux
Status : Hors ligne

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

#4

Message par Ghost911 »

Bonjour mise à jour 01/12/2022
Répondre