Obfuscating code in AutoIt3 - obfuscation

Some1 know which obfuscator obfuscate variables like this?
$a3a83605e4a
And functions like this?
Func a2060102a0b($a0c9b315f62, $a199bf1090b = 0, $a58ab015626 = False)
If NOT IsDeclared("SSA2060102A0B") Then
Global $a40ab115d31 = a2a0000482b($os[3999]), $a4fab210961 = a2a0000482b($os[4000]), $a09ab311939 = a2a0000482b($os[4001]), $a25ab415f29 = a2a0000482b($os[4002]), $a53ab510350 = a2a0000482b($os[4003]), $a06ab61560c = a2a0000482b($os[4004]), $a57ab714857 = a2a0000482b($os[4005]), $a2dab81175c = a2a0000482b($os[4006]), $a0aab91562a = a2a0000482b($os[4007]), $a26aba10a40 = a2a0000482b($os[4008]), $a31abb11452 = a2a0000482b($os[4009]), $a19abc1013c = a2a0000482b($os[4010]), $a46abd1244d = a2a0000482b($os[4011]), $a61abe16335 = a2a0000482b($os[4012]), $a02abf1395e = a2a0000482b($os[4013])
Global $ssa2060102a0b = 1
EndIf
If $a199bf1090b = Number($a40ab115d31) Then $a199bf1090b = a05a0d0391a()
If #error Then Return SetError(Number($a4fab210961), #extended, Number($a09ab311939))
Local $a49f0d12024 = DllCall($a25ab415f29, $a53ab510350, $a06ab61560c, $a57ab714857, $a199bf1090b, $a2dab81175c, $a0c9b315f62, $a0aab91562a, $a58ab015626, $a26aba10a40, Number($a31abb11452))
If #error OR NOT $a49f0d12024[Number($a19abc1013c)] Then Return SetError(Number($a46abd1244d), #extended, Number($a61abe16335))
Return $a49f0d12024[Number($a02abf1395e)]
EndFunc

Until recently, the full version of the SciTE editor was shipped with an obfuscator, which with correct flags would just change variable names (though by default does much more). This has since changed to a "stripper" which performs a similar function, but for the primary purpose of making scripts smaller as opposed to difficult to read.
Au3Stripper is available for download here (scroll to the bottom of the page for the standalone version)
You may be able to find previous versions of the Obfuscator online (there is no official page for downloading old versions as far as I know).
There are some alternatives, such as one on the German forums here, though I haven't used it so can't say how good it is, or if the output matches what you are looking for.

It might be AutoIt Obfuscator from https://www.pelock.com/products/autoit-obfuscator
It seems it's using similar obfuscation techniques.

Related

Libreoffice Base - how to call a control event from a macro?

