Jump to content

How to? AU3 --> C++


slaultu
 Share

Recommended Posts

I started coding AutoIt like 10 year ago. But now almost always my scripts get treated as virus and its making my life not easy as IT Admin. Yes, i now I should send my app as false positive, but lets be realistic, i often update code, have lots off versions, and lot off different antivirus providers.

I now considering migrating to c++, c# or other coding language. I have web development knowledge(php, html, css, js, sql, ect...) but C.

So the questions stand as: Most friendly way of migrating from autoit to some c, guides, lessons, recommended IDE

Thanks for recommendations you all are great!

Link to comment
Share on other sites

  • Moderators

There is no straight migration path from AutoIt to C++, they are two different languages with different syntax and capabilities. No magic button to convert; you have to understand both well enough to select the C++ equivalent for your AutoIt code. 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

If you're looking to do it in C++, your examples are going to be on a C++ forum, not an AutoIt forum.

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

@slaultu I would not reocmmed learning something like C++ (or even C) for doing basic system administration tasks, you may want to try different alternatives to your existing false positive issue. One very good way would be to deploy AutoIt on the systems you are managing and distribute raw source code that you can run like a normal program with AutoIt.exe (the interperter), this should totally mitigate your issue.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

5 hours ago, BigDaddyO said:

Or compile your AutoIt scripts in that magical, rarely discussed .a3x format.  Then you just save AutoIt3.exe in the same folder, create a shortcut to AutoIt3.exe and pass the .a3x filename as a commandline option.

Doesn't get caught by AV software and it's "Almost" as easy to distribute.

YOU WRONG about AV software Or you just know and use bad AVs.

AV analysis relies on action, not just known virus samples.  It blocks all formats, not just executable files.

 

I have transferred some of my applications to C ++, which are simply simple commands like RegWrite, ShellExecute,...

and AV still block it because it does not have a valid signature AND the number of users is low..

And I was tired of  'Report False Positives' to AVs.

Regards,
 

Link to comment
Share on other sites

@BigDaddyO You are right! How could I have forgotten mentioning the bit about a3x :>

@VIP

1 hour ago, VIP said:

AV analysis relies on action, not just known virus samples.  It blocks all formats, not just executable files.

It is a combination of both... and any executable with the AutoIt stub in it is going to be flagged as a virus by many anti-virus in my experience... I guess that is how their algorithm works.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

11 hours ago, VIP said:

YOU WRONG about AV software Or you just know and use bad AVs.

AV analysis relies on action, not just known virus samples.  It blocks all formats, not just executable files.

 

I have transferred some of my applications to C ++, which are simply simple commands like RegWrite, ShellExecute,...

and AV still block it because it does not have a valid signature AND the number of users is low..

And I was tired of  'Report False Positives' to AVs.

If that were true, you wouldn't be able to run a script from ScITE either.

Running an .a3x is almost the same as launching your script from Scite F5.  the executor is AutoIt3.exe which is know and not blocked by just about every AV tool out there.

Link to comment
Share on other sites

  • 11 months later...

Check this guy out. 

 

Autoit is like c++ dumbed way down.   Learning c++ definitely makes you appreciate autoit even more. Its definitely possible to go from here to there but its not an easy transition.   Learning c++ basically forces you to revisit every concept you thought you understood in autoit and expand on it.  I'm slowly getting there.  

 

Lol oops I did not realize this was a year old.  Sry about that lol.

Edited by markyrocks
Link to comment
Share on other sites

AutoIt is a language that an interpreter can understand ( in this case AutoIt3.exe ).
C++ is a language, and so is PureBasic, etc. . The compiler is the thing, and the coding language, is a language the compiler can understand.
There is/was ppl to straight out write and patch the machine code. Assembly is closer to machine code than C++ will ever be. 
In pascal memory declaration was simpler than C++.
My point is that C++ is just a language that is widely used and that is all.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Unfortunately the MS-Dos DEBUG.EXE utility has disappeared, which was a very convenient way to patch a binary or write your own machine code program byte after byte.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

12 hours ago, markyrocks said:

 Learning c++ definitely makes you appreciate autoit even more.

Indeed, as so does learning any lower level language. For the full effect, try C, it will make you appriciate all the things AutoIt can do with ease a lot more :)

C++ is a high-level language when compared to C, so it is a bit like going from AutoIt to C++!

Make no mistake, C is great, I for one prefer it over C++ as C has less abstractions while still having a good amount of features to make programming productive.

I imagine once you try assembly/machine code, you will appriciate C the same way as you do for AutoIt when working with C++ :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

On 1/24/2020 at 2:25 PM, argumentum said:

AutoIt is a language that an interpreter can understand ( in this case AutoIt3.exe ).
C++ is a language, and so is PureBasic, etc. . The compiler is the thing, and the coding language, is a language the compiler can understand.
There is/was ppl to straight out write and patch the machine code. Assembly is closer to machine code than C++ will ever be. 
In pascal memory declaration was simpler than C++.
My point is that C++ is just a language that is widely used and that is all.

