Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

(RESOLVED) How to find the error by the line number returned from the compiled EXE?

error line number exe compiled

  • Please log in to reply
60 replies to this topic

#1 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 11:24 AM

Hi guys,
please bare with me for a moment here...

My goal: To be able to take the error line number returned by the EXE file and locate the actual line in the source.
I believe most of the AutoIt users are coming to this issue at some point.

I realize the final source, before the compilation is done, is the combined source of all the include files and the main script etc. So I figured if I have a way to get this combined source, that would give me a solution to this problem. And I spent the last couple of days (more than 10 hours a day) searching in the forum and asking some questions in different threads. And with the help of few people, I found a way (using the Obfuscator) to get this source and the line numbers were actually MATCHING!

However this solution introduced a WHOLE LOT of other problems for me and broke some of the functionality in my script since it has a lot of Call() and ObjEvent() functions. My code turned out to be un-obfuscatable. And for the record, I do not need any obfuscation done at all, nor I need the unused included functions stripped down (even though it made my EXE a 30% smaller). I needed the Obfuscator just to get this final piece of code to be able to achieve My goal.

So all this got me thinking... Please correct me if I'm wrong, because I don not have any knowledge of the internals of a compiler.
Since Aut2exe is the one that combines all the code together and then working it's magic to create the EXE, there should be a pint in this process where that code is available in its final form. Then why isn't there a command line option to dump the final combined source in a file just before it is compiled?
Once again, I do not know the internals of the compiler but my logic dictates that this would be the most reasonable and straightforward solution.

Please share your thoughts and also, if any of you knows a way to achieve my goal without using the Obfuscator, I would LOVE to here it!

EDIT: And here is the solution: ( I've tried to explain it as simply as I can, so even the beginners can understand it.)
Spoiler

Edited by dv8, 25 February 2012 - 07:57 PM.








#2 Manadar

Manadar

         

  • MVPs
  • 10,835 posts

Posted 24 February 2012 - 11:42 AM

All it does is read out any include files and simply copy-paste them in your script. If you do this manually, it will take you 5 minutes. If you write a program to do this, it will take you 10 minutes.

Good luck.

#3 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 11:56 AM

Thank you. Is this the way you do it? If it is, why don't you share your program?
I will sure try to do that and I may solve my problem this way. However this will not do much good to the next user who bumps into this problem.
And may I ask, what good is that line number for, if this line number does not exists anywhere in the scripts for reference?
The fact that this number is there suggests that there should be a way to get to it, right?
I'll do some programming after my lunch and post the solution here if I manage to get satisfactory results.

#4 Manadar

Manadar

         

  • MVPs
  • 10,835 posts

Posted 24 February 2012 - 12:11 PM

This is a trivial problem. Anyone can solve it in 10 minutes. I don't have the code to do it or I would have shared it with you. Who do you think I am? Some kind of person who doesn't share his code... No. There is probably a configuration for obfuscator to do this as well. Fortunately for you, obfuscator is well documented.

I say again: Good luck.

This is such a trivial thing to do that it's not worth annoying me or anyone about. Starting thinking before doing and you'll do just fine.

#5 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 12:27 PM

As I mentioned above I spent the A LOT of time reading through the Obfuscator documentation and testing different configuration options. And again as I stated above it only brought more problems on the table instead of solving this "trivial" one for me.
And maybe because it is so "trivial", there is no solution to it offered by anyone yet.

I say again: Thank you!

Believe me, I do A LOT of thinking and reading, then testing, before doing and I do just fine.
Please do not annoy yourself any more with this issue. I would really like to see what other people think about this. Thank you.

#6 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 02:30 PM

All it does is read out any include files and simply copy-paste them in your script. ...

OK,
here is what I did, following Manadar's suggestion:

AutoIt         
;Au3CodeAppender.au3 ;Written by dv8 on Feb. 24 2012 ;Any suggestions and improvements are welcome! #Include <string.au3> If $CmdLine[0]=1 AND FileExists($CmdLine[1]) Then    $SourceFile=$CmdLine[1] Else     ConsoleWrite("ERROR: The input file does not exist!"&@CRLF)    Exit EndIf ConsoleWrite(StringTrimRight(@ScriptFullPath,4)&".ini"&@CRLF) GLOBAL $IncludeLibrariesPath=INIRead(StringTrimRight(@ScriptFullPath,4)&".ini","General","IncludeLibrariesPath","") If $IncludeLibrariesPath<>"" AND StringRight($IncludeLibrariesPath,1)<>'\' Then $IncludeLibrariesPath&='\' If Not FileExists($IncludeLibrariesPath) Then    ConsoleWrite("ERROR: The IncludeLibrariesPath ("&$IncludeLibrariesPath&") does not exist. Please set it in the INI file."&@CRLF)     Exit EndIf GLOBAL $IncludedFiles=""                                        ;This is to keep track of the included files so they do not get included twice. GLOBAL $NewContent="" RecursiveAddFile($SourceFile) $DestFile=FileOpen(StringTrimRight($SourceFile,4)&"_Merged.au3",2) FileWrite($DestFile,$NewContent) FileClose($DestFile) Func RecursiveAddFile($File) ConsoleWrite("Currently adding: "&$File&@CRLF)    $tmp=StringSplit($File,"\")     $SourceFileName=$tmp[$tmp[0]]     $SourceFilePath=$tmp[1]&'\'     For $i=2 To $tmp[0]-1        $SourceFilePath&=$tmp[$i]&'\'     Next     $F=FileOpen($File,0)     While 1         $Line=FileReadLine($F)         If @error<>0 Then ExitLoop         If StringLower(StringLeft(StringStripWS($Line,1),13))="#include-once" Then             ContinueLoop         ElseIf StringLower(StringLeft(StringStripWS($Line,1),8))="#include" Then             $TrimmedLine=StringStripWS(StringTrimLeft($Line,8),3) ConsoleWrite("Found #include "&$TrimmedLine&@CRLF)             If StringInStr($TrimmedLine,'<') AND StringInStr($TrimmedLine,'>') Then             $aName=_StringBetween($TrimmedLine,"<",">")                 $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$IncludeLibrariesPath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             ElseIf StringInStr($TrimmedLine,'"') AND StringInStr($TrimmedLine,'"') Then                 $aName=_StringBetween($TrimmedLine,'"','"')             $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$SourceFilePath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             ElseIf StringInStr($TrimmedLine,"'") AND StringInStr($TrimmedLine,"'") Then                 $aName=_StringBetween($TrimmedLine,"'","'")             $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$SourceFilePath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             Else                 ConsoleWrite("ERROR: Unrecognized #Include line ("&$Line&")"&@CRLF)             FileClose($F)                 Exit             EndIf         Else          $NewContent&=$Line&@CRLF         EndIf     Wend     FileClose($F) EndFunc

It also needs an INI file with the same name to read the path to the AutoIt "Include" library:
;Au3CodeAppender.ini [General] IncludeLibrariesPath=D:\Tools\AutoIt\Include\


This program generates a new YourScriptName_Merged.au3 script with no #include directives, wich contains all the include files that were reffered in the main script.

However, when I tested it with an intentionally added error line in my script, the reported line was 35427 and the line in the source is actually 75549.
So apparently this approach is not working. So any suggestions, anyone?

#7 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,168 posts

Posted 24 February 2012 - 02:31 PM

Why not use the parameters of Obfuscator e.g. /StripOnly?

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#8 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 02:33 PM

Please read my first post carefully! I already stated there that the Obfuscator "...broke some of the functionality in my script since it has a lot of Call() and ObjEvent() functions."

#9 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,156 posts

Posted 24 February 2012 - 02:35 PM

Did you remove the #include lines from the modified script? Sounds like it might be adding them twice.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#10 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,168 posts

Posted 24 February 2012 - 02:36 PM

I did but saying you used Obfuscator doesn't really tell much. Oh well.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#11 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 02:37 PM

Guys, do you read the posts at all? ;) This is frustrating. :)
I said: "This program generates a new YourScriptName_Merged.au3 script with no #include directives, which contains all the include files that were referred in the main script."
You are also welcome to try it and give any suggestions...

