Jump to content

Recommended Posts

Posted

Hi to all,

i've searched for information how to get all 16bit programs on my pc.

But didn't found anything.

Is it possible with autoit to scan all files (exe, dll, ...) on

my local c:-drive and get a list, if they are 16, 32, or 64bit programs?

Any help is welcome! :D

Thanks

Dizzy

Posted (edited)

Interesting question :D...

$file = FileOpenDialog("Please select file", "", "All (*.*)");
If @error Then Exit

MsgBox(0, "", "Binary Type of the file " & $file & @CRLF & @CRLF & _GetBinaryType($file) & @crlf & @crlf & "Error: " & @error)

Func _GetBinaryType($file)
    ;http://msdn.microsoft.com/en-us/library/aa364819(VS.85).aspx

    If Not FileExists($file) Then Return SetError(1, 0, 0)

    Local $stType = DllStructCreate("dword;")

    $aRet = DllCall("kernel32.dll", "hwnd", "GetBinaryType", "str", $file, "ptr", DllStructGetPtr($stType))
    if $aRet[0] = 0 then Return SetError(2, 0, "Not an executable file") ; not an executable file

    ; Local Const $SCS_32BIT_BINARY = 0 ; A 32-bit Windows-based application
    ; Local Const $SCS_DOS_BINARY = 1 ; An MS-DOS – based application
    ; Local Const $SCS_WOW_BINARY = 2 ; A 16-bit Windows-based application
    ; Local Const $SCS_PIF_BINARY = 3 ; A PIF file that executes an MS-DOS – based application
    ; Local Const $SCS_POSIX_BINARY = 4 ; A POSIX – based application
    ; Local Const $SCS_OS216_BINARY = 5 ; A 16-bit OS/2-based application
    ; Local Const $SCS_64BIT_BINARY = 6 ; A 64-bit Windows-based application

    Switch DllStructGetData($stType, 1)
        Case 0
            Return "A 32-bit Windows-based application"
        Case 1
            Return "An MS-DOS – based application"
        Case 2
            Return "A 16-bit Windows-based application"
        Case 3
            Return "A PIF file that executes an MS-DOS – based application"
        Case 4
            Return "A POSIX – based application"
        Case 5
            Return "A 16-bit OS/2-based application"
        Case 6
            Return "A 64-bit Windows-based application"
    EndSwitch
EndFunc   ;==>_GetBinaryType
Edited by KaFu
Posted

Gern geschehen, Herr Nachbar :huggles:...

Hut ab, und: RESPEKT! :D

Kann ich auch gleich gut gebrauchen :

Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted

Gern geschehen, Herr Nachbar :huggles:...

Ha - wie klein die Welt doch ist ...

Danke! Dann kann ich beim nächsten Problem ja "mal eben rumkommen"? :D

Gruß

Dizzy

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
  • Recently Browsing   0 members

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