sylremo Posted June 21, 2023 Posted June 21, 2023 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.
sylremo Posted June 21, 2023 Author Posted June 21, 2023 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 😓
ioa747 Posted June 21, 2023 Posted June 21, 2023 Try with this Local $sAnswer = InputBox("Question", "Where were you born?", "Planet Earth", "", - 1, -1, 0, 0) MsgBox(262144, 'were?', $sAnswer) I know that I know nothing
sylremo Posted June 21, 2023 Author Posted June 21, 2023 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.
Andreik Posted June 21, 2023 Posted June 21, 2023 Since functions in AutoIt are first-class objects why not simple Local $hInputBox = InputBox? Is this also related to your codebase?
sylremo Posted June 21, 2023 Author Posted June 21, 2023 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?
Andreik Posted June 21, 2023 Posted June 21, 2023 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.
pixelsearch Posted June 21, 2023 Posted June 21, 2023 @sylremo it should work if you add this line at the beginning of the script : #pragma compile(inputboxres, true) "I think you are searching a bug where there is no bug... don't listen to bad advice."
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now