Jump to content

Recommended Posts

  • Replies 396
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

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 us

Codecrypter version 3.1 is released; a major upgrade, made possible by the incorporation of TheXman's CryptoNG suite (with permission, of course). Many thanks to TheXman for allowing me to incorporate

Found the issue, which was indeed a bug. Please stand by for an updated bundle... CodeScannerCrypter bundle version 2.4 is now released, with many thanks to @Roman for flagging the bug.

Posted Images

I posted this video to make you see crypter works but If I put password in Decryptor (to make program works on other computers) even smallest code doesnt execute


#include "MCFinclude.au3"

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>

#include <MsgBoxConstants.au3>

Global $b = "b"

    Global $hGUI = GUICreate("Test", 500, 500, -1, -1)

    $seCguiLoad = GUICtrlCreateButton("Load Sec GUI", 10, 10, 80, 30)

    GUISetState(@SW_SHOW, $hGUI)

    While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE



Edited by Miliardsto
Link to post
Share on other sites

@Jos: Thanks for the nudge; appreciated.:)

@Miliardsto: Okay, are you comfortable? Cause this will take a while.

First off, thanks a lot for the video.^_^ No really. Usually I hope people don't post screenshots and videos because they do not allow me to test anything myself, and I can generate my own error messages, I don't need to see other people's too. But in your exceptional case, it is crystal clear how and why your attempt to encrypt is failing (basically, you simply misunderstand the CC interface and the way the $CCkey array works). I'll try and explain. Please follow these steps:

  • open CodeCrypter (since you've already got the MCF# outputs from CodeScanner)
  • navigate to Tab Encrypt
  • move your cursor to hover over the inputbox directly below the label: "Enter Key ID" until this tooltip appears: "Index to array $CCkey[] in MCFinclude to identify which (single) key definition to use." Notice that throughout your video, the (default) value inside the box remains unchanged, defining ID 3 (three).
  • Let's open up MCFinclude.au3 to check what key definition that ID actually contains, in function _MCFCC_Init():
    Func _MCFCC_Init($type=0,$query=True)
    ; NOTE: edit/add your keytype definitions here
    ; this UDF itself will be fixed-key encrypted
        ReDim $CCkey[8]
        If $cmdline[0]>0 Then
            $CCkey[1]=$cmdline[1]   ; option to parse decryption key at commandline
            $CCkey[1]=""    ; an empty string triggers decryption key (password) query at startup
        $CCkey[2]=@ComputerName ; some simple examples...
        $CCkey[3]=@UserName     ; case-sensitive!
        $CCkey[4]=_WinAPI_UniqueHardwareID($UHID_MB)    ; motherboard specs
        $CCkey[5]=_WinAPI_UniqueHardwareID($UHID_CPU)   ; CPU specs
        $CCkey[7]=@IPaddress1   ; ensure your IP is fixed (no DHCP) on the machine that will run your target!
        ; ...
        ; ...
        ; add your own definitions here...

    Note that ID 3 = @username. These are the default definitions; you may have edited your version so they might look different. However, if you wish to use the built-in password query function then the following line should have remained unchanged:

    $CCkey[1]=""    ; an empty string triggers decryption key (password) query at startup

    Note the array index being 1 (one, for password query), not 3 (for macro @username)

  • If you wish to use the password query, you need to A. define the expected response by pressing the "Decryptor" button, as you do in your video, and B. define your key ID as 1, for password (not 3, for @username).

  • So in all your attempts you've been working with the @username macro (ID=3), which of course extracts this information from its environment at runtime, and won't match your password definition ("ala" or "ala33"). So the fact that it's not running for you actually shows your encrypted script is working perfectly in denying access, because it has encrypted your script with "ala" and decrypts it at runtime with your @username, which of course returns total garbage (unless of course your @username happens to be "ala"). Voila.:D
  • Obviously, CodeCrypter cannot smell that you mean a password query merely from typing in an expected response in the Decryptor UI, as this is a generic feature; a user may instead be entering some other @username than the current one, so the script will work for that user only. See the CodeCrypter Remarks section for examples.


  • your usage of #include-once is wrong. This directive is to be placed inside an include file, not above the #include directives in the main script. And generic AutoIt include files (such as your various constants files) will likely already have that directive anyway.
  • It makes no sense to do this:
    #include "MCFinclude.au3"
    #include <GUIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>
    <main script>
    <your own UDFs>

    As this means that CC will encrypt/decrypt all listed (publicly available) AutoIt include files, wasting both file/memory space and processing time. Instead, do this:

    #include <GUIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>
    #include "MCFinclude.au3"
    <main script>
    <your own UDFs>

    Additional control over which parts below the MCFinclude line are to be encrypted is accessed through the checkbox list under button "UDFs," also under Tab "Encrypt" (as mentioned earlier).

Hope it's all clear now. Needless to say, your reproducer encrypts/decrypts perfectly with a password query in my environment, provided key ID = 1.;)

Edited by RTFC
Link to post
Share on other sites

You're welcome. Glad to hear you got it working.:)

2 hours ago, Miliardsto said:

And if someone got this password can encrypt this program?

I presume you mean "decrypt." Yes, obviously, if you use a password query to protect your script and an attacker gets hold of that password, obviously they can decrypt your script to reveal the plain text code. How easily? Very (I'm not going to go into details, for obvious reasons). That's why I never use password queries myself, but generate a separate machine-specific version of the encryption for each target machine, using environment-specific technical details, for example. Passwords are generally unsafe because humans are involved, and they tend to choose easy-to-guess passwords, tell other people their password, and write passwords down so as not to forget them, then discover they lost their secret note (or forgot where they put it) when they cannot remember their password anymore. My advice: take humans out of the decryption loop if you can; they are nearly always the weakest link in the chain.:shifty:

Edited by RTFC
Link to post
Share on other sites

so the query is completely utterly useless. Hmm... So safer thing would be If I provide CCkey for something from user environment. I need crypted program works on many computers so this CCkey must be common for every pc (environment). Like procesor bits = 64 for example or directory windows on disk C path = C:\windows etc.

Is my reasoning correct? It would be safe

Edited by Miliardsto
Link to post
Share on other sites
6 hours ago, Miliardsto said:

so the query is completely utterly useless

No, I did not say that.:mellow: If the people involved can keep their password secure, then it may be fine. But if you give the same password to a whole bunch of people, it only takes one of them being careless for your code to become exposed to the risk of decryption. Instead, if these many target machines are on a LAN or on the internet, you could consider using a key based upon (some permutation of) a server response. But beware that packet sniffers will be able to see all network traffic so that may require extra safeguards. Or maybe these users are all part of a single admin-domain you can query? Alternatively, CodeCrypter also works with commandline arguments (no GUI), so you can batch process hundreds of machines to automatically generate and distribute machine-specific encrypted versions of your script, based upon a precompiled lists of extracted hardware specs, for example. Remember that CCkey items can contain any function call (or macro), including your own functions. So anything you design that returns something unique based upon where it runs and/or who is running it will work. Best of luck.

Link to post
Share on other sites
  • 2 weeks later...
  • 3 weeks later...

Good Evening RTFC :bye:

First, long time no talk to. How have you been? Missed doing Autoit myself :graduated: Thank you for the script and support in the past. I'm getting back into Autoit and would like to encrypt my latest application. :) However, I've run into a snag trying to encrypt and for that matter, BackTranslate. What should I be looking at to determine where the problem lies?  On second look - it may be #include <UIAWrappers.au3> UIA_V0_63... May need to update - crap - and everything works fine in ver 0-63 now - good times. :blink:

MCF: Unable to Proceed
Error in function_EncodeMCF(),
related to: line too long (no markers found):
Error code: -4
Call Stack: codecrypter.au3
    calling _BackTranslate()
    calling _EncodeMCF()

2018/01/22 19:00:43: Line too long:
Local $patternArray[21][3]=[[$UIA_ValuePatternId,$sIID_IUIAutomationValuePattern,$dtagIUIAutomationValuePattern],[$UIA_InvokePatternId,$sIID_IUIAutomationInvokePattern,$dtagIUIAutomationInvokePattern],[$UIA_SelectionPatternId,$sIID_IUIAutomationSelectionPattern,$dtagIUIAutomationSelectionPattern],[$UIA_LegacyIAccessiblePatternId,$sIID_IUIAutomationLegacyIAccessiblePattern,$dtagIUIAutomationLegacyIAccessiblePattern],[$UIA_SelectionItemPatternId,$sIID_IUIAutomationSelectionItemPattern,$dtagIUIAutomationSelectionItemPattern],[$UIA_RangeValuePatternId,$sIID_IUIAutomationRangeValuePattern,$dtagIUIAutomationRangeValuePattern],[$UIA_ScrollPatternId,$sIID_IUIAutomationScrollPattern,$dtagIUIAutomationScrollPattern],[$UIA_GridPatternId,$sIID_IUIAutomationGridPattern,$dtagIUIAutomationGridPattern],[$UIA_GridItemPatternId,$sIID_IUIAutomationGridItemPattern,$dtagIUIAutomationGridItemPattern],[$UIA_MultipleViewPatternId,$sIID_IUIAutomationMultipleViewPattern,$dtagIUIAutomationMultipleViewPattern],[$UIA_WindowPatternId,$sIID_IUIAutomationWindowPattern,$dtagIUIAutomationWindowPattern],[$UIA_DockPatternId,$sIID_IUIAutomationDockPattern,$dtagIUIAutomationDockPattern],[$UIA_TablePatternId,$sIID_IUIAutomationTablePattern,$dtagIUIAutomationTablePattern],[$UIA_TextPatternId,$sIID_IUIAutomationTextPattern,$dtagIUIAutomationTextPattern],[$UIA_TogglePatternId,$sIID_IUIAutomationTogglePattern,$dtagIUIAutomationTogglePattern],[$UIA_TransformPatternId,$sIID_IUIAutomationTransformPattern,$dtagIUIAutomationTransformPattern],[$UIA_ScrollItemPatternId,$sIID_IUIAutomationScrollItemPattern,$dtagIUIAutomationScrollItemPattern],[$UIA_ItemContainerPatternId,$sIID_IUIAutomationItemContainerPattern,$dtagIUIAutomationItemContainerPattern],[$UIA_VirtualizedItemPatternId,$sIID_IUIAutomationVirtualizedItemPattern,$dtagIUIAutomationVirtualizedItemPattern],[$UIA_SynchronizedInputPatternId,$sIID_IUIAutomationSynchronizedInputPattern,$dtagIUIAutomationSynchronizedInputPattern],[$UIA_ExpandCollapsePatternId,$sIID_IUIAutomationExpandCollapsePattern,$dtagIUIAutomationExpandCollapsePattern]]         ; {file:6}{line:354}

Thanks again RTFC !

(UPDATE) Trying "UIA_V0_64" - Wish me luck...
UIA_V0_64 Notes:
edit 09 sep 2017
- Chrome examples again working on latest version and on Windows 10, Chrome has improved on iuiautomation
* lots of updates and cleanup of code
* Strict compile options
* some defect fixes

(UPDATE) Nope, roughly same error...
MCF: Unable to Proceed
Error in function_EncodeMCF(),
related to: line too long (no markers found):
Error code: -4
Call Stack: codecrypter.au3
    calling _RebuildScript()
    calling _EncodeMCF()

2018/01/22 19:52:49: Line too long:
Local $patternArray[21][3]=[[$UIA_ValuePatternId,$sIID_IUIAutomationValuePattern,$dtagIUIAutomationValuePattern],[$UIA_InvokePatternId,$sIID_IUIAutomationInvokePattern,$dtagIUIAutomationInvokePattern],[$UIA_SelectionPatternId,$sIID_IUIAutomationSelectionPattern,$dtagIUIAutomationSelectionPattern],[$UIA_LegacyIAccessiblePatternId,$sIID_IUIAutomationLegacyIAccessiblePattern,$dtagIUIAutomationLegacyIAccessiblePattern],[$UIA_SelectionItemPatternId,$sIID_IUIAutomationSelectionItemPattern,$dtagIUIAutomationSelectionItemPattern],[$UIA_RangeValuePatternId,$sIID_IUIAutomationRangeValuePattern,$dtagIUIAutomationRangeValuePattern],[$UIA_ScrollPatternId,$sIID_IUIAutomationScrollPattern,$dtagIUIAutomationScrollPattern],[$UIA_GridPatternId,$sIID_IUIAutomationGridPattern,$dtagIUIAutomationGridPattern],[$UIA_GridItemPatternId,$sIID_IUIAutomationGridItemPattern,$dtagIUIAutomationGridItemPattern],[$UIA_MultipleViewPatternId,$sIID_IUIAutomationMultipleViewPattern,$dtagIUIAutomationMultipleViewPattern],[$UIA_WindowPatternId,$sIID_IUIAutomationWindowPattern,$dtagIUIAutomationWindowPattern],[$UIA_DockPatternId,$sIID_IUIAutomationDockPattern,$dtagIUIAutomationDockPattern],[$UIA_TablePatternId,$sIID_IUIAutomationTablePattern,$dtagIUIAutomationTablePattern],[$UIA_TextPatternId,$sIID_IUIAutomationTextPattern,$dtagIUIAutomationTextPattern],[$UIA_TogglePatternId,$sIID_IUIAutomationTogglePattern,$dtagIUIAutomationTogglePattern],[$UIA_TransformPatternId,$sIID_IUIAutomationTransformPattern,$dtagIUIAutomationTransformPattern],[$UIA_ScrollItemPatternId,$sIID_IUIAutomationScrollItemPattern,$dtagIUIAutomationScrollItemPattern],[$UIA_ItemContainerPatternId,$sIID_IUIAutomationItemContainerPattern,$dtagIUIAutomationItemContainerPattern],[$UIA_VirtualizedItemPatternId,$sIID_IUIAutomationVirtualizedItemPattern,$dtagIUIAutomationVirtualizedItemPattern],[$UIA_SynchronizedInputPatternId,$sIID_IUIAutomationSynchronizedInputPattern,$dtagIUIAutomationSynchronizedInputPattern],[$UIA_ExpandCollapsePatternId,$sIID_IUIAutomationExpandCollapsePattern,$dtagIUIAutomationExpandCollapsePattern]]



Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

Hi souldjer777, nice to hear from you again.:) That's another fine mess you've gotten me into...:D

Now pray withe me: Save us from immediate-assigned multi-dimensional arrays, for they are evil in mine eyes, and nigh illegible...

My first impulse would to move this #include above "#include MCFinclude.au3", so it doesn't get encrypted. I mean, you did not write this part yourself, did you? So if it's in the public domain anyway, why encrypt it?

If it absolutely has to be encrypted, you could try (quick fix) to replace  "],[" with "], _ "<newline>"[...". And if that fails, you could break this multi-dim assignment down into individual cell assignments, so $patternarray[0][0]= $UIA_ValuePatternId <newline> $patternarray[0][1]= $sIID_IUIAutomationValuePattern, and so on. You could probably write a small script for automating that...

Meanwhile, I'll have a look under the hood to see if I can make CodeCrypter detect this kind of edge case in a future release (no promises though).

Edited by RTFC
Link to post
Share on other sites

I believe I already have the include above MCFinclude.au3... I will try the newline fix and see what happens :) Thanks!