Question: I need to manually call an object listener event (e.g. key pressed) to trigger a function. I used to do it in Access but haven't found the documentation for it in LibreOffice Base.
Context: Having retired from software development 7 years ago, I am doing a favour for a friend by building a database in LibreOffice Base. Previously experienced in Access - but more with Oracle, PL/SQL, APEX, etc! I am struggling a little in getting it to do what I know can be done!
Here is the code I've tried so far.
Sub CauseKeyPressedEventToBeFired
oDoc = ThisComponent
oController = oDoc.getCurrentController()
oVC = oController.getViewCursor()
oForm = oDoc.getDrawpage().getForms().getByName("Form")
oTextBox = oForm.getByName("Text Box 1")
oControlView = oController.getControl(oTextBox)
oControlView.setFocus()
Dim oEvent As New com.sun.star.awt.KeyEvent
oEvent.Source = oControlView
oEvent.KeyCode = com.sun.star.awt.Key.A
oControlView.keyPressed(oEvent)
End Sub
However, it doesn't seem to work on my system (LibreOffice 6.4.3.2 on Windows). I also found this post, but that code doesn't seem to work for me either.
I searched for com.sun.star.awt.XToolkitRobot, but it's not in the API documentation, perhaps because the functionality is not fully supported. Presumably, it can be obtained from com.sun.star.awt.Toolkit.
For more help, post a question on ask.libreoffice.org. I'd suggest explaining why you want to do this, because there may be a different kind of solution. Ratslinger has a lot of experience solving various database problems, and he'll probably direct you toward a simpler solution that doesn't involve this kind of event hacking.
a function (i.e. a procedure that returns a value)
Yes, that is what a function is. But "an object listener event" implies, correctly I think, that we're talking about the method of an object instead. That's what LibreOffice event listeners are in Python or Java, although in Basic, they're a little strange, using the object name as some kind of magic to determine what they apply to. Anyway, that's getting off track, because your question isn't about listening for events, but rather about triggering them.
EDIT:
The following Python code works. The problem with my earlier attempts was that oEvent.KeyChar needs to be set, and that doesn't seem to work in Basic. I can't imagine why, unless I am ignoring some obvious mistake in the Basic code.
def causeKeyPressedEventToBeFired(oEvent=None):
oDoc = XSCRIPTCONTEXT.getDocument()
oController = oDoc.getCurrentController()
oForm = oDoc.getDrawPage().getForms().getByName("Form")
oTextBox = oForm.getByName("Text Box 1")
oControlView = oController.getControl(oTextBox)
oControlView.setFocus()
oEvent = uno.createUnoStruct("com.sun.star.awt.KeyEvent")
oEvent.Source = oControlView
from com.sun.star.awt.Key import A
oEvent.KeyCode = A
oEvent.KeyChar = "a" # works in Python but strangely not in Basic
simulate_KeyPress(oEvent)
def simulate_KeyPress(oKeyEvent):
oDoc = XSCRIPTCONTEXT.getDocument()
oWindow = oDoc.CurrentController.Frame.getContainerWindow()
oKeyEvent.Source = oWindow
oToolkit = oWindow.getToolkit()
oToolkit.keyPress(oKeyEvent)
oToolkit.keyRelease(oKeyEvent)
EDIT 2:
Finally, here is working Basic code. In the earlier attempt, the type was wrong.
Sub CauseKeyPressedEventToBeFired
oDoc = ThisComponent
oController = oDoc.getCurrentController()
oForm = oDoc.getDrawpage().getForms().getByName("Form")
oTextBox = oForm.getByName("Text Box 1")
oControlView = oController.getControl(oTextBox)
oControlView.setFocus()
Dim oEvent As New com.sun.star.awt.KeyEvent
oEvent.KeyCode = com.sun.star.awt.Key.A
oEvent.KeyChar = CByte(97)
simulate_KeyPress(oEvent)
End Sub
Sub simulate_KeyPress(oKeyEvent As com.sun.star.awt.KeyEvent)
oWindow = ThisComponent.CurrentController.Frame.getContainerWindow()
oKeyEvent.Source = oWindow
oToolkit = oWindow.getToolkit()
oToolkit.keyPress(oKeyEvent)
oToolkit.keyRelease(oKeyEvent)
End Sub

Bazel: using macros to generate build rules from lists

I'm new to Bazel and got a question regarding Bazel macros. I'm looking for the best way to structure our build.
Is it possible to iterate over a list containing the specifics to the build rules?
For example I have a list containing srcs,deps,hdrs,name etc. This list is combined into one larger list containing all modules i want to build creating one component.
If possible can someone give a short example how this would look in code?
Thanks for your time
ok i got it:
Content of Build.bazel:
load(":macro.bzl","buildmacro")
load(":SrcList.bzl","SrcLists","CommonDependencies")
[buildmacro(
current_module_name = Module[0][0],
current_module_srcs=Module[1],
current_module_hdrs=Module[2],
current_module_deps=Module[3] + CommonDependencies,
)for Module in SrcLists]
Content of macro.bzl:
def buildmacro(current_module_name,current_module_srcs,current_module_hdrs,current_module_deps):
native.cc_library(
name = current_module_name,
deps = current_module_deps,
srcs = current_module_srcs,
hdrs = current_module_hdrs,
linkstatic = 1,
visibility = ["//visibility:public"],
)
Example of the SrcLists-file:
listofcode = [["nameofrule"]["srcfiles"]["headers"]["deps"]...]
listofcode2 = ...
SrcLists = [listofcode] + [listofcode2] ...
execute bazel build :all

Icelandic language process in R

I'm a student doing some research with R.
I tried to put some icelandic language in array but R automatically convert this to english.
artist = vector()
artist[1] = "CHVRCHES"
artist[2] = "Fall-Out-Boy"
artist[3] = "Green-day"
artist[4] = "Sigur-Rós"
When I try to call 4th item of 'artist' array, console's output is like
Sigur-Ros
not
Sigur-Rós
Thus, I looked out for some question that might help me with encoding mess like
artist[4] = stri_conv("Sigur-Rós","","UTF-8")
or
artist[4] = iconv("Sigur-Rós","","UTF-8")
But console showed the same output.
I'm doing this on Rstudio and my R version is 3.1.2 . Workspace is Windows 8.1, 64-bit.
Can anyone know how to deal with this encoding problem? I really need some help.

