Jump to content

ARMAGEDON: Buffer Overrun detected


Earthquake
 Share

Recommended Posts

Hi Snipez,

Im freaking out: I wrote my little program, tested it (fine), compiled it (fine), changed a sleep from 1000 to 100 (fine), tested it again (fine, too)...

but as I wanted to compile it, it gave me a Error message:

Title: Microsoft Visual C++ Runtime Libary

Text:

Buffer overrun detected!

Program: C:\.....\Aut2Exe\Aut2Exe.exe

A buffer overrun has been detected which has corrupted the program's internal state. The program cannot safely continue execution and must now be terminated.

Button: Ok (I wished, there was a "Go f.ck ureself"-Button...)

Ok, so I thought the "Sleep (100)" I just changed might be the problem, so I changed it back to 1000 but the problem still existed. So I reinstalled AutoIT from scratch but it still gives me the Error message... :)

I seriously dont know what to do now. Could anyone help me?

Edited by Earthquake
Yes, I am a noob! But at least I try to learn!Moddingtech.de - Home of the german Modding-Scene!
Link to comment
Share on other sites

Its' gotta be your program - see on the third line...

Seriously, how can we even guess what the problem is without some code to look at?

Yeah, about that go fxxck yourself button, maybe it is a good ide it wasn't included - it may have got a good workout... :)

Link to comment
Share on other sites

Ok, sorry, ususally I add the code, but I was angry and went home...

Here you go:

