Jump to content

MCF - MetaCode File UDF


RTFC
 Share

Recommended Posts

MetaCode offers a way to:

  • separate a script's structure from its content
  • remove all redundant definitions (globals and UDFs)
  • change any content (and some structure)
  • combine (new) structure and (new) content into a new script

The most useful applications implemented so far are:

  1. Fast language translation (not just text strings, also variable names and UDF names)
  2. Obfuscation (vars and/or UDFs)
  3. Script Encryption (conditionals, calls, and macros)

Encryption is powerful because the key is not stored anywhere; you can define it to be a user password, macro, environment spec/variable, server response, something you define yourself, or a combination thereof; anything goes, as long as it's not a fixed string or fixed value. More info in the CodeCrypter thread: ?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>

?do=embed' frameborder='0' data-embedContent>

But MetaCode has more potential than that; it allows you to tinker with any type of content separately, then rebuild a new version. So for example, you can have a single script structure and numerous different language modules you just plug in to create a new version in a different language.

A brief Tutorial is here: MetaCode Tutorial.pdf

The MCF library itself can be found in the CodeScannerCrypter bundle.

And a little example how to use it for translating your GUI into a different language:

 UI_Translator.7z (new version that should work with the new version of Google Translate, see post #13 below)

 

 

MCF.au3 is just the library plus the MCFinclude.au3 file you need to include in any script you wish to encrypt.

There is no GUI here. However, I did write a separate front-end for it called CodeCrypter, which you can find here:

?do=embed' frameborder='0' data-embedContent>'?do=embed' frameborder='0' data-embedContent>>

?do=embed' frameborder='0' data-embedContent>

MCF uses output generated by my CodeScanner version 2.8+, which you can find here:

'?do=embed' frameborder='0' data-embedContent>>

CodeScanner also depends on MCF.au3 now, as it can now call a few of its functions.

I should also mention Ward's excellent AES.au3 UDFs used for the encryption and decryption calls,  which is now included in the CodeScannerCrypter bundle (thanks to Ward for allowing to include it). You can find the original (unpatched) version here:

'?do=embed' frameborder='0' data-embedContent>>

Note: you can replace the encryption/decryption calls with whatever algorithm you like (hint: the native <Crypt.au3> library is too slow for most purposes, better stick to machine code routines)

So just to be clear:

  • CodeScanner (v2.8+) needs MCF (earlier versions won't work!)
  • CodeCrypter needs MCF (plus anything that MCF needs)
  • MCF itself needs MCFinclude (part of MCF zip)
  • MCF also needs readCSdatadump (part of the CodeScanner package, you need the latest version packaged with CodeScanner v2.8; earlier versions won't work!)
  • both MCF and MCFinclude currently rely on AES.au3 by Ward

So you basically need to download the whole bundle for any of it to work.

 

If you have any questions, please start by reading the MCF Tutorial and the CodeCrypter FAQ (you can download the latter separately from the CodeCrypter thread).

Next, read the extensive Remarks sections in MCF.au3, MCFinclude.au3, and CodeCrypter.au3

If still no joy, then please post. However, I'm not online that often, and logged in to the forum even less, so response may take a while).

RT

Edited by RTFC
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Beta version 0.9 released, added support for CodeCrypter's new UDF filtering feature. This allows the user to apply encryption per individual UDF. For more info, see the updated FAQ (MCFQA.pdf) in the Codecrypter thread.

Link to comment
Share on other sites

  • 3 months later...

Version 1.1 released (3.3.12 compliant)

One tiny bug squashed. :pirate:

No other cruelties committed.

Edited by RTFC
Link to comment
Share on other sites

Is it there an overall frontend?

p.s.
(tried MCF.au3, got 32 errors)

"

:unsure:

...AutoItMCFMCF.au3"(360,54) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($FuncEqualsString, $curstring, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(364,55) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($functionsCalled, $curstring, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(387,54) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($functionsCalled, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(388,55) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($FuncEqualsString, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(472,49) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($variablesUsed, $curvar, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(490,100) : error: _ArrayAdd() called with wrong number of args.
If _ArraySearch($macrosUsed, $curmacro, 1) < 1 Then _ArrayAdd($macrosUsed, $curmacro, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(518,56) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($functionsUsed, $previousword, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(525,78) : error: _ArrayAdd() called with wrong number of args.
If $index < 1 Then _ArrayAdd($functionsCalled, $previousword, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(618,46) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($varonce, $curvar, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(620,93) : error: _ArrayAdd() called with wrong number of args.
If _ArraySearch($vartwice, $index, 1) < 1 Then _ArrayAdd($vartwice, $index, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(633,108) : error: _ArrayAdd() called with wrong number of args.
If _ArraySearch($funcalled, $curfuncindex, 1) < 1 Then _ArrayAdd($funcalled, $curfuncindex, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(661,82) : error: _ArrayAdd() called with wrong number of args.
If $index > 0 Then _ArrayAdd($funcorphans, "{funcU" & $index & "}", 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(776,60) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($already_included, $original_filename, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(892,52) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($globalsOrphaned, $MCtag, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(894,92) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($globalsOrphaned, StringStripWS(StringLeft($MCtag, $pos - 1), 2), 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1283,48) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($strings1, $curstring, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1285,48) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($strings2, $curstring, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1332,46) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrases, $curphrase, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1333,47) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrasesUDF, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1344,46) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrases, $curphrase, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1345,47) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrasesUDF, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1372,46) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrases, $curphrase, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1373,47) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrasesUDF, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1388,45) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrases, $curphrase, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1389,46) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($phrasesUDF, $curfunc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(1787,44) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($namesUsed, $newname, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(2250,39) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($markers, 1, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(2251,43) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($locations, $cc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(2254,39) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($markers, 2, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(2255,43) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($locations, $cc, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"...AutoItMCFMCF.au3"(2429,44) : error: _ArrayAdd() called with wrong number of args.
_ArrayAdd($Callstack, $procname, 0, Chr(0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Program Files (x86)\AutoIt3\Include\Array.au3"(53,40) : REF: definition of _ArrayAdd().
Func _ArrayAdd(ByRef $avArray, $vValue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
...AutoItMCFMCF.au3 - 31 error(s), 0 warning(s)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Hi Chimp,

The only available front-end at the moment is CodeCrypter, with which you can:

  • translate
  • obfuscate
  • encrypt
  • replace any specific content with any other content you define

I've been toying with the idea of a more general code editing front-end, for example to automate the implementation of script-breaking changes (see below :)), but at the moment I'm too busy with other projects. :unsure:

Regarding the errors you get, it looks like you are mixing AutoIt versions, that is, the current version of MCF (1.1) implements the script-breaking changes Melba23 implemented in <Array.au3> for AutoIt 3.3.12.1. However, you seem to be running the new version of MCF in an older version of AutoIt (please check the MCF header against your AutoIt version). So my advice is to download the current version of AutoIt and try again. ;)

There are several hundred changes implemented in all parts of this environment (older versions of CodeScanner and CodeCrypter won't work anymore either under 3.3.12.1, and the new versions won't work when running older versions of AutoIt. So please check the headers of these scripts, where the AutoIt version under which they should run/compile is always listed.

Upgrading environment is always a nuisance, but it can  be even more work to update all scripts to function in the new environment, I can assure you. :(

 

Edit: To accommodate users unwilling or unable to upgrade to AutoIt version 3.3.12 or higher, I'll make the last 3.3.8.1-compliant bundle available from here. However, none of these outdated versions will be maintained or upgraded, and I won't be fixing any bugs in them anymore. This is a temporary fix; when I run out of storage space it may disappear without advance notice, so get it while you can (but only if you really, really don't wish to upgrade your AutoIt version).

CodeScannerCrypter.bundle.old.zip

Edited by RTFC
Link to comment
Share on other sites

There is no v3.3.12.1. I have look through the code and though you have put a ton of effort into, I am still having trouble to understand how to "simply" use this. I would prefer to test something in which I can select the script and voila it spits out whatever it is it's meant to spit out.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Hi guinness,

Thanks for the clarification.

Funny thing, serendipity. :o  A few days ago somebody else just PM'ed me with a similar request, to produce a cmdline utility of CodeCrypter (the main front-end for this library) to just spit out an obfuscated and/or encrypted version of any input script. When I have a spare moment, I'll probably be able to rustle something up...

As far as engaging directly with the MCF library (and presuming you studied the Tutorial), CodeCrypter's source is admittedly a complicated example (although it does more or less exactly what you request, see the presets Tab). The problem is that the process is intrinsically multi-step; you have to run CodeScanner first to produce the MCF relevant arrays, which you can then engage with, through CodeCrypter, your own script, or both.

The basic idea is however, really simple:

  1. split the contents of your script up in topical arrays, turning the original script into a collection of placeholder array pointers
  2. duplicate the arrays you wish to change the content of, and make whatever changes you like there
  3. rebuild the script using the metacode pointers, but referring to the new arrays

Codescanner does step 1 for you, whereas CodeCrypter provides examples of steps 2 and 3. Alternatively you can write your own script to change the *New content arrays, and then simply use CodeCrypter's "Create New" option to rebuild.

It's potentially very powerful, because you can also make structural changes in the metacode file itself prior to step 3. In encryption, for example, I replace every function call, macro and conditional with an Execute(<decrypt><string>) wrapper. It's like the ultimate search-and-replace engine for both content and structure, but separately.

But you're right, :( it probably looks forbidding, but it is surprisingly difficult to produce a simple in/out example. I'll have to think about how I might be able to make this library more accessible. :huh2: Beng the designer is a handicap in this case, because I have to place myself in the shoes of somebody who sees the MCF UDFs for the first time, and it's hard to wipe once's subconscious mindset.

Anyway,  your input is much appreciated. ;)

Edited by RTFC
Link to comment
Share on other sites

  • 1 month later...

Version 1.2 uploaded, plus a small example: UI_translator.

This is basically two MCF calls: CreateSingleBuild, and _RebuildScript. Inbetween it performs the desired script change; in this case, it identifies most GUI-related  AU3 calls and translates all strings parsed directly to these functions, using Google Translate (thanks to akurakkauaaa, see '?do=embed' frameborder='0' data-embedContent>>, post #16). I've added a little helloworld.au3 example for illustration. You may have to patch Google's result manually in your own (translated scripts), because it still makes many mistakes.

It's just a demo to show how to interact with the MCF library, it's not meant to be a robust universal translator.

Hope it helps.

RT

Edited by RTFC
Link to comment
Share on other sites

  • 3 weeks later...

Version 1.3 uploaded. Not:e: this concerns only MCF itself; the complete bundle is not yet updated, as I'm still tinkering with the next CodeScanner update.

RegExp pattern strings are now excluded from string processing in certain procedures to avoid various issues.

Edited by RTFC
Link to comment
Share on other sites

  • 9 months later...

HI RTFC,

I tried out the UI_Translator but  always receive returns of = 0
I run codescanner on helloworld.au3 
in settings I select "write meta code" and rescan
internet connection = on
then I run UI_Translator.au3 selecting helloworld.au3
I get returns of = 0

have I missed something in how its done ?
thanks

 

Link to comment
Share on other sites

Hi Deye,

Thanks a lot for spotting this. There's nothing wrong with your approach, but my UI_Translator.au3 farms out the actual call to googleTranslate to akurakkauaaa's googletranslate.au3 (see post #16 in that thread), and apparently GoogleTranslate has changed its interface so the UDF in that script no longer works properly. When I have a spare moment I'll see if I can figure out what's wrong, or perhaps dig up an alternative somewhere (suggestions, anyone?) In the meantime, should you have access to some other translation UDF yourself, it may be doable to just replace the two calls to _googleTranslate() ca. line 375 in UI_Translator with your own.

Sorry for the inconvenience; I'll report back either way (but it may take me a few days...)

 

Edited by RTFC
Link to comment
Share on other sites

Okay, as far as I can tell none of the various Example scripts for querying Google Translate posted on the forum works anymore, because they've moved to a business subscription service model where you have to pay $20 per 1M words, which sucks. In my opinion (and in the spirit of the free, fully accessible internet for all), this kind of service should be free. So while we wait for such a free alternative service to emerge, here's an example of how one could still access Google's new service:

#include <Array.au3>
#include <IE.au3>

Local $tag="* # * # *"
Local $oIE=_IECreate("https://translate.google.com/#auto/es")
Local $oForm=_IEFormGetCollection($oIE,0)
Local $oQuery=_IEGetObjByName($oForm,"text")

_IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag)
_IEFormSubmit($oForm)
_IELoadWait($oIE)

Local $oText=_IEGetObjById($oIE,"gt-res-data")
$lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1)
_IEQuit($oIE)

_ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0])
_ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1))
$lines[0]=UBound($lines)-1
_ArrayDisplay($lines)

Doubtless this will change again at some point and no longer work. I'm consciously not providing a fully-fledged UDF, just a simple example to illustrate how this could be done, if one were so inclined. And moderators, please let me know if this contravenes forum rules, then I'll remove it again (I'm not sure...).

@Deye, I still have to implement this in my UI_Translator when I have some more time, maybe this weekend.

 

Edited by RTFC
minor bug fix
Link to comment
Share on other sites

@Deye (and all others wishing to translate their GUI text strings into 90 different languages), I've uploaded the new version of UI_Translator in the first post of this thread, based upon the example code in my previous post (immediately above).

No guarantees how long this will work, ask Google.:lol:

Link to comment
Share on other sites

  • 7 months later...

@sprzetok: I can encrypt the following test script with triple double-quotes without a problem:

#include <GUIConstantsEx.au3>
#include <MCFinclude.au3>

MsgBox (0, "Test","""Hello, World!""")

Example()

Func Example()  ; adapted from Help file, first example for GuiCreate
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("This is an Example")
    Local $idOK = GUICtrlCreateButton("Press to Quit", 140, 200, 120, 30)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idOK
                ExitLoop

        EndSwitch
    WEnd

    ; Delete the previous GUI and all controls.
    GUIDelete($hGUI)
EndFunc   ;==>Example

Moreover, a backtranslation shows that the triple quotes have been retained.

Please post a reproducer script (one that re-creates the error) adapted from the above template, if possible. And technically, you should have reported this in the CodeCrypter thread (see my signature), not here.:(

Hint: you can always edit the appropriate stringsNew.txt list with your own manually edited version to force a particular string to be output the way you want it. Please consult the documentation.

PS: Welcome to the AutoIt Forums!:)

Edited by RTFC
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

@Skysnake: Tutorial downoad link added in first post. Sorry for the delay in replying.

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

×
×
  • Create New...