Isn't c++ compiled directly to assembly?   And how much different is a compiled autoit program to c++?  My understanding is that c++ is a layer on top of c or an expansion.   Autoit is a language but it's not written in itself.  So whatever its basically a layer over top of whatever its written in.  I'd assume c or c++.  I realize that running a autoit program from a script can be slower bc of the extra steps between interpreter and compiler.  But once its compiled short of certain built in optimizations for c++ or c in their compilers.  Should they run at nearly the same speed?

 

I guess my question is in autoit is that interpreter layer like hard coded into its .exe when its compiled or is it just eliminated completely?

Edited by markyrocks
Link to comment
Share on other sites

  • Developers
1 hour ago, markyrocks said:

And how much different is a compiled autoit program to c++?

When you men an AutoIt3 script then I would say a lot! 
The script is converted and packed with an runtime module of AutoIt3 and then ran at execution time.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

1 hour ago, markyrocks said:

I guess my question is in autoit is that interpreter layer like hard coded into its .exe when its compiled or is it just eliminated completely?

All the native functions are in the .exe. All the support libraries ( UDFs ) are interpreted by code in the .exe .
Most of windows can be "called". Actually, must be called. There is no direct hardware access in "NT" onward.
So AutoIt is a program that reads "verbal instructions" from a text file, executes them accordingly.
It saves the text file as a resource inside the "compiled" script or, by registering the extension "au3" to its handler ( AutoIt3*.exe )

Convenience vs. speed: AutoIt is very convenient, but as all interpreted code, slower and decompilable to the exact text file with the "code" ( the .au3 file )

Nowadays, in my view, speed and memory and ... computing resources, so to say, are so fast and abundant that there is no "slow".

The way you present your trend of thought shows lack of experience, hence knowledge, therefore, try/do/test/explore/read everything AND please, kindly be patient, as years of experience don't come about in weeks :) 

In this forum, the abundance of examples by all these beautiful ( mostly ugly looking I'll guess but would not fight their grandmothers over it ) people, makes this language beautiful too :huggles:

By the way, about my self: I am not a programmer ( I do program stuff but would not call me a programmer ). I'm a scripting kid ( over 55 years old ) but been coding since 1984, on and off, ( obviously in other languages ) and that gives me perspective. But there are what I call "god like" coders in this forum and quite patiently ( at times ;) ) help, and help they do.

I may have gone a bit off topic in this response but I feel you don't have a question. You just lack experience in the field and all this can get confusing.
In any case, I love and support inquisitive minds and pitch in as much as I can :cheer:

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

2 hours ago, markyrocks said:

Isn't c++ compiled directly to assembly?

Depends on the compiler, most popular ones compile directly to machine code targeting a specific instruction set (x86 is the most common), there is even a C/C++ compiler which compiles to JavaScript which you can run in your browser :)

2 hours ago, markyrocks said:

And how much different is a compiled autoit program to c++?

Very. A compiled AutoIt script is just AutoIt3.exe merged with a copy of your script, there is no actual "compilation" happening besides the pre-processing done by AutoIt3Wrapper and Aut2Exe :)

2 hours ago, markyrocks said:

My understanding is that c++ is a layer on top of c or an expansion.

The latter is correct. C++ started as an OOP expansion for C, but it spiraled into its own language as the features were being developed.

2 hours ago, markyrocks said:

Autoit is a language but it's not written in itself.  So whatever its basically a layer over top of whatever its written in.  I'd assume c or c++.

The current version is written in C++, and it is not a layer over C++. It is just written in it, the actual stuff that runs is machine code which is directly capable of being executed by the processor.

2 hours ago, markyrocks said:

I realize that running a autoit program from a script can be slower bc of the extra steps between interpreter and compiler.  But once its compiled short of certain built in optimizations for c++ or c in their compilers.

AutoIt doesn't have an actual compiler like I have mentioned, only the script is embedded and it is interpreted everytime the executable is ran. And the speed between uncompiled and compiled scripts doesn't very much because AutoIt does not optimize anything in your script besides the usual when compiling

2 hours ago, markyrocks said:

I guess my question is in autoit is that interpreter layer like hard coded into its .exe when its compiled or is it just eliminated completely? 

First guess is correct, the interpreter is hardcoded, so it is essentially a layer your own script in the .exe

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

This has all been very informative.   Thanks guys.   Believe it or not I've been playing around with autoit for years on and off.  I'm not quite 55 but I'm creeping up on 40.  So I guess some of my questions may sound niave?  I feel like I'm doing pretty good in my coding life considering I have no formal training.   Trust me it takes a whole lot longer to figure out coding concepts without someone taking you by the hand.   I mean geez my kids look at me like I'm crazy when I tell them that we didn't even have a pc in our house until I was in my early 20s....  Also trust me I I attempt to Google some of these questions and its usually just a bunch of nonsense or news about the latest malware written in autoit or something.   I'm trying my best to make leaps and connections but again I'm just a hobbyist hoping to give my kids a leg up so they can maybe be experts one day.  

I'd also like to add that I build custom tile/stone showers for a living so, Way off from being at a computer everyday.   

 

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...