; For your explanation: This program should add a little combobox to the Notepad (ok, its another program, but this is for my work and I dont want you to know, where I work...

#include <GUIConstants.au3>



Global $WindowTitle="notepad.exe"
Global $ScriptFilename
Global $GoButton
global $FLAGGUIExists = 0
Global $ComboText
Global $GUIStatus = 0
Global $combo



If FileExists(@ScriptDir & "\Scriptlibary.ini") Then ; Little inquiry to ensure that the Scriptlibary.ini exists.
    $ScriptFilename = (@ScriptDir & "\Scriptlibary.ini")
Else
    MsgBox(0x0,"Error","File Scriptlibary.ini wasn't found!")
    Exit
EndIf


WinActivate($WindowTitle)
WinWaitActive($WindowTitle)

Start()

Func Start() ; Function Start is the main function, from which the other functions are called. Basiclly it contains only a while-loop to check the messages returned from the GUI.

    While 1
        
        
        Sleep (100)
        
        If Not WinExists($WindowTitle) Then ; Inquiry whether Notepad.exe is open. The Tool Launcher should only exist if Clarify is opened.
            Exit
        EndIf
        
        $Position = WinGetPos($WindowTitle)
        $NewPosition = $Position
        $MousePos = MouseGetPos()
        
        If WinActive($WindowTitle) = 1 Then ; First condition whether the Tool Launcher should be visible.
            
            ; The following inquiry checks whether the mousetrigger is in the right position.
            If ($MousePos[0] < $NewPosition[0] + $NewPosition[2] - 79) And ($MousePos[0] > $NewPosition[0] + $NewPosition[2] - 316) And ($MousePos[1] < $NewPosition[1] + 48) And ($MousePos[1]> $NewPosition[1] + 28) Then
                $GUIStatus=1 ; After both conditions are true (WinActive and MousePos) this flag is set to 1 to show the later following inquiry that function CreateGUI should be started.
            Else
                $GUIStatus=0
            EndIf
            
        EndIf
        
        If Not WinActive($WindowTitle) And Not WinActive("GPSD Tool Launcher") Then ; A inquiry to be sure that the GUI will disappear
            $GUIStatus=0
        EndIf
        
        If $GUIStatus=1  Then
            If $FLAGGUIExists <> 1 Then
                CreateGUI($Position)
            EndIf
            
        Else
            GUIDelete() ; After some test with invisibility of the Tool Launcher the deletion was the better way (less visibility problems).
            $FLAGGUIExists=0
            $GUIStatus=0
        EndIf
        
        If $FLAGGUIExists = 1 Then ; Only if the GUI exists the function of the Go button is accessible.
            $msg=GUIGetMsg(1)
            If $msg[0] = $GUI_EVENT_CLOSE Then
                Exit
            Endif
            
            If $msg[0] = $GoButton Then
                FuncGoButton()
            Endif
        Endif
    WEnd
    


EndFunc


Func CreateGUI(ByRef $Position) ; This function creates the GUI and reads the filenames of the Scriptlibary.ini

    $Win = GUICreate("GPSD Tool Launcher", 237, 23, $Position[0] + $Position[2] - 316, $Position[1] + 31, $WS_POPUP,$WS_EX_TOPMOST+$WS_EX_TRANSPARENT)

    $TemplAm = IniRead($ScriptFilename, "Start", "Amount", "1")


    For $i = 1 To $TemplAm ; Loop which is repeated till the value of $TemlAm (Template amount) is reached.
        
        $ComboText = IniRead($ScriptFilename, "Names", "Script"& $i, $i)
        
        
        If ($i = 1) Then
            $combo = GUICtrlCreateCombo($ComboText, 2, 2, 200, 25, $CBS_DROPDOWNLIST)
        Else
            GUICtrlSetData($combo, $ComboText)
        Endif

    Next


    $GoButton = GUICtrlCreateButton("Go", 202, -1, 30, 21, -1, $WS_EX_TOPMOST)

    GUISetState()

    $FLAGGUIExists=1 ; This flag is set to indicate that a GUI is created
EndFunc

Func FuncGoButton() ; The FuncGoButton function controls the Go button and reads the paths of the starting programs from the Scriptlibary.ini

$ComboContent = GUICtrlRead($combo) ; Reads the current content of the dropdownbox.

    $MsgBoxAnswer=""

    If Not IsDeclared("MsgBoxAnswer") Then Dim $MsgBoxAnswer
        $MsgBoxAnswer = MsgBox(36, "Abfrage", "Soll das folgende Script gestartet werden? " & $ComboContent)


    $Exec = IniRead($ScriptFilename, "Names", $ComboContent, "") ; $Exec is the name of the program that will be started. The program path is read from the Scriptlibary.ini

    Select
        Case $MsgBoxAnswer = 6
            
            If FileExists($Exec) Then ; Inquiry, whether the program which is specified in the Scriptlibary.ini is correct.
            run($Exec)
            Else
            MsgBox(0, "Error", "Scriptlibary.ini not correct. Specified file doesn't exist!")
            EndIf
        Case $MsgBoxAnswer = 7
    EndSelect

EndFunc

To get it working, you will need the Scriptlibary.ini in the same folder as the Script itself. The Scriptlibary should look like this:

[START]

Amount=3

[Names]

Script1=Paint
Paint=C:\WINDOWS\system32\mspaint.exe
Script2=Another Tool
Another Tool=C:\WINDOWS\system32\cmd.exe
Script3=And another one
And another one=C:\WINDOWS\system32\calc.exe

Any help on this problem would be great...

Edited by Earthquake
Yes, I am a noob! But at least I try to learn!Moddingtech.de - Home of the german Modding-Scene!
Link to comment
Share on other sites

  • 5 months later...

Good morning everyone,

I can easily follow Earthquake's mood, even if he wrote this long ago.

I wrote an automating-script, and compiled it several times (on my desktop-pc).

Every time it works fine...

Yesterday changed a sleep-function argument from 1000 to 3000 (ok), tested it (works)... and then... compiled it...

... and at compile time it gave me following Error Message:

****************************************

Title: Microsoft Visual C++ Runtime Libary

Text:

Buffer overrun detected!

Program: C:\.....\Aut2Exe\Aut2Exe.exe

A buffer overrun has been detected which has corrupted the program's internal state. The program cannot safely continue execution and must now be terminated.

****************************************

I pushed the "Go f.ck ureself"-Button :whistle: ... and gave it another try with the old argument.

At compile time, same error message.

No problem, i thought, recovered an older back up version and compiled that 100% working one again....

........ same Error !!!

Freakin' out!

So I also reinstalled AutoIT from scratch.. but still error messages during compile time in all of my (even earlier) written programs.

(BTW. this error destroys the existing *.exe file! - fortunately I have a lot of backups)

Even a little hello-world test-program fails compilation.

My next step was to test the script on my laptop.

Compiled it.... what the hell??!?! The same error.

From that time on, everytime I try to compile a program on my laptop, it fails with that message.

In the end, I used a freshly installed windows system (vmware snapshot).. and..

it works.

Unfortunately its impossible to install windows from scratch on both systems, and I badly need them for development.

Please help me out.

Thanks in advance.

Joe

Link to comment
Share on other sites

Revert back to non-beta autoit, There seems to be a overexcited error.

Link to comment
Share on other sites

Hi Chip,

I used the v3.2.2.0 Release, when the error occurs - on all machines.

Afterwards I upgraded to v3.2.3.1 beta.

This doesnt work.

So I deleted autoit, cleaned my system with ccleaner and regseeker and installed v3.1.1 (just a few minutes ago).

Also didnt help (maybe I'm too sleepy, it's 5.50 in the morning - here in Germany :whistle: )

Do u have another idea?

Thanks for your fast help.

Joe

Link to comment
Share on other sites

Err, last "stable" was 3.2.0.1 if I'm not wrong (I think a bug in 3.2.0.0 was fixed). Why go back and use 3.1.1 ? BTW.: I don't know this error. Maybe you used the zip-file and not the installer? Just a wild guess, since I recall a zip-file that did not contain the upx.exe.

Link to comment
Share on other sites

Thanks a lot dabus,

I get it started on my laptop, after doin the following steps:

- uninstall all autoit versions completely

- clean the system with different tools

- restart the system

- again a run with cleaning tools

- install the installer version of autoit >v3.2.0.1< from scratch (@dabus: I've always used the installer :D )

- compile a file . . . works

The bad news:

After the same procedure on my desktop,.. still this error message during compilation.

Ok - 4.30 a.m. again.. maybe thats the cause :P and I've forgotten a few steps...

Tomorrow I'll give it a new try and post my findings here.

Thanks again & Good n8 :whistle:

Joe

Edited by J0E
Link to comment
Share on other sites

  • 4 weeks later...

Hi all,

just a little note...

after a short job-break, I finally accomplished to eliminate the error.

With the steps I already posted:

***

*** - uninstall all autoit versions completely

*** - clean the system with different tools

*** - restart the system

*** - again a run with cleaning tools

*** - install the installer version of autoit >v3.2.0.1< from scratch (@dabus: I've always used the installer sad.gif )

*** - compile a file . . . works

***

After trying this procedure 2 times... no error messages any more.

I think it's essential to use the stable release v3.2.0.1, if u have this error !

Thanks over again for your help.

Joe

*** CASE CLOSED :shocked: ***

Link to comment
Share on other sites

For later reference why not report the OS version and MS developer tools installed?

I have seen obscure errors like this occur on machines with a mix of nationalized software (Microsoft) on it. Norwegian OS, English Office version with some dll's from a French installation. Not a good mix ..:shocked:

Link to comment
Share on other sites

  • 4 weeks later...

Ouh really no good mix.

My Systemlandscape is completely nationalized for German language.

configuration:

- OS: MS XP Pro on all systems + openSUSE 10.2 (no Linux AutoIt development) = managed with LiLo v22.8

- Dev. Tools: SciTE Version 1.73 (SciTE4AutoIt3), PSPad 4.5.1, Aptana IDE build 0.2.7.13425

- Mulitdesktop: Dexpot 1.4

- Virtual Machine: VMware Server 1.0.1

- VPN: Hamachi 1.0.2.1

- Graphics: amongst others.. Adobe Photoshop CS3

Greetings,

J0E

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...