#12 Manadar

Manadar

         

  • MVPs
  • 10,835 posts

Posted 24 February 2012 - 02:48 PM

Now strip empty lines and comments. Then you're done. I don't think compiler directives are removed. Maybe #cs is removed, but I'm pretty sure that #include-once isn't.

I just stripped string.au3 by hand to remove all comments and empty lines and it had 216 lines. My script: #include<string.au3> Kek() fails on line 217.

Edited by Manadar, 24 February 2012 - 02:49 PM.


#13 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,156 posts

Posted 24 February 2012 - 02:53 PM

I tried your script just now, it doesn't have any way of including any UDFs that aren't in the include folder that I can see. Not to mention, it includes the entire file that you're including even functions you're not using.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#14 Manadar

Manadar

         

  • MVPs
  • 10,835 posts

Posted 24 February 2012 - 02:59 PM

Not to mention, it includes the entire file that you're including even functions you're not using.

That's what AutoIt does as well.

Edited by Manadar, 24 February 2012 - 03:00 PM.


#15 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 03:01 PM

BrewManNH - It does include the #Include "filename.au3" files. Check again...
Manadar - we are getting closer. I stripped the empty lines and left the #include-once directives. The reported line number was 35427 and the actual line is now 39207. Only about 3800 lines more to get rid of. :)