Need to figure out how to use DeepZoomTools.dll to create DZI

I am not familiar with .NET coding.
However, I must create DZI sliced image assets on a shared server and am told that I can instantiate and use DeepZoomTools.dll.
Can someone show me a very simple DZI creation script that demonstrates the proper .NET coding technique? I can embellish as needed, I'm sure, but don't know where to start.
Assuming I have a jpg, how does a script simply slice it up and save it?
I can imagine it's only a few lines of code. The server is running IIS 7.5.
If anyone has a simple example, I'd be most appreciative.
Thanks
I don't know myself, but you might ask in the OpenSeadragon community:
https://github.com/openseadragon/openseadragon/issues
Someone there might know.
Does it have to be DeepZoomTools.dll? There are a number of other options for creating DZI files. Here are a few:
http://openseadragon.github.io/examples/creating-zooming-images/
Example of building a Seadragon Image from multiple images.
In this, the "clsCanvas" objects and collection can pretty much be ignored, it was an object internal to my code that was generating the images with GDI+, then putting them on disk. The code below just shows how to get a bunch of images from file and assemble them into a zoomable collection. Hope this helps someone :-).
CollectionCreator cc = new CollectionCreator();
// set default values that make sense for conversion options
cc.ServerFormat = ServerFormats.Default;
cc.TileFormat = ImageFormat.Jpg;
cc.TileSize = 256;
cc.ImageQuality = 0.92;
cc.TileOverlap = 0;
// the max level should always correspond to the log base 2 of the tilesize, unless otherwise specified
cc.MaxLevel = (int)Math.Log(cc.TileSize, 2);
List<Microsoft.DeepZoomTools.Image> aoImages = new List<Microsoft.DeepZoomTools.Image>();
double fLeftShift = 0;
foreach (clsCanvas oCanvas in aoCanvases)
{
//viewport width as a function of this canvas, so the width of this canvas is 1
double fThisImgWidth = oCanvas.MyImageWidth - 1; //the -1 creates a 1px overlap, hides the seam between images.
double fTotalViewportWidth = fTotalImageWidth / fThisImgWidth;
double fMyLeftEdgeInViewportUnits = -fLeftShift / fThisImgWidth; ; //please don't ask me why this is a negative numeber
double fMyTopInViewportUnits = -fTotalViewportWidth * 0.3;
fLeftShift += fThisImgWidth;
Microsoft.DeepZoomTools.Image oImg = new Microsoft.DeepZoomTools.Image(oCanvas.MyFileName.Replace("_Out_Tile",""));
oImg.ViewportWidth = fTotalViewportWidth;
oImg.ViewportOrigin = new System.Windows.Point(fMyLeftEdgeInViewportUnits, fMyTopInViewportUnits);
aoImages.Add(oImg);
}
// create a list of all the images to include in the collection
cc.Create(aoImages, sMasterOutFile);

Silverlight replacement for BinaryReader.ReadDecimal

In Silverlight 4, BinaryReader doesn't seem to have any ReadDecimal() method.
Reflector shows that it's there but with internal visibility, rather than public.
Aside from using that one via dynamic trickery or Reflection, has anyone got a good workaround for getting it. Or is this all part of the plan?
Erica Aside: amusingly, Reflector also shows that there are 10 InternalsVisibleToAttributes in the Ag mscorlib (sadly none to mine :D), which I assume, at 512+ bytes a go gives plenty scope for optimization! I'm sure Bob is in there too :D
There is no direct replacement, but you can achieve the same result like this:
// write it, assume bw = BinaryWriter
var bits = decimal.GetBits(myDecimal);
bw.Write(bits[0]);
bw.Write(bits[1]);
bw.Write(bits[2]);
bw.Write(bits[3]);
// read it, assume br = BinaryReader
var bits = new int[4];
bits[0] = br.ReadInt32();
bits[1] = br.ReadInt32();
bits[2] = br.ReadInt32();
bits[3] = br.ReadInt32();
return new decimal(bits);

Resources