RTFC

MCF - MetaCode File UDF

17 posts in this topic

#1 ·  Posted (edited)

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.

 

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

CodeScannerCrypter.bundle.v2.1.7z

 

 

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Version 1.1 released (3.3.12 compliant)

One tiny bug squashed. :pirate:

No other cruelties committed.

Edited by RTFC

Share this post


Link to post
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)


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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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: 04/09/2015

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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
1 person likes this

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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
1 person likes this

Share this post


Link to post
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:

Share this post


Link to post
Share on other sites

Hello,

 

I have big problem when i try encrypt  """data""". After encyrpt the code is ""data"" instate of "data".

 

Have some one the same problem

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

@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

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Spoiler
Spoiler

test

pls delete me, cant find delete btn

 

On 1.11.2013 at 0:29 PM, RTFC said:

Beta version 0.8 released, minor bug fixes.

 

Edited by Busti

My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
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

  • Similar Content

    • RTFC
      By RTFC
      CodeCrypter enables you to encrypt scripts without placing the key inside the script.
      This is because this key is extracted from the user environment at runtime by, for example:
      password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here):
      CodeScannerCrypter.bundle.v2.2.7z
      Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly.
       
      How the bits and pieces fit together:
      CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here:
      '?do=embed' frameborder='0' data-embedContent>>
      The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init().
      From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely:
      In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really.
      Not convinced? Check out this updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:
      CodeCrypterFAQ.pdf
       
      BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want).
      CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for  example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples.
       
      Important!
      You need the following additional scripts to get anything to work (now all included in the bundle):
      CodeScanner.au3 version 2.9+ (in the CodeScanner zip in the CodeScanner thread, link above) readCSdatadump.au3 (version 1.1+, in the CodeScanner zip) MCF.au3 (version 1.3+, in the MCF zip in the MCF thread, link above) MCFinclude.au3 (version 1.1+, in the MCF zip) AES.au3, by Ward (now also included in bundle, thanks to Ward), see '?do=embed' frameborder='0' data-embedContent>> As you can see, encryption currently relies on Ward excellent AES UDF, but you can replace this with any other algorithm you like; just edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry().
      Going to lie down now...
      RT
      CodeCrypterFAQ.pdf
    • AlecSadler
      By AlecSadler
      Hello all, I would like to present my proof of concept work to the autoit forum and community. (I saw this as a concept in a few sci-fi shows and thought I would bring it into real life)
      What is it?: DARTIS (Dimensions And Relative Time Information System)© is a 4 dimensional holographic encryption algorithm which uses the current timestamp(measured down to femto seconds) to encrypt data under several layers of calculations. One large keyfile is used and multiple keys are extracted from it, and overlaid on each other to create 1,000,000,000,000,000  unique keys per second. Special thanks to the creator of the matrix maths udf (if this is you please let me know and I will put your name here.) Also special thanks to trancexx for her LZNT compression code.
      Please see the following link for the full set of functions and an example debugging application, which shows usage of all the functions.
      https://pdglobal.net/?pid=SIM#SIM (DARTIS is packed with SIM)
       
      DARTIS is an encryption scheme that extracts a timestamp from the current system time, then splits it up into an array of strings each 4 digits long.

      Then those strings are plugged into the 16mb keyfile blueprint, where each 4 digit value represents a 2D array.

      Then each 2D array is layered on top of the one that came before it, compressing the data underneath several layers of encryption.

      It's 4D because the key is derived from the system time(so the same key will never be used twice)

      And it's holographic because the data is buried underneath several layers of data.

      The full 16mb keyfile blueprint is required to re-extract the data that has been injected into the holographic keyfile blueprint. (as the values all have to be the same AND be in the same order)

      The only downside to this encryption scheme is that the only safe way to distribute keys is by snail mail or in person. (because if you transmit it via the internet, you're limiting the security of your keyfile blueprint to whatever lesser encryption algorithm you;re using to transmit the keyfile blueprint)

      Hope I explained it in a way that's easy to understand! If you have any further questions about it feel free to ask! (and/or look around the DARTIS.au3 file to see how this is done, and run DEBUG.au3 to see under the hood)