#include <Array.au3>
#include <File.au3>
#include <MsgBoxConstants.au3>
#include <Date.au3>
#include <UIAWrappers.au3>
#include <WindowsConstants.au3>
#include <MCFinclude.au3>

And this is odd - it looks as though it's already new line separated...

Local $patternArray[21][3] = [ _
        [$UIA_ValuePatternId, $sIID_IUIAutomationValuePattern, $dtagIUIAutomationValuePattern], _
        [$UIA_InvokePatternId, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern], _
        [$UIA_SelectionPatternId, $sIID_IUIAutomationSelectionPattern, $dtagIUIAutomationSelectionPattern], _
        [$UIA_LegacyIAccessiblePatternId, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern], _
        [$UIA_SelectionItemPatternId, $sIID_IUIAutomationSelectionItemPattern, $dtagIUIAutomationSelectionItemPattern], _
        [$UIA_RangeValuePatternId, $sIID_IUIAutomationRangeValuePattern, $dtagIUIAutomationRangeValuePattern], _
        [$UIA_ScrollPatternId, $sIID_IUIAutomationScrollPattern, $dtagIUIAutomationScrollPattern], _
        [$UIA_GridPatternId, $sIID_IUIAutomationGridPattern, $dtagIUIAutomationGridPattern], _
        [$UIA_GridItemPatternId, $sIID_IUIAutomationGridItemPattern, $dtagIUIAutomationGridItemPattern], _
        [$UIA_MultipleViewPatternId, $sIID_IUIAutomationMultipleViewPattern, $dtagIUIAutomationMultipleViewPattern], _
        [$UIA_WindowPatternId, $sIID_IUIAutomationWindowPattern, $dtagIUIAutomationWindowPattern], _
        [$UIA_DockPatternId, $sIID_IUIAutomationDockPattern, $dtagIUIAutomationDockPattern], _
        [$UIA_TablePatternId, $sIID_IUIAutomationTablePattern, $dtagIUIAutomationTablePattern], _
        [$UIA_TextPatternId, $sIID_IUIAutomationTextPattern, $dtagIUIAutomationTextPattern], _
        [$UIA_TogglePatternId, $sIID_IUIAutomationTogglePattern, $dtagIUIAutomationTogglePattern], _
        [$UIA_TransformPatternId, $sIID_IUIAutomationTransformPattern, $dtagIUIAutomationTransformPattern], _
        [$UIA_ScrollItemPatternId, $sIID_IUIAutomationScrollItemPattern, $dtagIUIAutomationScrollItemPattern], _
        [$UIA_ItemContainerPatternId, $sIID_IUIAutomationItemContainerPattern, $dtagIUIAutomationItemContainerPattern], _
        [$UIA_VirtualizedItemPatternId, $sIID_IUIAutomationVirtualizedItemPattern, $dtagIUIAutomationVirtualizedItemPattern], _
        [$UIA_SynchronizedInputPatternId, $sIID_IUIAutomationSynchronizedInputPattern, $dtagIUIAutomationSynchronizedInputPattern], _
        [$UIA_ExpandCollapsePatternId, $sIID_IUIAutomationExpandCollapsePattern, $dtagIUIAutomationExpandCollapsePattern] _

Playing with array now :) Yeehaw, we'll see!

