Sign in to follow this  
Followers 0
MrCreatoR

How to get access for a3x encoded files?

14 posts in this topic

Hi,

I am using a3x encoded files as some sort of plug-ins for my app. So i was wondering, is it possible to get for example the value from some variable inside a3x script?

I want to be able not only get values, but also to set them.

P.S

And i am not talking about get access on "execution level", i need it on strings/files level (get/set values inside the file on hard drive, like read/write data).


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites



Hi,

I am using a3x encoded files as some sort of plug-ins for my app. So i was wondering, is it possible to get for example the value from some variable inside a3x script?

I want to be able not only get values, but also to set them.

P.S

And i am not talking about get access on "execution level", i need it on strings/files level (get/set values inside the file on hard drive, like read/write data).

Maybe you could try with env. variables, for example to get/set an environmental variable in a plugin and then to read it from main program.

I can do signature me.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

a3x is in fact some program you wrote.

When some script is compiled to exe that file (a3x) is attached to the exe and executed aterward (on the run).

So, changing it like you suggested inside the brackets would involve decompiling and that is not... good.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Maybe you could try with env. variables, for example to get/set an environmental variable in a plugin and then to read it from main program.

Please read again my post (P.S).

a3x is in fact some program you wrote.

I know what it is :( Thanks.

When some script is compiled to exe that file (a3x) is attached to the exe and executed aterward

No, this file is just like compiled script but without the main interpretator (AutoIt3.exe), i run it like this: Run(@AutoIt3Exe & ' /AutoIt3ExecuteScript "File.a3x"')

changing it like you suggested inside the brackets would involve decompiling and that is not... good.

Well, yes, i supose i looking for a way to decompile it (with AutoIt only), change/read values, and compile it back... or maybe there is another way? something like reading in some binary mode? :P

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

@MrCreatoR

Maybe you could compile them with an older version so you can use the official decompiler? To automate a decompile, fileread and then compile again doesn't sound very hard to do.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I didn't try to imply that you dont't know. I was talking about a3x generally.

Third sentence should look like this:

"So, changing it (or any other a3x) like you suggested inside the brackets would involve decompiling and that is not... good."

Decompiling, when talking about AutoIt, is "converting" a3x to au3.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

@MrCreatoR

I am not sure if this can help you. But is EXECUTE not helping you ?

look at my : dynamic functions

You can set values after a script is compiled, passing it to a function and get the different return.

But propably you already knew this.

Regards,

ptrex

Share this post


Link to post
Share on other sites

@AdmiralAlkex

Maybe you could compile them with an older version so you can use the official decompiler?

Well, the problem here is that the old version was not supporting some of the features that used in my scripts :P.

@ptrex

I am not sure if this can help you. But is EXECUTE not helping you ?

Thanks, but i really can't see how Execute() can help me with set data for compiled scripts? (a3x encoded scripts).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

@ptrex;

I believe you are missing the point of what MrCreatoR is trying to do or accomplish.

I made a little script to show how I see it:

Dim $Button_1, $Button_2, $msg

Dim $s_code = "0xA3484BBE986C4AA9994C530A86D6487D41553321454130360AD9781764D15AEA" _
         & "D9B586AD81CC27346B43CA52AFAD0000E6FB2578C8E213F97D1DEDDD7100B055" _
         & "2DAC9AD52815D4F0CF25E4CF118E56C2CE3F70EFB9680DF8000063B5B4871A95" _
         & "6E286CC76547F83A1E1233FDCA6D3F6D54791F748D8071B4D825BCD4C1CF755E" _
         & "81D224EA1ABB102BA92AD4CEF938AFDA6FB1BCE548C7893C187530AE627BA2F8" _
         & "5A33B46E456FF91C6AEC9077671D9C910411E5F901E4860000C886000098CDCA" _
         & "1D222DC901225B792B222DC901225B792B6DFBFA03B38B3FCDD2F7788E35DAC4" _
         & "265CD2E6F22AEE552F6AAEF5AFE024A7318C4DD3FED67C7B89A1FA99D587EFE0" _
         & "791509985BE5503DBF68CE0CB7072C5CA3DD3562EDF269478198279D1DFA5193" _
         & "6F06F490A6962EF54A5F5EC18056D829E2E0EF01D5C74D8465D7A00C9018E7C8" _
         & "C80C17BE208438033BF6ECA3E99BFD6C186FABCB5177E11BCCDA42827618575A" _
         & "B40C3F119B28D1D4BB8DEE25CCF69D3D7F2F4E3ED724281C5691A257DE930E19" _
         & "4BE3324F689FC5FD94E934C5467A12143CAECF39A90A561ECE2DD2938F5540B7" _
         & "457EFE4B3FCC3354C97A334987FED3C3569283AFFEFFD10258394A0830DF1999" _
         & "8E852636B9DBA20C1AEC0418C9F19C89E6518C84E39C2E3218F2BF9C2F0FEFFD" _
         & "1DF82A95264AEA77D38648128A92652952343E593C15A82626A9E0EF807A3EC5" _
         & "CF5F9BAA2D6B12A7B06C63EDB1940F9FC0509BB5A5F02CCB8B2BD3D195E9DF9F" _
         & "8B974190477E2CF1664155332145413036"

Dim $s_code_altered = "0xA3484BBE986C4AA9994C530A86D6487D415533214541303638FDAF9F1582AE65" _
         & "5F48EED3957A56CC6B43CA52AFAD0000E6FB2578C8E213F97D1DEDDD7100B055" _
         & "2DAC9AD52815D4F0CF25E4CF118E56C2CE3F70EFB9680DF8000063B5B4871A95" _
         & "6E286CC76547F83A1E1233FDCA6D3F6D54791F748D8071B4D825BCD4C1CF755E" _
         & "81D224EA1ABB102BA92AD4CEF938AFDA6FB1BCE548C7893C187530AE627BA2F8" _
         & "5A33B46E456FF91C6AEC9777671D9C910411E5F901E4860000C88600005ACE52" _
         & "46222DC90138DA0915222DC90138DA09156DFBFA03B38B3FCDD2F7788E35DAC4" _
         & "265CD2E6F22AEE552F6AAEF5AFE024A7318C4DD3FED67C7B89A1FA99D587EFE0" _
         & "791509985BE5503DBF68CE0CB7072C5CA3DD3562EDF269478198279D1DFA5193" _
         & "6F06F490A6962EF54A5F5EC18056D829E2E2EF01D5874D9465D3A00D9018A7C8" _
         & "D80C17BD207C232E80F668A126E0F938B04D22CB514499274C9415E8375A567F" _
         & "254A34919FA8DDD4EC8D88235CF5E1D35F57F8FAE6535B5CA691D2799E8538B1" _
         & "8AAB310769DFF34B15AC083E0B6E01DB887E0EBB500AC884E0DD5D7FA504E7B8" _
         & "07EAE58271AFC3307E28075FB27EF1C20DAD16AFFBEE49C4DE51801BF8ABEE9C" _
         & "F0844999BDD9B46F7ED42537FE323F9AACBCAC08BF313C30D8F2B39BFA546BAD" _
         & "92CD0A96426F95BF4029B3C0E294D523D2921658FCC1AD107D29A02F3471AED7" _
         & "4E71B1AAB8E96AB082825AF561B5CABFC860D3B7D9F76CC00987D714EAF10170" _
         & "545EAC65FE0E372EA64155332145413036"


GUICreate("Main window", 260, 100)

$Button_1 = GUICtrlCreateButton("Execute first", 20, 30, 100)
$Button_2 = GUICtrlCreateButton("Execute second", 140, 30, 100)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = -3
            ExitLoop
        Case $msg = $Button_1
            _ExecuteScript($s_code)
        Case $msg = $Button_2
            _ExecuteScript($s_code_altered)
    EndSelect
WEnd

Func _ExecuteScript($code)
    
    Local $TypeLib = ObjCreate("Scriptlet.TypeLib")
    Local $tmp = @TempDir & "\~" & $TypeLib.Guid & "tempexec.tmp"
    Local $hwnd = FileOpen($tmp, 26)
    FileWrite($hwnd, $code)
    FileClose($hwnd)
    Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"')
    
EndFunc

Inside that script are two more scripts presented by "$s_code" and "$s_code_altered". That is binary data of new scripts (a3x).

Main script dropp that codes to @TempDir to randomly named created script (first line of that cript is "FileDelete(@ScriptFullPath)" to avoid trash).

FileInstall() could be used but then it wouldn't be compact enough to show it here to make a point.

What MrCreatoR is traying to do is change "$s_code" to "$s_code_altered". First one is:

MsgBox(0,"Test", "First script")
and the second one is:
MsgBox(0,"Test", "Second script")

How can he do that?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

@ptrex

Did you bother to run the script I referred to ?

Try it and see if this concept can help you.

Sure, i will never say that something doesn't help/work until i check it and be sure by 110% :P - And i very appreciate that you trying to help me.

@trancexx

Thanks for the example, that help a litle to understand what i need. But lets put it simpler....

Ok, please download this file (253 byte!).

This file compiled as a3x script (Plugin.a3x), this script originaly have only one line:

$MyVar = 0

Now from the Main script (for example Main.au3), i need to change $MyVar = 0 to $MyVar = 1, i don't need to execute the script at all, only change that value. The challenge here is the encoded script, that's it.

If this script wasn't compiled, i could do something like this:

Main.au3:

$sReadPlugin = FileRead("Plugin.au3")

$hFOpen = FileOpen("Plugin.au3", 2)
FileWrite($hFOpen, StringRegExpReplace($sReadPlugin, "(?s)(?m)(\$MyVar) = \d+", "\1 = 1"))
FileClose($hFOpen)

I hope now it's more understandable :(


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

@trancexx

Are you not missing the point ?

$buffer = StringToBinary(@UserName)
ConsoleWrite( "String() representation " & $buffer & @CRLF)
ConsoleWrite( @CRLF)
$buffer = BinaryToString($buffer)
MsgBox(0,"BinaryToString Auto Executed ", $buffer & @CRLF)


Dim $s_code = "0x62657061746165"
Execute(ConsoleWrite("What about this : " & BinaryToString($s_code) & @CRLF) )

Enjoy !!

regards

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites

@trancexx

Are you not missing the point ?

$buffer = StringToBinary(@UserName)
ConsoleWrite( "String() representation " & $buffer & @CRLF)
ConsoleWrite( @CRLF)
$buffer = BinaryToString($buffer)
MsgBox(0,"BinaryToString Auto Executed ", $buffer & @CRLF)


Dim $s_code = "0x62657061746165"
Execute(ConsoleWrite("What about this : " & BinaryToString($s_code) & @CRLF) )

Enjoy !!

regards

ptrex

Indeed.

But looking at the first post -no.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

@ptrex

Sure, i will never say that something doesn't help/work until i check it and be sure by 110% :P - And i very appreciate that you trying to help me.

@trancexx

Thanks for the example, that help a litle to understand what i need. But lets put it simpler....

Ok, please download this file (253 byte!).

This file compiled as a3x script (Plugin.a3x), this script originaly have only one line:

$MyVar = 0

Now from the Main script (for example Main.au3), i need to change $MyVar = 0 to $MyVar = 1, i don't need to execute the script at all, only change that value. The challenge here is the encoded script, that's it.

If this script wasn't compiled, i could do something like this:

Main.au3:

$sReadPlugin = FileRead("Plugin.au3")

$hFOpen = FileOpen("Plugin.au3", 2)
FileWrite($hFOpen, StringRegExpReplace($sReadPlugin, "(?s)(?m)(\$MyVar) = \d+", "\1 = 1"))
FileClose($hFOpen)

I hope now it's more understandable :(

Ye, you should have been saying that before!

No, it is not possible, until you break down Jon's encryption


I can do signature me.

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
Sign in to follow this  
Followers 0