Here is the new version.
AutoIt         
;Au3CodeAppender.au3 ;Written by dv8 on Feb. 24 2012 ;Any suggestions and improvements are welcome! #Include <string.au3> If $CmdLine[0]=1 AND FileExists($CmdLine[1]) Then    $SourceFile=$CmdLine[1] Else     ConsoleWrite("ERROR: The input file does not exist!"&@CRLF)    Exit EndIf ConsoleWrite(StringTrimRight(@ScriptFullPath,4)&".ini"&@CRLF) GLOBAL $IncludeLibrariesPath=INIRead(StringTrimRight(@ScriptFullPath,4)&".ini","General","IncludeLibrariesPath","") If $IncludeLibrariesPath<>"" AND StringRight($IncludeLibrariesPath,1)<>'' Then $IncludeLibrariesPath&='' If Not FileExists($IncludeLibrariesPath) Then    ConsoleWrite("ERROR: The IncludeLibrariesPath ("&$IncludeLibrariesPath&") does not exist. Please set it in the INI file."&@CRLF)     Exit EndIf GLOBAL $IncludedFiles=""                                        ;This is to keep track of the included files so they do not get included twice. GLOBAL $NewContent="" RecursiveAddFile($SourceFile) $DestFile=FileOpen(StringTrimRight($SourceFile,4)&"_Merged.au3",2) FileWrite($DestFile,$NewContent) FileClose($DestFile) Func RecursiveAddFile($File) ConsoleWrite("Currently adding: "&$File&@CRLF)    $tmp=StringSplit($File,"")     $SourceFileName=$tmp[$tmp[0]]     $SourceFilePath=$tmp[1]&''     For $i=2 To $tmp[0]-1        $SourceFilePath&=$tmp[$i]&''     Next     $F=FileOpen($File,0)     While 1         $Line=FileReadLine($F)         If @error<>0 Then ExitLoop         If StringStripWS($Line,8)="" Then             ContinueLoop         ElseIf StringLeft(StringStripWS($Line,1),1)=';' Then          ContinueLoop         ElseIf StringLower(StringLeft(StringStripWS($Line,1),8))="#include" AND StringLower(StringLeft(StringStripWS($Line,1),13))<>"#include-once"Then             $TrimmedLine=StringStripWS(StringTrimLeft($Line,8),3) ConsoleWrite("Found #include "&$TrimmedLine&@CRLF)             If StringInStr($TrimmedLine,'<') AND StringInStr($TrimmedLine,'>') Then             $aName=_StringBetween($TrimmedLine,"<",">")                 $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$IncludeLibrariesPath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             ElseIf StringInStr($TrimmedLine,'"') AND StringInStr($TrimmedLine,'"') Then                 $aName=_StringBetween($TrimmedLine,'"','"')             $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$SourceFilePath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             ElseIf StringInStr($TrimmedLine,"'") AND StringInStr($TrimmedLine,"'") Then                 $aName=_StringBetween($TrimmedLine,"'","'")             $FileN=StringStripWS($aName[0],3)                 $FileToAdd=$SourceFilePath&$FileN                 If Not StringInStr($IncludedFiles,$FileToAdd) Then              $IncludedFiles&=$FileToAdd&"|"              RecursiveAddFile($FileToAdd)                 Else ConsoleWrite("Skipping: "&$FileToAdd&" (Already added)"&@CRLF)                 EndIf             Else                 ConsoleWrite("ERROR: Unrecognized #Include line ("&$Line&")"&@CRLF)             FileClose($F)                 Exit             EndIf         Else          $NewContent&=$Line&@CRLF         EndIf     Wend     FileClose($F) EndFunc


#16 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,156 posts

Posted 24 February 2012 - 03:06 PM

That's what AutoIt does as well.

But with Obfuscator you can strip them out.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#17 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,156 posts

Posted 24 February 2012 - 03:09 PM

BrewManNH - It does include the #Include "filename.au3" files. Check again...

No actually it doesn't. I used it on a small script that has #include lines in that point to files that are in the same folder as the script, this script doesn't include them when it's run on my script. I used the include directive #include <myincludefile.au3> which points to a file in the script folder, even though I'm not using the quotes to tell the script that it's in the same folder, AutoIt will find and include them, you script ignores them and doesn't tell me it can't find them.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#18 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 03:14 PM

:) Manadar,
I hope you see now that this is not exactly a 10 minutes process and it involves A LOT of guessing what exactly Aut2Exe does. And imagine that we manage to guess it right and make this program match the line numbers, then the next version of Aut2Exe is changed due to a bug fix, then what? Start the guessing game again?

And since Aut2Exe already does what we are trying to do here, I don't see why we can't use this in our advantage. I believe it won't be too much of a trouble for the developer to add some kind of command line switch (/DumpSource for example) and once the Aut2Exe gets to the point where the whole source is prepared for compilation, it checks for that switch and dumps the source into InputFilename_Dump.au3 for example.
So I would like to put this a feature request. I believe it is reasonable and will make finding bugs in the compiled scripts a lot easier.

#19 dv8

dv8

    Prodigy

  • Active Members
  • PipPipPip
  • 191 posts

Posted 24 February 2012 - 03:17 PM

I was not aware that you can use the #include <myincludefile.au3> directive to include files from the script folder. I thought only #include "myincludefile.au3" is used for local includes.
OK, I'll account for this in the next modification... Thanks for letting me know.

#20 Manadar

Manadar

         

  • MVPs
  • 10,835 posts

Posted 24 February 2012 - 03:26 PM

Compile the file that you create from your script. The line numbers almost match. (Try to get rid of all the directives.)

It's actually not such a big deal to do this, considering the alternatives. My initial 10 minute script observation was based on the old compiler. It has obviously changed. But it's still not a big deal at all. (Again: considering the alternative).





Also tagged with one or more of these keywords: error, line number, exe, compiled

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users