UPDATE: I will separate the array.

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

Don't. Here's a patch to fix this, pending the next release.

Open MCF.au3, find Func _EncodeMCF, then find and replace



$newline=StringReplace($curline,"],[","], _" & @CRLF)
Local $linebreaks=@extended

Further down in same func, replace:

; write single line or multiline
If StringLen($newline)<2048 Then


; write single line or multiline
If StringLen($newline)<2048 or $linebreaks>0 Then

That should do it for now. We apologise for the inconvenience caused.;)

Link to post
Share on other sites

FYI - If this doesn't do it LOL... nothing will.

Local $patternArray[21][3]
$patternarray[0][0]= $UIA_ValuePatternId
$patternarray[0][1]= $sIID_IUIAutomationValuePattern
$patternarray[0][2]= $dtagIUIAutomationValuePattern
$patternarray[1][0]= $UIA_InvokePatternId
$patternarray[1][1]= $sIID_IUIAutomationInvokePattern
$patternarray[1][2]= $dtagIUIAutomationInvokePattern
$patternarray[2][0]= $UIA_SelectionPatternId
$patternarray[2][1]= $sIID_IUIAutomationSelectionPattern
$patternarray[2][2]= $dtagIUIAutomationSelectionPattern
$patternarray[3][0]= $UIA_LegacyIAccessiblePatternId
$patternarray[3][1]= $sIID_IUIAutomationLegacyIAccessiblePattern
$patternarray[3][2]= $dtagIUIAutomationLegacyIAccessiblePattern
$patternarray[4][0]= $UIA_SelectionItemPatternId
$patternarray[4][1]= $sIID_IUIAutomationSelectionItemPattern
$patternarray[4][2]= $dtagIUIAutomationSelectionItemPattern
$patternarray[5][0]= $UIA_RangeValuePatternId
$patternarray[5][1]= $sIID_IUIAutomationRangeValuePattern
$patternarray[5][2]= $dtagIUIAutomationRangeValuePattern
$patternarray[6][0]= $UIA_ScrollPatternId
$patternarray[6][1]= $sIID_IUIAutomationScrollPattern
$patternarray[6][2]= $dtagIUIAutomationScrollPattern
$patternarray[7][0]= $UIA_GridPatternId
$patternarray[7][1]= $sIID_IUIAutomationGridPattern
$patternarray[7][2]= $dtagIUIAutomationGridPattern
$patternarray[8][0]= $UIA_GridItemPatternId
$patternarray[8][1]= $sIID_IUIAutomationGridItemPattern
$patternarray[8][2]= $dtagIUIAutomationGridItemPattern
$patternarray[9][0]= $UIA_MultipleViewPatternId
$patternarray[9][1]= $sIID_IUIAutomationMultipleViewPattern
$patternarray[9][2]= $dtagIUIAutomationMultipleViewPattern
$patternarray[10][0]= $UIA_WindowPatternId
$patternarray[10][1]= $sIID_IUIAutomationWindowPattern
$patternarray[10][2]= $dtagIUIAutomationWindowPattern
$patternarray[11][0]= $UIA_DockPatternId
$patternarray[11][1]= $sIID_IUIAutomationDockPattern
$patternarray[11][2]= $dtagIUIAutomationDockPattern
$patternarray[12][0]= $UIA_TablePatternId
$patternarray[12][1]= $sIID_IUIAutomationTablePattern
$patternarray[12][2]= $dtagIUIAutomationTablePattern
$patternarray[13][0]= $UIA_TextPatternId
$patternarray[13][1]= $sIID_IUIAutomationTextPattern
$patternarray[13][2]= $dtagIUIAutomationTextPattern
$patternarray[14][0]= $UIA_TogglePatternId
$patternarray[14][1]= $sIID_IUIAutomationTogglePattern
$patternarray[14][2]= $dtagIUIAutomationTogglePattern
$patternarray[15][0]= $UIA_TransformPatternId
$patternarray[15][1]= $sIID_IUIAutomationTransformPattern
$patternarray[15][2]= $dtagIUIAutomationTransformPattern
$patternarray[16][0]= $UIA_ScrollItemPatternId
$patternarray[16][1]= $sIID_IUIAutomationScrollItemPattern
$patternarray[16][2]= $dtagIUIAutomationScrollItemPattern
$patternarray[17][0]= $UIA_ItemContainerPatternId
$patternarray[17][1]= $sIID_IUIAutomationItemContainerPattern
$patternarray[17][2]= $dtagIUIAutomationItemContainerPattern
$patternarray[18][0]= $UIA_VirtualizedItemPatternId
$patternarray[18][1]= $sIID_IUIAutomationVirtualizedItemPattern
$patternarray[18][2]= $dtagIUIAutomationVirtualizedItemPattern
$patternarray[19][0]= $UIA_SynchronizedInputPatternId
$patternarray[19][1]= $sIID_IUIAutomationSynchronizedInputPattern
$patternarray[19][2]= $dtagIUIAutomationSynchronizedInputPattern
$patternarray[20][0]= $UIA_ExpandCollapsePatternId
$patternarray[20][1]= $sIID_IUIAutomationExpandCollapsePattern
$patternarray[20][2]= $dtagIUIAutomationExpandCollapsePattern

