English
Source / code snippets

Reading detect Exe Compilations Version XProfan

 
time as small function chkXProfanVersionByExe The as Parameter a Filenames expects and the version number returns:
CompileMarkSeparation
'{$cleq}
CLS
print chkXProfanVersionByExe(loadfile$("","*.exe"))
waitinput
end

proc chkXProfanVersionByExe

    parameters fle$
    var vers&=0
    var ofm&=SET("FileMode",0)
    var fh&=assign(fle$)

    if fh&

        openRW fh&

        ifnot %ioResult

            seek fh&,128
            seek fh&,getLong(fh&)+7
            case getlong(fh&) = $4E41464F : vers&=instr(chr$(getByte(fh&)),"0000000003456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")*0.5
            close fh&

        endif

        assign fh&,""

    endif

    SET("FileMode",ofm&)
    return vers&

endproc


Umgesetzt based on Information of a Code Roland
RGH

CompileMarkSeparation
Declare File$, hDatei&, Version$, Adresse&
CLS
Datei$ = LoadFile $("Profn-Program open:", "*.exe")

If File$ > ""// it watts a File select

    hDatei& = Assign(File$)
    OpenRW hDatei&// File binary open
    Seek hDatei&, $80// on this position standing The address the Compilates
    Adresse& = GetLong(hDatei&)
    Seek hDatei&, Adresse&// here begins the Compilat
    Version$ = GetChar$(hDatei&, 18)
    // the first 11 characters are always " RGH-PROFAN"

    If Mid$(Version$, 1, 11) <> " RGH-PROFAN"

        MessageBox("No with PROFAN² or XProfan erzeugtes Program!", "Hinweis:", 16)
        Close hDatei&
        End

    EndIf

    // the 12. characters is the Version the Compilates and can Rückschlüsse on The
    // XProfan-Version To
    Version$ = Substr$(Version$, 12)

    Select Version$

        CaseOf "3" : Print "Profan² 5 (32 bit)"

        CaseOf "4" : Print "Profan² 5 (32 bit) with $P* verschlüsselt"

        CaseOf "5" : Print "Profan² 6 (32 bit)"

        CaseOf "6" : Print "Profan² 6 (32 bit) with $P* verschlüsselt"

        CaseOf "7" : Print "Profan² 7"

        CaseOf "8" : Print "Profan² 7 with $P* verschlüsselt"

        CaseOf "9" : Print "XProfan 8"

        CaseOf "A" : Print "XProfan 8 with $P* verschlüsselt"

        CaseOf "B" : Print "XProfan 9"

        CaseOf "C" : Print "XProfan 9 with $P* verschlüsselt"

        CaseOf "D" : Print "XProfan 10"

        CaseOf "E" : Print "XProfan 10 with $P* verschlüsselt"

        CaseOf "F" : Print "XProfan 11 or X2"

        CaseOf "G" : Print "XProfan 11 or X2 with $P* verschlüsselt"

        Otherwise  : Print "Unbekannte Version " + Version$

    EndSelect

    Close hDatei&
    WaitInput

EndIf

End


because of one Fehlers in XPSE concerning the function GetLong by XPSE (momentarily) only with GetWord-Workaround possible:
CompileMarkSeparation
 {$cleq}
CLS
print chkXProfanVersionByExe(loadfile$("","*.exe"))
waitinput
end

proc chkXProfanVersionByExe

    parameters fle$
    var vers&=0
    var ofm&=SET("FileMode",0)
    var fh&=assign(fle$)

    if fh&

        openRW fh&

        ifnot %ioResult

            seek fh&,128
            seek fh&,getWord(fh&)+getWord(fh&)*65536+7
            case getWord(fh&)+getWord(fh&)*65536 = $4E41464F : vers&=instr(chr $(getByte(fh&)),"0000000003456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")*0.5
            close fh&

        endif

        assign fh&,""

    endif

    SET("FileMode",ofm&)
    return vers&

endproc


311 kB
Hochgeladen:12/14/10
Downloadcounter108
Download
 
12/14/10  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.225 Views

Untitledvor 0 min.
Member 862464105/13/24
Sven Bader03/09/21
Matzbub12/29/18
AndreasS11/27/18
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie