Jump to content

Recommended Posts

Posted

Today I've discovered a weird behavior when combining Execute with InputBox.

Local $hInputBox = Execute('InputBox')

Local $sInput = $hInputBox('Title', 'Prompt')

MsgBox(262144, 'Why?', $sInput)

This script, while uncompiled, pops up the input box window. But after being compiled, the script completely ignores the input box line and goes straight to the msgbox.

AutoIt v3.3.16.0 @ Windows 10 Build 19045.3086 / Tested on both x86 and x64.
 

Posted

I've found out that InputBox must be specified explicitly at least once for the compiler (or something else that is responsible for this) to embed the Dialog resource into the PE. And if I don't:

Quote

If your script is going to use an inputbox you must include the pragma directive "#pragma compile(inputboxres, true)"


Fool me 😓

Posted
2 minutes ago, ioa747 said:

Try with this

Local $sAnswer = InputBox("Question", "Where were you born?", "Planet Earth", "", - 1, -1, 0, 0)

MsgBox(262144, 'were?', $sAnswer)

 

I think trying to be sarcastic here is unnecessary. I intentionally did this line "Local $hInputBox = Execute('InputBox')" because It's related to my bigger codebase, I tried to reduce it to the bare minimum to reproduce the problem.

Posted
2 minutes ago, Andreik said:

Since functions in AutoIt are first-class objects why not simple Local $hInputBox = InputBox? Is this also related to your codebase?

Actually yes, if not, why would I bother making things more complicated? I'm developing my own obfuscator, so to make things clear, by putting InputBox inside Execute is a simple method to hide its presence on the script. What else about my "codebase" do you need to know @Andreik?

Posted
4 minutes ago, sylremo said:

Actually yes, if not, why would I bother making things more complicated? I'm developing my own obfuscator, so to make things clear, by putting InputBox inside Execute is a simple method to hide its presence on the script. What else about my "codebase" do you need to know @Andreik?

That's a good joke but I get it. I am not interested at all to know details about anyone's projects, I just wondered why not use the full power of first-class objects. :ninja:

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
×
×
  • Create New...