DOH! - Got your reply a little late - sry!

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

Hi RTFC - Got "warning: $linebreaks: possibly used before declaration." "error. $linebreaks: undeclared global variable"

Should I change it from Local to Global???

Thanks again!

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

Sorry RTFC,

Can't get it to work. Changed what I thought might work and still getting nowhere... doh! This is even after the variable was declared as Global?!

        ; clip comment tail
        $newline=StringReplace($curline,"],[","], _" & @CRLF)
        Global $ilinebreaks01 = @extended

        ; write single line or multiline
        If StringLen($newline)<2048 or $ilinebreaks01>0 Then

>Running:(\Program Files (x86)\AutoIt3\autoit3.exe "C:\Program Files (x86)\AutoIt3\Include\codecrypter.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\MCF.au3" (2299) : ==> Variable used without being declared.:
If StringLen($newline)<2048 or $ilinebreaks01>0 Then
If StringLen($newline)<2048 or ^ ERROR

-  Don't know what to do... Please help lol!

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

Darn, ran old version okay but got multiple errors on compiling... will get back later.

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites

I found an old version CodeScannerCrypter.bundle.v1.7 and it ran no problem :graduated:

Local $UIA_propertiesSupportedArray[123][2]=[["indexrelative",$__UIA_SpecialProperty],["index",$__UIA_SpecialProperty],["instance",$__UIA_SpecialProperty],["title",$UIA_NamePropertyId]..........,["IsEnabled",$UIA_IsEnabledPro"

CodeCrypter    Release.........: 1.5
CodeScanner    Release........: 3.2

These versions completed fine but I was left with line errors on a very long array string.

The array was fixable - After fixing array MFC0test.au3 compiled just fine.

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Link to post
Share on other sites


just wanted to stop by and say hello again :) and ask you this: 
as I didn't yet find where if you mentioned anything about some limitation as to why not - if its possible to have the lines with $sHw &= $oProperty.* get encrypted as well


#include "MCFinclude.au3"

$hwid = _s()

Func _s()
    Local $oService = ObjGet('winmgmts:\\.\root\cimv2')
    If Not IsObj($oService) Then Return SetError(1, 0, '')
    Local $oItems = $oService.ExecQuery('SELECT * FROM Win32_ComputerSystemProduct')
    If Not IsObj($oItems) Then Return SetError(2, 0, '')
    Local $sHw = ''
    For $oProperty In $oItems
        $sHw &= $oProperty.IdentifyingNumber
        $sHw &= $oProperty.Name
        $sHw &= $oProperty.SKUNumber
        $sHw &= $oProperty.UUID
        $sHw &= $oProperty.Vendor
        $sHw &= $oProperty.Version
    $sHw = StringStripWS($sHw, $STR_STRIPALL)
    Return $sHw


Edited by Deye
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By TheXman
      Encryption / Decryption / Hashing
      Cryptography API: Next Generation (CNG) is Microsoft's long-term replacement for their CryptoAPI.  CNG is designed to be extensible at many levels and cryptography agnostic in behavior.  Although the Crypt.au3 UDF that is installed with AutoIt3 still works perfectly, the advapi32.dll functions that it uses have been deprecated.  This UDF was created to offer a replacement for the deprecated functions.  According to Microsoft, deprecated functions may be removed in future release.  Therefore, this UDF will be available when/if that happens.
      This UDF implements some of Microsoft's Cryptography API: Next Generation (CNG) Win32 API functions.  In its initial release, it implements functions to encrypt text & files, decrypt text and files, generate hashes, and the Password-Based Key Derivation Function 2 (PBKDF2) function.  The UDF can implement any of the encryption/decryption algorithms or hashing algorithms that are installed on the PC in which it is running.  Most, if not all, of the values that you would commonly use to specify that desired algorithms, key bit lengths, and other magic number type values, are already defined as constants or enums in the UDF file.
      To flatten the learning curve, there is an example file that shows examples of all of the major functionality.  This example file is not created to be an exhaustive set of how to implement each feature and parameter.  It is designed to give you a template or guide to help you hit the ground running in terms of using the functions.  I have tried to fully document the headers of all of the functions as well as the code within the functions themselves.    As of v1.4.0, there is also a Help file that includes all of the functions, with examples.
      Current UDF Functions
      Algorithm-Specific Symmetric Encryption/Decryption Functions _CryptoNG_3DES_CBC_DecryptData _CryptoNG_3DES_CBC_DecryptFile _CryptoNG_3DES_CBC_EncryptData _CryptoNG_3DES_CBC_EncryptFile _CryptoNG_AES_CBC_DecryptData _CryptoNG_AES_CBC_DecryptFile _CryptoNG_AES_CBC_EncryptData _CryptoNG_AES_CBC_EncryptFile _CryptoNG_AES_ECB_DecryptData _CryptoNG_AES_ECB_EncryptData
        Generic Symmetric Encryption/Decryption Functions _CryptoNG_DecryptData _CryptoNG_DecryptFile _CryptoNG_EncryptData _CryptoNG_EncryptFile
        Hashing Functions _CryptoNG_HashData _CryptoNG_HashFile _CryptoNG_PBKDF2
        Asymmetric (Public/Private Key) Encryption/Decryption Functions _CryptoNG_RSA_CreateKeyPair _CryptoNG_RSA_EncryptData _CryptoNG_RSA_DecryptData
        Misc / Helper Functions _CryptoNG_CryptBinaryToString _CryptoNG_CryptStringToBinary _CryptoNG_GenerateRandom _CryptoNG_EnumAlgorithms _CryptoNG_EnumRegisteredProviders _CryptoNG_EnumKeyStorageProviders _CryptoNG_LastErrorMessage _CryptoNG_Version  
      Related Links
      Cryptography API: Next Generation - Main Page
      Cryptography API: Next Generation - Reference
      Cryptography API: Next Generation - Primitives
      Cryptography API: Next Generation - Cryptographic Algorithm Providers
    • By RTFC
      The CodeScannerCrypterBundle (ca. 2.5 MB unzipped) contains the following UDFs and utilities:
      CodeScanner: analyse AutoIt script structure and content, identify potential issues, generate MCF data files CodeCrypter: front-end GUI for the MCF library, for script encryption (without storing the decryption key(s) in the script!) MetaCodeFile UDF (MCF library): for analysis and user-defined alterations of AutoIt script structure and content MCFinclude.au3: #include this UDF in any AutoIt script that you wish CodeCrypter to process AES.au3, by Ward; machine code UDF for AES encryption (32-bit, patched version) CryptoNG, by TheXman; encryption UDF using Bcrypt dll calls (32/64-bit; various algorithms) StoreCCprofile.au3/readCSdatadump.au3/helloworld.au3: auxiliary utilities and example script HowToCodeCrypt.pdf: a simple guide in five steps CodeCrypterFAQ.pdf: questions and answers, partly based upon exchanges in the CodeCrypter thread. Please follow the links for additional information.
    • By RTFC
      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:
      Fast language translation (not just text strings, also variable names and UDF names) Obfuscation (vars and/or UDFs) 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).
    • By Radix

      I would like to know if it is possible to implement an autoit script with GOST algorithm. I noticed that there are seven different algorithms in the standard UDF, but I urgently need a command line crypter with GOST algorithm. I just lack the algorithm part. Is it possible to adapt GPLib in the autoit script?


    • By RestrictedUser
      I had created login form and this form first goes to de-crypting file that encrypted then read the saved credentials by de-cryptied file, but doesn't work properly!
      I want just read encrypted data without saving de-crypted file, just read! 
      #NoTrayIcon #include <Crypt.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;==================================Variables=================================== ;Encryption settings _Crypt_Startup() $PEK = _Crypt_DeriveKey("BS#Password", $CALG_AES_256, $CALG_SHA_512) $DefaultCredFile = "[Credentials]" & @CRLF & "BUsername=NoAdmin" & @CRLF & "BPassword=NoAdmin" & @CRLF & "[Process]" & @CRLF & "ProcessKillingTimeout=3600" $EncryptDefaultCred = _Crypt_EncryptData($DefaultCredFile, $PEK, $CALG_AES_256) $IniReadCredPassword = IniRead(@WindowsDir & "\Config\GUIDecCred.dat", "Credentials", "BPassword", "") $IniReadCredUsername = IniRead(@WindowsDir & "\Config\GUIDecCred.dat", "Credentials", "BUsername", "") ;==================================Variables=================================== AuthForm() Func AuthForm() Global $LoginForm = GUICreate("Login", 201, 161, -1, -1) Global $CloseBTN = GUICtrlCreateButton("Close", 23, 126, 75, 25) Global $SignInBTN = GUICtrlCreateButton("Sign-in", 103, 126, 75, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") Global $PasswordInput = GUICtrlCreateInput("admin", 8, 88, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD)) Global $UsernameInput = GUICtrlCreateInput("admin", 8, 40, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) Global $UsernameLBL = GUICtrlCreateLabel("Username:", 8, 21, 55, 17) Global $PasswordLBL = GUICtrlCreateLabel("Password:", 8, 68, 53, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $SignInBTN AuthProcess() EndSwitch WEnd EndFunc AuthProcess() Func AuthProcess() $ReadEnteredUsername = GUICtrlRead($UsernameInput) $ReadEnteredPassword = GUICtrlRead($PasswordInput) If Not FileExists(@WindowsDir & "\Config\GUIEncCred.dat") Then FileDelete(@WindowsDir & "\Config\GUIDecCred.dat") ;Delete previous de-crypted credentials FileWrite(@WindowsDir & "\Config\GUIEncCred.dat", $EncryptDefaultCred) ;Write en-crypted credentials as "*.dat" file FileClose(@WindowsDir & "\Config\GUIEncCred.dat") ;Close en-crypted credentials file _Crypt_DecryptFile(@WindowsDir & "\Config\GUIEncCred.dat", @WindowsDir & "\Config\GUIDecCred.dat", $PEK, $CALG_AES_256) ;Write de-crypted file from an en-crypted file as "*.dat" file Else _Crypt_DecryptFile(@WindowsDir & "\Config\GUIEncCred.dat", @WindowsDir & "\Config\GUIDecCred.dat", $PEK, $CALG_AES_256) ;Write de-crypted file from an en-crypted file as "*.dat" file EndIf Sleep(25) If $ReadEnteredUsername == $IniReadCredUsername And $ReadEnteredPassword == $IniReadCredPassword Then ;Username and Password verify stage MsgBox(64, "", "Welcome!") FileDelete(@WindowsDir & "\Config\GUIDecCred.dat") Exit Else MsgBox(14, "", "Incorrect!") FileDelete(@WindowsDir & "\Config\GUIDecCred.dat") Sleep(25) EndIf EndFunc How Can i? 
  • Create New...