DE102004039200A1 - Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program - Google Patents
Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program Download PDFInfo
- Publication number
- DE102004039200A1 DE102004039200A1 DE200410039200 DE102004039200A DE102004039200A1 DE 102004039200 A1 DE102004039200 A1 DE 102004039200A1 DE 200410039200 DE200410039200 DE 200410039200 DE 102004039200 A DE102004039200 A DE 102004039200A DE 102004039200 A1 DE102004039200 A1 DE 102004039200A1
- Authority
- DE
- Germany
- Prior art keywords
- function
- version
- binary file
- dll
- dll1
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44536—Selecting among different versions
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
Die Erfindung betrifft Verfahren, Vorrichtungen und Computerprogrammprodukte zur Versionsmarkierung und Versionsüberprüfung von binären Dateien auf einem Computersystem.The The invention relates to methods, devices and computer program products for version marking and version checking of binary files on a computer system.
Bei der Softwareentwicklung werden häufig verwendete Funktionen und Routinen oder solche mit speziellen Anwendungsbereichen, wie z.B. arithmetische, I/O- oder Graphikfunktionen, dem Programmierer meist in Form von Funktionssammlungen bzw. Programmbibliotheken zur Verfügung gestellt. Dadurch werden Funktionen wiederverwendbar, da ein Programmierer nur die entsprechende Bibliothek in seine Applikation (ausführbare Programmdatei) einbindet, anstatt die Funktion neu schreiben zu müssen.at Software development is widely used Functions and routines or those with special application areas, such as. arithmetic, I / O or graphics functions, the programmer usually in the form of function collections or program libraries to disposal posed. This will make functions reusable as a programmer only the corresponding library in its application (executable program file) rather than having to rewrite the function.
Es gibt prinzipiell zwei verschiedenen Arten von Bibliotheken, statisch bindbare und dynamisch bindbare Bibliotheken („Dynamic Linked Libraries", DLL). Die statisch bindbaren Bibliotheken haben den Nachteil, daß beim Kompilieren bzw. Binden an eine Applikation die statische Bibliothek vollständig in die Applikationsdatei einkopiert wird. Diese Binde-Strategie verbraucht viel Speicherplatz, weil sie zu großen Programmdateien führt und eine häufig benutzte Bibliothek auf einem Rechnersystem oft hundertfach kopiert vorliegt.It basically gives two different types of libraries, static bindable and dynamically bindable libraries ("Dynamic Linked Libraries", DLL) bindable libraries have the disadvantage that when compiling or binding to an application the static library completely in the application file is copied in. This connective strategy is used up a lot of disk space because it leads to large program files and a common one used library often copied hundreds of times on a computer system is present.
Diesen Nachteil vermeiden dynamisch bindbaren Bibliotheken (DLLs), da beim Kompilieren bzw. Binden einer Applikation lediglich Verweise auf die Stelle im Speicher, an der die benötigte Funktion der DLL liegt, in die Applikation eingefügt werden. Der gleiche Mechanismus des Verweisens wird verwendet, wenn eine DLL ihrerseits Funktionen einer anderen DLL verwendet. Dadurch wird die Binärdateigröße von kompilierten Applikationen und DLLs minimiert. Es wird kein Speicherplatz mehr durch Kopieren ver schwendet, da jede Applikation und jede DLL auf die gleiche (in der Regel einzige) Kopie einer DLL zugreifen kann, deren Funktionen sie benötigt.this Disadvantage avoid dynamically bindable libraries (DLLs), because the Compile or bind an application only references to the location in memory where the required function of the DLL is located, inserted into the application become. The same mechanism of referencing is used when a DLL in turn uses functions of another DLL. Thereby will compile the binary file size Minimizes applications and DLLs. There is no more storage space By copying ver avoids because every application and every DLL on can access the same (usually single) copy of a DLL, whose functions she needs.
Ein Nachteil gegenüber statisch bindbaren Bibliotheken ergibt sich bei der Softwareentwicklung allerdings häufig, wenn DLLs anderer Applikationen in die eigenen Applikation eingebunden werden. Bei einem Windows-System ist hierbei das übliche Szenario, daß solche DLLs in das Windows-Systemverzeichnis kopiert werden, wo sie dann prinzipiell allen Applikationen zum Einbinden zur Verfügung stehen.One Disadvantage compared However, statically binding libraries can be found in software development often, if DLLs of other applications are integrated into the own application become. In a Windows system, this is the usual scenario that such DLLs in the Windows system directory be copied, where they then in principle all applications for Integration available stand.
Wenn nun für eine bestimmte Applikation durch Änderung oder Weiterentwicklung eine neue Version einer DLL erstellt wird, wird die neue Version der DLL mit unverändertem Namen wieder in das Systemverzeichnis kopiert und die alte Version der DLL überschrieben. Häufig betreffen die Änderungen einer DLL die Vereinbarungen über die Art, wie die Funktionen der DLL aufgerufen werden – also die Schnittstelle zwischen Applikationen und DLLs. Andere Applikationen, die die bisherige Schnittstelle verwenden, werden bei diesem Vorgang meist nicht angepaßt, allein schon, weil man als Programmierer/Softwarehersteller in der Regel nicht weiß, welche anderen Applikationen noch auf die eigene DLL zugreifen. Die Folge ist, daß derartige Applikationen die Funktionen der DLL nicht mehr korrekt aufrufen können und zumeist unkontrolliert mit teilweise gravierenden Nebenwirkungen „abstürzen".If now for a specific application through modification or further development When a new version of a DLL is created, the new version will be the DLL with unchanged Name copied back to the system directory and the old version Overwritten the DLL. Often concern the changes of a DLL the agreements over the way the functions of the DLL are called - that is, the interface between applications and DLLs. Other applications, the previous ones Use interface, are usually not adjusted in this process, alone already, because as a programmer / software producer in general do not know, which other applications still access their own DLL. The result is that such Applications can no longer correctly call the functions of the DLL and mostly uncontrolled with some serious side effects "crash".
Ein derart undefiniertes Verhalten einer Applikation gefährdet die Integrität des Systems und ist insbesondere in sicherheitsrelevanten Bereichen gefährlich. Die Ursache für solche Programmabstürze ist besonders bei größeren Softwaresystemen und verteilten Architekturen nur sehr schwer nachzuvollziehen und zu beheben. Selbst eine Neuinstallation von Applikation und DLL löst entweder das Problem nicht oder schafft neue Probleme, da das Fehlerverhalten u.a. von der Installationsreihenfolge abhängig ist.One such undefined behavior of an application endangers the integrity of the system and is particularly in safety-related areas dangerous. The cause of such program crashes is especially for larger software systems and distributed architectures very difficult to comprehend and to fix. Even a new installation of application and DLL solves either the problem is not or creates new problems because of the error behavior et al depends on the installation order.
Ein weiteres typisches Szenario besteht darin, daß die DLLs einer Applikation zwar in einem lokalen Installationsverzeichnis der Applikation liegen, diese aber häufig von verschieden Programmierern oder Benutzern verbessert, erweitert oder ausgetauscht werden. Dies ist insbesondere bei solchen Applikationen der Fall, bei denen aus marktstrategischen oder technischen Gründen häufige und schnelle Anpassungen einzelner Funktionalitäten vorgenommen werden müssen. Im Ergebnis führt dies schnell zu einer unübersichtlichen Sammlung von DLL-Versionen und Derivaten, deren Inkonsistenzen sich erst sehr spät bemerkbar machen, oft zu einem Zeitpunkt, zu dem die Fehlerbehebung außerordentlich schwierig geworden ist. Die Gefahr der Bibliotheksinkonsistenz verschärft sich bei offenen Plattformen zusätzlich noch dadurch, daß auch die Benutzer selbst weitere Bibliotheken einbringen, ändern und benutzen können.One Another typical scenario is that the DLLs of an application Although they are located in a local installation directory of the application, this but often improved by various programmers or users, extended or exchanged. This is especially true for such applications the case where, for market strategic or technical reasons frequent and fast Adjustments to individual functionalities must be made. in the Result leads this fast to a confusing Collection of DLL versions and derivatives whose inconsistencies are very late make noticeable, often at a time when troubleshooting extraordinarily has become difficult. The danger of library inconsistency is worsening in addition to open platforms nor by the fact that the users themselves bring in, change and other libraries to be able to use.
Demzufolge liegt der vorliegenden Erfindung die Aufgabe zugrunde, die Konsistenz zwischen Applikationen und den von ihnen dynamisch eingebundenen Bibliotheken (DLLs) in einfacher Weise überprüfen zu können und die aus Inkonsistenzen resultierenden Sicherheitsrisiken zu minimieren.As a result, The present invention is based on the object, the consistency between applications and the dynamically integrated ones It is easy to check libraries (DLLs) and those from inconsistencies to minimize the resulting security risks.
Diese Aufgabe wird erfindungsgemäß durch Verfahren zur Versionsmarkierung und Versionsüberprüfung, sowie entsprechenden Vorrichtungen und Softwareprogrammprodukte mit den Merkmalen der unabhängigen Ansprüche gelöst. In davon abhängigen Ansprüchen sind vorteilhafte Ausgestaltungen und Weiterbildungen der Erfindung angegeben.This object is achieved by methods for version marking and version verification, and corresponding devices and software program products with the features of solved independent claims. In dependent claims advantageous embodiments and developments of the invention are given.
Erfindungsgemäß wird für eine dynamisch bindbare, binäre Bibliothek (DLL), die als funktionsbereitstellende Binärdatei von einer binären Applikationsdatei eingebunden wird, um die bereitgestellten Funktionen aufrufen zu können, eine Versionscodierung erzeugt, aus der die Version der funktionsbereitstellenden Binärdatei eindeutig hervorgeht. Diese Versionscodierung wird in den Binärcode der Bibliothek (also in das Kompilat der Bibliothek) so eingebracht, daß die Version einer Bibliothek anhand ihres Binärcodes überprüft werden kann, bevor eine Funktion der Bibliothek von einer Applikation aufgerufen wird.According to the invention, for a dynamically bindable, binary Library (DLL) that functions as a binary file of a binary one Application file is integrated to the provided functions to be able to call generates a version encoding, from which the version of the function providing binary file clearly stated. This version encoding will be in the binary code of the Library (thus in the compilation of the library) so introduced, that the Version of a library can be checked against its binary code before a Function of the library is called by an application.
Ebenso wie in die funktionsbereitstellende Binärdatei wird die Versionscodierung auch in eine sie einbindende funktionsaufrufende Binärdatei eingebracht, so daß diese „weiß", welche Version der funktionsbereitstellenden Binärdatei sie in Zukunft benötigt. Als funktionsaufrufende Binärdateien werden im folgenden alle Programmdateien bezeichnet, die funktionsbereitstellende Binärdateien einbinden um deren Funktionen zu verwenden. Dies können sowohl ausführbare Binärdateien (Applikationen) als auch funktionsbereitstellenden Binärdateien sein, die ihrerseits andere funktionsbereitstellende Binärdateien einbinden, um deren Funktionen zu benutzen.As well as in the function providing binary file is the version encoding also incorporated into a function-invoking binary file incorporating them, so that they "know" which version the function-providing binary file they will need in the future. When function-calling binaries In the following, all program files are called, the function providing binaries integrate to use their functions. This can both executable binaries (Applications) as well as function-providing binaries which in turn are other functional binaries integrate to use their functions.
Die Versionscodierung bietet den Vorteil, daß die Versionskontrolle einer funktionsbereitstellenden Binärdatei direkt durch die sie einbindenden funktionsaufrufenden Binärdateien erfolgen kann, bevor die aufzurufenden Funktionen der funktionsbereitstellenden Binärdatei ausgeführt werden. Dies ermöglicht bei Versionskonflikten einen kontrollierten Abbruch und eine adäquate Fehlerbehandlung.The Version encoding has the advantage that the version control of a function-providing binary file directly through the function-calling binaries that include them can be done before the functions to be called the function providing binary file accomplished become. this makes possible in case of version conflicts a controlled termination and an adequate error handling.
Es ist möglich, die Erzeugung und das Einbringen der Versionscodierung in die entsprechenden Binärdateien getrennt durch eine Codierungseinrichtung und eine Markierungseinrichtung vorzunehmen, oder gemeinsam durch eine entsprechend kombinierte Einrichtung. In jedem Falle ist es vorteilhaft, zur Einbringung eine Versionscodierung eine von den funktionsbereitstellenden Bibliotheken und den funktionsaufrufenden Applikationen physikalisch und/oder logisch unabhängige Instanz vorzusehen.It is possible, the generation and introduction of the version coding into the corresponding ones binaries separated by a coding device and a marking device or jointly by a correspondingly combined one Facility. In any case, it is advantageous for introduction a version encoding of one of the function providing libraries and the function-calling applications physically and / or logically independent To provide for an instance.
Ebenso ist es auch möglich, das Einbringen der Versionscodierung in eine funktionsaufrufende Binärdateien getrennt von der Erzeugung der Versionscodierung und ihrem Einbringen in die entsprechende Binärdatei durchzuführen oder gemeinsam in einem Schritt.As well it is also possible the introduction of the version coding into a function-calling binary files separate from generation of the version encoding and its insertion into the corresponding binary file perform or together in one step.
Die eigentliche Versionsüberprüfung einer funktionsbereitstellenden Binärdatei durch die sie einbindende funktionsaufrufende Binärdatei wird zur Laufzeit der Applikation durchgeführt. Dazu wird die funktionsbereitstellende Binärdatei zunächst von der funktionsaufrufende Binärdatei geladen. Sodann wird die Versionscodierung der funktionsbereitstellenden Binärdatei anhand der in die funktionsaufrufende Binärdatei eingebrachten Versionscodierung überprüft. Falls sich eine Übereinstimmung der beiden Versionscodierungen ergibt, liegt die korrekte Version der funktionsbereitstellenden Binärdatei vor und die Applikation kann mit der Programmausführung fortfahren. Falls die Versionscodierungen nicht übereinstimmen, oder falls die funktionsbereitstellende Binärdatei keine Versionscodierung besitzt, schließt sich eine geeignete Fehlerbehandlung an und die Applikation wir kontrolliert beendet.The actual version check of a function providing binary file through which it becomes incorporating function-calling binary file performed during the runtime of the application. This is the function-providing binary file first from the function-calling binary file loaded. Then the version coding of the function providing binary file is based on checks the version encoding introduced in the function-calling binary file. If a match The result of the two version codes is the correct version the function-providing binary file before and the application can with the program execution Continue. If the version codes do not match, or if the functional binary file has no version coding, closes a suitable error handling and the application ends in a controlled manner.
Der Vorteil dieses Verfahrens liegt darin, daß die Korrektheit der Version einer Bibliothek von der Applikation selbst überprüft werden kann, es hierzu also keiner weiteren Instanz bedarf. Falls eine falsche Version der Bibliothek vorliegt, richtet diese keinen Schaden durch unkontrollierten Programmabsturz und unerwünschte Nebeneffekte an. Darüber hinaus kann dem Pro grammierer oder Benutzer einer Applikation durch eine entsprechende Fehlermeldung mitgeteilt werden, welche Bibliothek für die Inkonsistenz verantwortlich ist.Of the Advantage of this method is that the correctness of the version a library can be checked by the application itself, so this no further instance is needed. If an incorrect version of the library is present, this does not damage by uncontrolled program crash and unwanted Side effects on. Furthermore can the programmer or user of an application by a appropriate error message will be communicated which library for the Inconsistency is responsible.
Es ist vorteilhaft, die Versionscodierungen sowohl bei funktionsaufrufenden als auch bei funktionsbereitstellenden Binärdateien immer an die gleiche Stelle im Binärcode in einen hierfür reservierten Bereich einzubringen, so daß eine Applikation bei der Versionsüberprüfung nur aus dem reservierten Bereich die Versionscodierung der geladenen Binärbibliothek auslesen muß. Falls ein solcher reservierter Bereich nicht vorhanden ist, wird die Applikation mit einer entsprechenden Fehlermeldung kontrolliert beendet. Die eigentliche Überprüfung kann dann durch einen einfachen bitweisen Vergleich der Versionscodierungen durchgeführt werden.It is advantageous, the version encodings both at function-calling as well as functionally providing binaries always the same Place in binary code in one for this reserved area, so that an application during the version check only from the reserved area the version coding of the loaded binary library must read. If such a reserved area does not exist, will the application is checked with a corresponding error message completed. The actual review can then by a simple bitwise comparison of the version codes carried out become.
Es ist bei der Erzeugung der Versionscodierung darüber hinaus vorteilhaft, die individuelle Versionscodierung automatisch aus den Schnittstellendateien der funktionsbereitstellenden Binärdatei zu ermitteln. Dies kann besonders vorteilhaft durch ein Spezialprogramm zur Versionsmarkierung realisiert werden, das einen speziellen Algorithmus zur Ermittlung der Versionscodierung aus den Schnittstellendateien verwendet.It is also advantageous in generating the version coding, the individual version coding automatically from the interface files determine the function-providing binary file. This can particularly advantageous due to a special program for version marking be realized, which has a special algorithm for detection the version encoding used by the interface files.
Als Schnittstellendateien werden dabei alle Dateien bezeichnet, die den Zugriff einer funktionsaufrufenden Binärdatei auf die Funktionen der funktionsbereitstellenden Binärdatei ermöglichen, also alle Dateien, die zwischen beiden Binärdateien gemeinsam sind. Dies sind insbesondere die Deklarations- bzw. H-Dateien (Header), die die Konventionen der Funktionsaufrufe (z.B. Funktionsname, Parameter, Rückgabewerte, Datentypen, etc.) nach außen bereitstellen. Dadurch ändert sich die Versionscodierung einer funktionsbereitstellenden Bibliothek nur dann, wenn sich Ihre Schnittstellendatei än dert, nicht aber wenn sich ausschließlich die funktionsbereitstellende Binärdatei selbst ändert.Interface files are all files that allow the access of a function-calling binary file to the functions of the function-providing binary file, ie all files that are common between the two binary files. These are in particular the declaration or H files (headers) that provide the conventions of the function calls (eg function name, parameters, return values, data types, etc.) to the outside. This will change the version encoding of a function-providing library only if your interface file changes, but not if only the functional-providing binary itself changes.
Dies hat den Vorteil, daß sich bei routinemäßigen Wartungen und Verbesserungen (z.B. zur algorithmischen Effizienzsteigerung) der Funktionen einer Bibliothek keine Versionskonflikte mit funktionsaufrufenden Binärdateien ergeben, da sich bei solchen Programmierarbeiten die Schnittstellendateien in der Regel nicht ändern und insofern die Versionscodierung konstant bleibt. Dies ist insofern sinnvoll, als beispielsweise eine effizientere, aber ansonsten unveränderte neue Version einer Funktion ohne Konflikte von einer Applikation über die ihr bekannte Schnittstelle weiterhin aufgerufen werden kann.This has the advantage of being for routine maintenance and improvements (e.g., for algorithmic efficiency enhancement) The functions of a library have no version conflicts with function-calling binaries result in such programming work, the interface files in usually do not change and insofar as the version coding remains constant. This is insofar makes sense, for example, as a more efficient, but otherwise unchanged new Version of a function without conflicts from an application over the their known interface can still be called.
Daraus ergibt sich, daß für eine funktionsbereitstellende Binärdatei eine neue Versionscodierung nur dann erzeugt werden und in die Binärdatei eingebracht werden muß, wenn sich die zugehörige Schnittstelle ändert. Dabei ist es vorteilhaft, die alte Versionscodierung im reservierten Bereich durch die neue Versionscodierung zu ersetzen. Eine Applikation, die über die alte Schnittstelle eine Funktion der Bibliothek aufzurufen versucht, wird nun aufgrund der Versionsüberprüfung selbst die Inkonsistenz feststellen und kann sich kontrolliert beenden. Falls ein Programmierer daraufhin die Funktionsaufrufe der Applikation an die geänderte Schnittstelle anpaßt und die neue Versionscodierung in den entsprechend reservierten Bereich der Applikation eingebracht ist, tritt kein weiterer Versionskonflikt mehr auf.from that it follows that for a function providing binary file a new version encoding will only be generated and put into the binary file must become, if the associated interface changes. there it is advantageous to keep the old version coding in the reserved area to replace with the new version encoding. An application, the above the old interface tries to call a function of the library is now due to the version check itself determine the inconsistency and can end controlled. If a programmer then the function calls the application to the changed Adapts interface and the new version coding in the reserved area the application is introduced, no further version conflict occurs more on.
Es ist vorteilhaft, die Versionscodierung einer Bibliothek so zu erzeugen, daß sie einzigartig ist, sie sich also von jeder anderen möglichen Versionscodierung anderer Bibliotheken unterscheidet. Durch diese Eigenschaft der Versionscodierung wird ausgeschlossen, daß zwei verschiedene funktionsbereitstellende Binärdateien die gleiche Versionscodierung führen.It is advantageous to generate the version coding of a library so that she it is unique, so different from any other possible Version encoding of other libraries is different. Through this Property of the version encoding is excluded that two different functional binaries lead to the same version coding.
Desweiteren ist es vorteilhaft, die Erzeugung der Versionscodierung reproduzierbar, d.h. jederzeit mit dem gleichen Ergebnis wiederholbar, einzurichten. Auf diese Weise können sowohl Bibliotheken als auch Applikationen auf anderen Rechnersystemen installiert oder dorthin portiert werden, ohne daß die dann u.U. nötige Einbringung von Versionscodierungen zu Versionskonflikten führt.Furthermore it is advantageous to reproduce the generation of the version coding, i.e. repeatable at any time with the same result set up. That way you can Both libraries and applications are installed on other computer systems or be ported there without the u.U. necessary contribution from version encoding to version conflicts.
Die beiden vorgenannten vorteilhaften Eigenschaften der Versionscodierung werden durch viele verschiedene Algorithmen prinzipiell sichergestellt. Besonders vorteilhaft ist es jedoch, die Versionscodierung durch einen Hash-Algorithmus durchzuführen, da dieser Algorithmus eine zuverlässige und robuste Einweg-Funktion ist, die Zeichenketten variabler Länge auf eindeutige Zeichenketten konstanter Länge reproduzierbar abbildet.The both aforementioned advantageous properties of the version coding are in principle ensured by many different algorithms. However, it is particularly advantageous for the version coding a hash algorithm perform, because this algorithm provides a reliable and robust one-way function is the variable-length strings on unique strings constant length reproducible images.
Der besondere Vorteil der automatischen Erzeugung der Versionscodierung z.B. durch einen Hash-Algorithmus liegt darin, daß im Gegensatz zur manuellen Vergabe von Versionsnummern durch einen Programmierer, eindeutige Versionscodierungen verwendet werden und diese auch automatisch überprüfbar sind. Die Gefahr der Versionskonflikte wird dadurch minimiert.Of the special advantage of the automatic generation of the version coding e.g. by a hash algorithm is that in contrast for manual assignment of version numbers by a programmer, unique version codes are used and they are also automatically verifiable. The risk of version conflicts is thereby minimized.
Zur reproduzierbaren Erzeugung einer eindeutigen Versionscodierung aus einer Schnittstellendatei der funktionsbereitstellenden Binärdatei werden diejenigen Bestandteile der Datei, die nicht zum Programmcode gehören, zunächst entfernt. Dabei handelt es sich beispielsweise um Leerzeichen oder Steuersequenzen wie „Wagenrücklauf (CR)", „Tabulator (tab)" oder „Dateiende (EOF)" sowie automatisch oder manuell eingebrachte Kommentare. Dadurch kann gewährleistet werden, daß wirklich nur die semantisch relevanten Bestandteile (also die, die von der Syntaxanalyse eines Compiliers/Parsers als solche erkannt werden) in die Versionscodierung eingehen. Aus der so bereinigten, temporären Schnittstellendatei wird dann mit Hilfe eines geeigneten Algorithmus, z.B. mit dem Hash-Algorithmus, die eindeutige Versionscodierung erzeugt.to reproducible generation of a unique version coding an interface file of the functionalized binary file those parts of the file that are not part of the program code are removed first. These are, for example, spaces or control sequences like "Carriage Return (CR)", "Tab (tab) "or" end of file (EOF) "as well as automatically or manually submitted comments. This can be guaranteed be that, really only the semantically relevant components (that is, the ones from the Syntax analysis of a compiler / parser recognized as such) go into the version coding. From the cleaned, temporary interface file is then determined by a suitable algorithm, e.g. with the hash algorithm, generates the unique version encoding.
Häufig binden Applikationen mehrere Bibliotheken zur Benutzung ihrer Funktionen ein. In die funktionsaufrufenden Binärdateien wird dann für jede eingebundene, funktionsbereitstellende Binärdatei eine eigene Versionscodierung eingebracht. In diesem Fall ist es vorteilhaft aus diesen mehreren Versionscodierungen eine einzige Meta-Versionscodierung für diese spezielle Kombination der funktionsaufrufenden Binärdateien zu erzeugen, die alle einzelnen Versionscodierungen integriert.Frequently bind Applications multiple libraries to use their functions one. The function-calling binaries are then merged into each functionally providing binary file one own version coding introduced. In this case it is advantageous from these multiple version encodings, a single meta-version encoding for this special combination of function-calling binaries which integrates all the individual version codes.
Bei der Versionsüberprüfung einer funktionsbereitstellenden Binärdatei durch eine funktionsaufrufende Binärdatei ist zu unterscheiden zwischen Bibliotheken, die statisch geladen werden und solchen, die dynamisch geladen werden. Beim statischen Laden wird die Bibliothek geladen, wenn auch die Applikation geladen wird und die Funktionsreferenzen werden bereits zur Bindezeit aufgelöst – es erfolgt eine „frühe Bindung". Die Versionsüberprüfung wird dann in der Instanziierungsroutine der Applikation durchgeführt.at the version check of a function-providing binary file is to be distinguished by a function-calling binary file between libraries that are statically loaded and those that be dynamically loaded. Static loading becomes the library loaded, even if the application is loaded and the function references become already resolved at the binding time - there is an "early binding", the version check then becomes performed in the instantiation routine of the application.
Beim dynamischen Laden werden die Bibliotheken erst bei Bedarf geladen und können wieder freigegeben werden, wenn sie nicht mehr benötigt werden. Die Versionsüberprüfung wird hierbei zur der Laufzeit der Applikation, unmittelbar nach dem Laden der Bibliothek durchgeführt – es erfolgt eine „späte Bindung"..With dynamic loading, the libraries are only loaded when needed and can be released again when they are no longer needed become. The version check is carried out at the runtime of the application, immediately after loading the library - there is a "late binding".
Weitere Merkmale und Vorteile der Erfindung ergeben sich aus der folgenden Beschreibung verschiedener erfindungsgemäßer Ausführungsbeispiele und Ausführungsalternativen im Zusammenhang mit den begleitenden Figuren. Darin zeigen:Further Features and advantages of the invention will become apparent from the following Description of various inventive embodiments and alternative embodiments in connection with the accompanying figures. Show:
Eine
bevorzugte Ausführungsform
der vorliegenden Erfindung besteht in dem in
Alle Programme VAC, EXE, DLL1, DLL2 liegen im Speicher MEM im Binärformat vor und sind prinzipiell geeignet, von dem Prozessor CPU des Rechners C ausgeführt zu werden. Desweiteren umfaßt der Rechner C ein Betriebssystem OS, das u.a. die Ausführung von Programmen und die Vergabe von Prozessor- und Speicherressourcen überwacht und steuert. Das Betriebssystem OS residiert, wie im Schema angedeutet, in einem eigenen Permanentspeicher oder mit den anderen Programmen in einem gemeinsamen Speicher. Zur Laufzeit befinden sich die einzelnen Betriebssystemprozesse jedoch im Hauptspeicher MEM des Rechners C.All Programs VAC, EXE, DLL1, DLL2 are in memory MEM in binary format before and are in principle suitable, from the processor CPU of the computer C executed to become. Furthermore included the computer C an operating system OS, the u.a. the execution of Programs and the allocation of processor and memory resources monitored and controls. The operating system OS resides, as indicated in the scheme, in its own permanent memory or with the other programs in a shared memory. At runtime are the individual Operating system processes, however, in the main memory MEM of the computer C.
Zwischen Prozessor CPU, Speicher MEM und dem Permanentspeicher des Betriebsystems OS existiert ein Bussystem BUS zum Datentransfer zwischen den Rechnerkomponenten. Die Auswahl der dargestellten Komponenten und Ihre schematische Anordnung stellt keine Einschränkung der Erfindung dar, vielmehr sind viele verschiedene Varianten von Rechnerarchitekturen, weitere Komponenten und Peripherie geeignet, die Erfindung ebenso zu realisieren.Between Processor CPU, memory MEM and the permanent memory of the operating system OS exists a bus system BUS for data transfer between the computer components. The selection of the illustrated components and their schematic arrangement is not a restriction rather, many different variants of computer architectures, other components and peripherals suitable, the invention as well to realize.
Im Sinne der Erfindung ist die Applikation EXE eine funktionsaufrufende Binärdatei, da sie bei Ihrer Ausführung auf Funktionen zugreift, die in den funktionsbereitstellenden Binärdateien DLL1, DLL2 definiert sind. Zum Zugriff auf solche Funktionen verwendet die Applikation EXE die entsprechenden, in der jeweiligen Schnittstellendatei H1, H2 der Bibliothek DLL1, DLL2 abgelegten Zugriffsvorschriften. Diese Deklarationen bzw. Prototypen legen beispielsweise Funktionsnamen, Anzahl, Reihenfolge und Datentyp der Eingabeparameter sowie die Datentypen der Rückgabewerte fest. Ebenso kann die Aufrufkonvention in Form von abstrakten Klassen oder Zeigerfeldern (Pointer Arrays) in den Schnittstellendateien H1, H2 vereinbart werden.in the According to the invention, the application EXE is a function-calling binary file since they are in your execution accesses functions contained in the function-providing binaries DLL1, DLL2 are defined. Used to access such functions the application EXE the corresponding, in the respective interface file H1, H2 of the library DLL1, DLL2 stored access rules. These Declarations or prototypes define function names, for example, Number, order and data type of the input parameters as well as the Data types of the return values firmly. Similarly, the calling convention can take the form of abstract classes or Pointer arrays in the interface files H1, H2 be agreed.
Abhängig vom verwendeten Betriebssystem OS und der Programmiersprache, können unterschiedliche Binärformate für funktionsaufrufende Binärdateien (Applikationen EXE oder Bibliotheken DLL1, DLL2) und funktionsbereitstellende Binärdateien (nur Bibliotheken DLL1, DLL2) existieren. Bei Verwendung eines Windows-Betriebssystems sind funktionsbereitstellende Binärdateien meist vom Typ DLL („Dynamic Linked Libray") oder OCX („OLE Control Extension"), während unter Linux/UNIX sogenannte SO-Dateien („Shared Objects") bzw. ELF-Dateien („Extended Linking Format") als Bibliotheksformat verwendet werden. Die funktionsaufrufenden Binärdateien sind in der Regel vom jeweiligen Betriebssystem direkt ausführbare Applikationen („Executables", EXE). Natürlich können auch Bibliotheken ihrerseits andere Bibliotheken einbinden, weshalb funktionsbereitstellende Binärdateien auch gleichzeitig funktionsaufrufende Binärdateien sein können.Depending on used operating system OS and the programming language, can be different binary formats for function-calling binaries (Applications EXE or libraries DLL1, DLL2) and function providing binaries (only libraries DLL1, DLL2) exist. When using a Windows operating system are functionally providing binaries mostly of the type DLL ("Dynamic Linked Libray ") or OCX ("OLE Control Extension "), while under Linux / UNIX SO files ("Shared Objects") or ELF files ("Extended Linking Format ") be used as a library format. The function-calling binaries are usually directly executable by the respective operating system applications ("Executables", EXE) Of course you can too Libraries for their part incorporate other libraries, which is why they provide functions binaries can also be functionally calling binaries at the same time.
Für einen erfolgreichen Zugriff einer Applikation EXE auf Funktionen von dynamisch gebundenen Bibliotheken DLL1, DLL2 muß gewährleistet sein, daß die Bibliotheken DLL1, DLL2 in der richtigen Version vorliegen. Andernfalls kann der Zugriff einen Programmfehler bzw. „Absturz" verursachen, da sich aufgrund von Änderungen oder Weiterentwicklungen einer Bibliothek DLL1, DLL2 möglicherweise der Funktionsaufruf der Applikation EXE nicht mehr mit der in zugehörigen der Schnittstellendatei H1, H2 definierten Aufrufkonvention deckt. Aus derartigen Versionskonflikten resultierende Fehler können bei realistisch dimensionierten Rechnersystemen u.U. sehr schwer erkennbar und behebbar sein, da Versionskonflikte nicht ohne weiteres nachvollziehbar und auch durch Neuinstallation oft nicht behebbar sind.For a successful access of an application EXE to functions of dynamically bound libraries DLL1, DLL2 it must be ensured that the libraries DLL1, DLL2 are in the correct version. Otherwise, the access may cause a program error or "crash", because due to changes or further developments of a library DLL1, DLL2, the function call of the EXE application may no longer match the calling convention defined in the corresponding interface file H1, H2 resulting from such a version conflict Errors can be very realistic with realistically dimensioned computer systems difficult to recognize and repair, since version conflicts are not easily comprehensible and can often not be remedied by reinstalling.
Dieses
Szenario wird von der in
Dabei wird die Versionsmarkierung der Bibliotheken DLL1, DLL2 und der Applikationen EXE von einem eigenen Programm VAC durchgeführt, das ein Modul einer Software-Entwicklungsumgebung oder auch des Betriebssystems OS sein kann, während die Versionsüberprüfung von der jeweiligen Applikation EXE selbst bzw. von einer Routine VER der Applikation EXE durchgeführt wird.there becomes the version marker of libraries DLL1, DLL2 and the Applications EXE performed by its own program VAC, the a module of a software development environment or the operating system OS can be while the Version check of the respective application EXE itself or from a routine VER the application EXE performed becomes.
Im Kontext einer Software-Entwicklungsumgebung auf einem Computer C kann das Programm VAC, das Versionscodierungen VC1, VC2 automatisch erzeugt und diese in die entsprechenden Binärdateien DLL1, DLL2, EXE einbringt, ein weiteres Entwicklungswerkzeug neben den üblichen Werkzeugen Compiler, Debugger, Klassen-Browser, Editor etc. sein.in the Context of a software development environment on a computer C can the program VAC, the version codes VC1, VC2 automatically generates and places them in the corresponding binary files DLL1, DLL2, EXE, another development tool in addition to the usual tools compiler, Debugger, class browser, editor etc.
Das ausführbare Programm VAC zur Versionsmarkierung von Binärdateien soll im folgenden kurz „Impfprogramm" genannt werden, da es kompilierten, fertigen Binärprogrammen nachträglich und separat eine Markierung „injiziert", um Inkonsistenzen vorzubeugen. Ein erfindungsgemäßes Impfprogramm VAC stellt im wesentlichen zwei Funktionalitäten bereit, die Erzeugung einer individuellen Versionscodierung VC1, VC2, durchgeführt durch das Erzeugungsmodul GEN, und das Einbringen der Versionscodierung VC1, VC2 in die entsprechenden Binärdateien durch das Impfmodul INC.The executable Program VAC for version marking of binary files will be called "vaccination program" for short. as it compiled, binaries produce later and separately a mark "injected" to inconsistencies submissions. An inventive vaccination program VAC essentially provides two functionalities, the generation of a individual version coding VC1, VC2, performed by the generation module GEN, and the introduction of the version coding VC1, VC2 into the corresponding binaries through the vaccine module INC.
Während die Aufrufkonventionen der Schnittstellendateien H1, H2 die in Bezug auf Versionskonflikte kritische und unveränderliche Information darstellen, können die eigentlichen Funktionen der Bibliotheken DLL1, DLL2 in gewissen Grenzen durchaus geändert werden, ohne einen Versionskonflikt zu verursachen. So ist eine reine Geschwindigkeits- oder Genauigkeitsoptimierung des Programmcodes in der Regel unkritisch, da das Ein-/Ausgabe verhalten der Funktionen davon meist nicht betroffen ist. Jedoch können erfindungsgemäße, individuelle Versionscodierungen prinzipiell auch völlig unabhängig vom Programmcode generiert werden.While the Calling conventions of the interface files H1, H2 in relation to pose critical and immutable information in version conflicts can the actual functions of libraries DLL1, DLL2 in certain Borders quite changed without causing a version conflict. That's one pure speed or accuracy optimization of the program code usually uncritical, because the input / output behavior of the functions mostly unaffected. However, individual version encodings according to the invention can be used in principle, completely independently generated by the program code.
Erfindungsgemäß wird deshalb
zur Erzeugung einer individuellen Versionsmarkierung einer Bibliothek
DLL1, DLL2 durch das Erzeugungsmodul GEN des Impfprogramms VAC nur
die jeweilige Schnittstellendatei H1, H2 herangezogen. Dabei wird für jede Bibliothek
DLL1, DLL2 eine zugehörige
Versionscodierung VC1, VC2 erzeugt und durch das Impfmodul INC in
reservierte Bereiche R1 der Bibliotheken DLL1, DLL2 eingebracht
bzw. „eingeimpft". Dieser Prozeß wird später in Bezug
auf
Nach
der Impfung der Bibliotheken DLL1, DLL2 wird auch die Applikation
EXE geimpft. Dabei werden die Versionscodierungen VC1, VC2 derjenigen
Bibliotheken DLL1, DLL2, auf die die Applikation EXE zugreift, in
einen reservierten Bereich R2 der Applikation EXE eingebracht. In
der Applikation EXE werden also alle Versionscodierungen VC1, VC2
gesammelt. Dieser Prozeß kann
prinzipiell auch unabhängig
von dem zuerst stattfindenden Prozeß der Erzeugung und Einbringung
einer Versionscodierung VC1, VC2 in die entsprechende Bibliothek
DLL1, DLL2 stattfinden und durch eine separate Einrichtung zum Impfen
von Applikationen EXE realisiert sein. Die Applikation EXE nimmt
dann später
die Zuweisung der Versionscodierungen VC1, VC2 beim Laden der Bibliotheken
DLL1, DLL2 vor. Dieser Vorgang wird später in Bezug auf
Beim Zugriff der Applikation EXE auf die Funktionen der Bibliotheken DLL1, DLL2 wird die Kompatibilität der Funktionsaufrufe mit den Aufrufkonventionen der Bibliotheken DLL1, DLL2 von der Applikation EXE bzw. von einem Überprüfungsmodul VER der Applikation EXE selbst überprüft. Das Überprüfungsmodul VER kann dabei direkt als Teil der Applikation EXE realisiert sein oder, zweckmäßiger und effizienter, in einer statischen Bibliothek abgelegt sein, von wo es von der Applikation EXE bei Bedarf aufgerufen werden kann.At the Access of the application EXE to the functions of the libraries DLL1, DLL2 is the compatibility the function calls with the calling conventions of the libraries DLL1, DLL2 from the application EXE or from a verification module VER the application EXE checked itself. The verification module VER can be implemented directly as part of the EXE application or, more appropriately and more efficiently, be stored in a static library from where it is from the Application EXE can be called when needed.
Für jede einzubindende Bibliothek DLL1, DLL2 überprüft das Überprüfungsmodul VER, ob sich die entsprechende Versionscodierung VC1, VC2 in dem reservierten Bereich R2 der Applikation EXE befindet. Nur falls dies für alle einzubindenden Bibliotheken der Fall ist, kann die Applikation EXE weiter ausgeführt werden. Andernfalls liegt ein Versionskonflikt vor und die Applikation EXE wird kontrolliert und ohne schädigende Nebeneffekte beendet. Hierbei wird dem Benutzer der Applikation EXE eine ausführliche Fehlermeldung ausgegeben, um den Versionskonflikt auflösen zu können.For each to be included Library DLL1, DLL2 checks the validation module VER, whether the corresponding version coding VC1, VC2 in the reserved area R2 of the application EXE is located. Only if this for all libraries to be included is the case, the application can EXE continued become. Otherwise there is a version conflict and the application EXE is controlled and terminated without any harmful side effects. Here the user of the application EXE is a detailed Error message issued to resolve the version conflict.
Falls das Impfprogramm VAC mit einer zu markierenden Bibliothek DLL aufgerufen wird, wird diese Bibliothek DLL zunächst in den entsprechenden Verzeichnissen des Systems lokalisiert (Schritt S1). Anschließend wird die Schnittstellendatei H (Header-Datei) der gefundenen Bibliothek DLL im System lokalisiert (Schritt S2) und gelesen (Schritt S3). Um eine möglichst nur vom funktional relevanten Programmcode der Header-Datei abhängige Versionscodierung VC zu erhalten, werden im einem Bereinigungs- oder Komprimierschritt (Schritt S4) sämtliche Zeichen und Symbole aus der Header-Datei H, die keine semantische Information darstellen – z.B. Kommentare (Versionsverwaltungen des Quellcodes , Erklärungen etc.), Steuerzeichen (z.B. „newline", „carriage return", „tab") oder Leerzeichen -, vorzugsweise so vollständig entfernt, daß nach der Bereinigung/Kompression ein weiteres Entfernen eines einzigen Symbols beim Binden der Bibliothek zu einem Fehler führen würde.If the vaccination program VAC with a too The library DLL is first localized in the corresponding directories of the system (step S1). Subsequently, the interface file H (header file) of the found library DLL is located in the system (step S2) and read (step S3). In order to obtain a version coding VC that is as dependent as possible from only the functionally relevant program code of the header file, in a scavenging or compressing step (step S4), all characters and symbols from the header file H that do not represent semantic information - eg comments (version administrations source code, statements, etc.), control characters (eg "newline", "carriage return", "tab") or spaces, preferably so completely removed that after cleanup / compression, further removal of a single symbol when binding the library to would cause a mistake.
Im Bereinigungsschritt S4 wird also eine Syntax-Analyse der Header-Datei H (Parsing) durchgeführt, um die semantisch irrelevanten Symbole zu finden und diese unter Erzeugung eines temporären Datenobjekts aus der Header-Datei H herauszufiltern. Dies ermöglicht die Erzeugung einer eindeutigen Versionscodierung VC aus dem verbleibenden semantisch relevanten Inhalt des bereinigten temporären Datenobjekts, obwohl Header-Dateien z.B. selbst mehrfach in verschiedenen Versionen oder in unterschiedlichen Quellcode-Verwaltungen vorliegen können.in the Cleansing step S4 will thus be a syntax analysis of the header file H (parsing) performed, to find the semantically irrelevant symbols and these under Generation of a temporary data object from the header file H to filter out. this makes possible the generation of a unique version encoding VC from the remaining semantic relevant content of the cleaned up temporary data object, although header files e.g. even several times in different versions or in different Source administrations may be present.
Da Schnittstellendateien in vielen Programmiersprachen nur Funktions-Deklarationen bzw. Prototypen enthalten, kann zusätzlich durch eine geeignete Vorsortieren der Deklarationsblöcke der Einfluß der Reihenfolge der Deklarationen auf die Versionscodierung ausgeschlossen werden.There Interface files in many programming languages only function declarations or Prototypes may contain additional by a suitable presorting of the declaration blocks of the Influence of Order of declarations excluded to the version encoding become.
Aus der Zeichenfolge der bereinigten Header-Datei H wird dann in Schritt S5 die Versionscodierung VC durch einen geeigneten Algorithmus erzeugt. Prinzipiell sind unterschiedlichste Algorithmen, z.B. auch Zufallsgeneratoren, geeignet, sichere und hinreichend individuelle Versionscodierungen zu erzeugen. Es bietet sich jedoch insbesondere der Hash-Algorithmus an, da er reproduzierbare und mit einer hinreichenden Wahrscheinlichkeit einzigartige Hash-Werte als Versionscodierungen erzeugt.Out the string of the cleaned up header file H will then be in step S5 generates the version coding VC by a suitable algorithm. In principle, a wide variety of algorithms, e.g. also random number generators, suitable, secure and sufficiently individual version coding to create. However, it is particularly the hash algorithm because it is reproducible and with a reasonable probability generated unique hash values as version encodings.
Neben dem konkreten Beispiel der Header-Dateien H existieren in anderen Programmiersprachen auch andere Schnittstellen zwischen den funktionsbereitstellenden Bibliotheken DLL und funktionsaufrufenden Applikationen EXE. Deshalb werden bei der vorliegenden Erfindung mit dem Begriff der Schnittstellendatei prinzipiell alle Dateien bezeichnet, die notwendig sind, damit eine Applikation EXE die Schnittstelle einer Bibliothek DLL korrekt ansprechen kann, also alle Dateien, die zwischen diesen funktionsaufrufenden und funktionsbereitstellenden Binärdateien gemeinsam sind.Next the concrete example of the header files H exist in others Programming languages also use other interfaces between the functional ones Libraries DLL and function calling applications EXE. Therefore are used in the present invention with the term interface file basically identifies all the files that are necessary for a Application EXE correctly address the interface of a library DLL can, so all the files between these function-calling and functional binaries are common.
Dabei ist es selbstverständlich auch möglich, daß die Verbindung einer Bibliothek DLL mit einer Applikation EXE über mehrere Schnittstellendateien charakterisiert ist. In die Versionscodierung VC gehen dann entweder alle oder nur ausgewählte Schnittstellendateien H ein. Ebenso ist es denkbar, daß eine Bibliothek DLL, die mehrere Schnittstellendateien H besitzt, für jede Schnittstellendatei eine eigene Versionscodierung VC besitzt, so daß eine funktionsaufrufende Applikation EXE genau mit derjenigen Versionscodierung geimpft wird, die die Aufrufkonvention der aufzurufenden Funktion beinhaltet.there it goes without saying also possible that the connection a library DLL with an EXE application characterized by multiple interface files is. In the version coding VC then go either all or only selected interface files H Likewise, it is conceivable that a library DLL, the has multiple interface files H, for each interface file has its own version coding VC, so that a function calling Application EXE is vaccinated exactly with that version coding, which contains the calling convention of the function to call.
Nachdem mit Schritt S5 die Erzeugung eines Hash-Wertes der Versionscodierung abgeschlossen ist, wird die Bibliothek DLL mit der Versionscodierung VC durch das Impfmodul INC geimpft. Dazu wird zunächst ein vorgegebener und dafür reservierter Bereich R1 der Bibliothek DLL aufgesucht (Schritt S6) und die Versionscodierung VC dort eingeschrieben (Schritt S7).After this in step S5, the generation of a hash value of the version coding is completed, the library DLL with the version encoding VC vaccinated by the vaccine module INC. For this purpose, first a given and reserved for it Area R1 of the library DLL is visited (step S6) and the version coding VC written there (step S7).
Die Funktion „search R1 in DLL" (Schritte S6, S11, S16) kann dabei – ebenso wie auch die Funktion „search R2 in EXE" (Schritt S18) – beispielsweise eine exportierte C- Funktion der Bibliothek DLL sein, deren Existenz in C z.B. mittels der „GetProcAddress"- Methode abgefragt werden kann. Dabei wird eine Funktion der Bibliothek DLL gesucht, die die betreffende Versionscodierung VC zurückgibt. Falls in der Bibliothek DLL keine entsprechende Funktion existiert, ist der Rückgabewert der „GetProcAddress"-Funktion NULL. Die Gültigkeit der Bibliothek DLL kann also nicht überprüft werden. Falls jedoch eine solche „GetVersionCode"-Funktion in der Bibliothek DLL existiert, liefert „GetProcAddress" einen Zeiger auf diese Funktion, der dann direkt zum Auslesen der Versionscodierung VC verwendet werden kann. Die Funktion „GetVersionCode" liegt also in der Bibliothek DLL vor und wird von der funktionsaufrufende Binärdatei EXE über den oben beschriebenen Mechanismus aufgerufen.The Function "search R1 in DLL "(steps S6, S11, S16) can - as well as well as the function "search R2 in EXE "(step S18) - for example one exported C function of the library DLL whose existence in C e.g. queried using the "GetProcAddress" method can be. A function of the library DLL is searched, which returns the relevant version encoding VC. If in the library DLL no corresponding function exists, is the return value the "GetProcAddress" function is null validity The library DLL can not be checked. However, if one such "GetVersionCode" function in the library DLL exists, "GetProcAddress" returns a pointer this function, which then directly for reading the version encoding VC can be used. The function "GetVersionCode" is therefore in the Library DLL and is used by the function-calling binary EXE over the called mechanism described above.
Zusätzlich zur eigentlichen Versionscodierung VC kann zum Zwecke der Benutzerinformation noch eine Versionsnummer in Klartext, beispielsweise als String, in die Bibliothek DLL eingebracht werden. Im Falle eines Versionskonfliktes beim Laden der Bibliothek DLL, kann dem Benutzer die Versionsnummer der fehlerhaften Bibliothek DLL über eine entsprechende Ausgabe mitgeteilt werden.In addition to actual version coding VC can still for the purpose of user information a version number in plain text, for example as a string, in the Library DLL will be introduced. In case of a version conflict When loading the library DLL, the user can get the version number the faulty library DLL over a corresponding issue will be communicated.
Neben
der in
Im initialen Schritt S8 wird zunächst die zu impfende Applikation EXE im System lokalisiert. Danach wird die Applikatione in Schritt S9 analysiert, um alle Bibliotheken DLL, die die Applikation EXE einbindet und mit deren Versionscodierungen sie geimpft werden soll, zu identifizieren. Für jede dieser Bibliotheken DLL wird die folgende Schleife von Schritt S10 bis Schritt S13 durchlaufen. Falls die Abfrage Q1 nach weiteren einzubindenden Bibliotheken DLL verneint wird, wird der Prozeß beendet und die Applikation EXE gilt als „geimpft".in the initial step S8 is first localized to be vaccinated application EXE in the system. After that will the applications analyzed in step S9 to all libraries DLL that integrates the EXE application and its version codes to be vaccinated, to identify. For each of these libraries DLL will go through the following loop from step S10 to step S13. If the query Q1 for further DLL libraries to include is denied, the process is terminated and the application EXE is considered "vaccinated".
Eine einzubindende Bibliothek DLL wird im System lokalisiert (Schritt S10) und ihr für die Versionscodierung VC reservierter Bereich R1 gesucht (Schritt S11). Falls die Bibliothek DLL keinen Bereich R1 besitzt, wird die Abfrage Q2 negativ beantwortet und der Impfprozeß abgebrochen. Andernfalls wird die Versionscodierung VC in Schritt S12 aus dem Bereich R1 ausgelesen, in den Bereich R2 der Applikation EXE hineingeschrieben (Schritte S12, S13) und zur Abfrage Q1 weiterverzweigt.A library to be included DLL is localized in the system (step S10) and you for searched the version coding VC reserved area R1 (step S11). If the library DLL does not have an area R1, the Query Q2 answered negatively and the vaccination process aborted. Otherwise becomes the version coding VC in step S12 from the area R1 read into the area R2 of the application EXE (Steps S12, S13) and further branched to the query Q1.
Bei
der Impfung einer Applikation EXE mit den Versionscodierungen VC
mehrerer Bibliotheken DLL1, DLL2 gibt es dann prinzipiell zwei Möglichkeiten.
Die Versionscodierungen können
dann einzeln in einer Liste oder einem Feld (Array) der Applikation hinterlegt
werden, oder sie werden zu einer Versionscodierung zusammengefaßt, die
alle einzelnen Versionscodierungen verlustfrei repräsentiert.
So kann beispielsweise ein Hash-Wert über die Summe aller Hash-Werte
gebildet und abgespeichert werden. In diesem Falle wird in
In Schritt S15 wird die einzubindende Bibliothek DLL von der Applikation EXE dynamisch oder statisch geladen. Beim dynamischen Laden wird eine Bibliothek DLL bei Bedarf durch die Applikation EXE vor den Aufruf einer Bibliotheksfunktion geladen. Die Versionsüberprüfung der Bibliothek DLL schließt sich dann unmittelbar an den Ladevorgang an und wird somit zur Laufzeit der Applikation EXE durchgeführt.In Step S15 becomes the library DLL to be included by the application EXE dynamically or statically loaded. When dynamic loading is a library DLL if necessary by the application EXE before the Calling a library function loaded. The version check of the Library DLL closes then directly to the charging process and is thus at runtime the application EXE performed.
Beim statischen Laden wird eine Bibliothek DLL direkt nach dem Start der Applikation EXE und vor dem Aufrufen des Konstruktors der Applikation EXE geladen. Die anschließende Überprüfung der Versionscodierung VC der Bibliothek DLL findet dann in der Instanziierungsroutine der Applikation EXE statt. Diese kann dann entweder im Konstruktor der Applikation EXE oder in der später auszuführenden InitInstance-Routine der Windows-Laufzeitumgebung durchgeführt werden. Im Gegensatz zum dynamischen Laden können statisch geladene Bibliotheken DLL während der Laufzeit der Applikation EXE nicht mehr gewechselt werden.At the static loading becomes a library DLL right after the start the application EXE and before calling the constructor of the application EXE loaded. The subsequent verification of the version coding VC of the library DLL then finds in the instantiation routine the application EXE instead. This can then either in the constructor the application EXE or in the InitInstance routine to be executed later the Windows runtime environment carried out become. Unlike dynamic loading, static libraries can be used Dll during the runtime of the EXE application can no longer be changed.
Innerhalb des Binärcodes der Bibliothek DLL wird dann der ausgezeichnete Bereich R1 gesucht, in dem die Versionscodierung VC der Bibliothek zu finden ist (Schritt S16). Falls dieser Bereich R1 in der funktionsbereitstellenden Binärdatei DLL nicht existiert, z.B. weil die Bibliothek DLL gar nicht geimpft wurde, wird sie bei der Abfrage Q4 sofort zurückgewiesen. Diese Zurückwei sung erfolgt vorteilhaft während des Ladevorgangs der Bibliothek DLL. Der Benutzer kann also sofort erkennen, ob die vorhandenen Bibliotheken DLL in den richtigen Versionen vorliegen. Im negativen Fall wird die Applikation EXE ohne schädigende Nebeneffekte zu verursachen und mit einer instruktiven Fehlermeldung kontrolliert beendet.Within of the binary code the library DLL is then searched for the excellent area R1, in which the version coding VC of the library can be found (step S16). If this area R1 in the function providing binary file DLL does not exist, e.g. because the library DLL was not vaccinated at all, it will be rejected immediately at query Q4. This rejection solution takes place during advantageous loading library DLL. The user can therefore immediately Detect if the existing DLL libraries are in the correct versions available. In the negative case, the application EXE without damaging To cause side effects and with an instructive error message controlled finished.
Falls
der Bereich R1 gefunden wurde, wird in Schritt S17 die Versionscodierung
VC ausgelesen und in Schritt S18 der ausgezeichnete Bereich R2 der
Applikation lokalisiert, der die Versionscodierungen VC aller von
der Applikation eingebundenen Bibliotheken DLL vorhält. In Schritt
Falls
im Bereich R2 nicht jede Versionscodierung der verschiedenen Bibliotheken
einzeln vorliegt, sondern, wie im Zusammenhang mit
Bei Zurückweisung auch nur einer Bibliothek DLL, wird die Applikation EXE sofort kontrolliert beendet. In diesem Falle wird dem Benutzer die inkompatible Bibliothek DLL mitgeteilt, so daß einerseits die Systemintegrität gewahrt bleibt und sich anderseits eine sinnvolle Fehlerbeseitigung anschließen kann. Dieses Verfahren schließt also die mit einem Versionskonflikt verbundenen unerwünschten Fehlereffekte vollständig aus.at rejection even a library DLL, the application EXE is immediately controlled completed. In this case, the user becomes the incompatible library Dll communicated so that on the one hand the system integrity is maintained and on the other hand a meaningful error correction connect can. This procedure concludes So the undesirable associated with a version conflict Error effects completely out.
Die
In
Während in
Neben dem Ansatz, die Überprüfung durch die funktionsaufrufende Binärdatei selbst durchführen zu lassen, ist es im Rahmen dieser Erfindung analog zum separaten Impfprogramm VAC natürlich auch möglich, ein separates Verifikationsprogramm bereitzustellen, das eine initiale Überprüfung einer Applikation und der davon abhängigen Bibliothekskaskade durchführt.Next the approach, the review by the function-calling binary file perform yourself it is analogous to the separate in the context of this invention Vaccination program VAC, of course possible, to provide a separate verification program that provides an initial review of an application and dependent on it Performs library cascade.
Im Falle einer M-zu-N Relation ist der Impfprozeß nicht mehr so strikt zu trennen in je einen separaten Anwendungsfall für funktionsaufrufende Applikationen und funktionsbereitstellende Bibliotheken. Vielmehr muß bei der Impfung beispielsweise der Bibliothek DLL1 zunächst eine „funktionsbereitstellende Impfung' mit der in den Bereich R1 einzubringenden Versionscodierung VC1 und anschließend eine „funktionsaufrufende Impfung' mit den in den Bereich R2 einzubringenden Versionscodierungen VC2 und VC3 der Bibliotheken DLL2 und DLL3 durchgeführt werden. Daraus ergeben sich bei der Impfung einer ganzen Kaskade von Applikationen und Bibliotheken bestimmte zeitliche Abhängigkeiten, die beim Impfprozeß zu berücksichtigen sind.in the In the case of an M-to-N relation, the vaccination process can no longer be so strictly separated in each case a separate application for function-calling applications and functional libraries. Rather, at the Inoculation example, the library DLL1 first a "function-providing Vaccination 'with the in the area R1 to be introduced version coding VC1 and then a "function-calling Vaccination 'with the in the area R2 to be introduced version codes VC2 and VC3 libraries DLL2 and DLL3. Result from this in the vaccination of a whole cascade of applications and Libraries have certain temporal dependencies to consider in the vaccination process are.
Claims (42)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE200410039200 DE102004039200A1 (en) | 2004-08-12 | 2004-08-12 | Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE200410039200 DE102004039200A1 (en) | 2004-08-12 | 2004-08-12 | Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program |
Publications (1)
Publication Number | Publication Date |
---|---|
DE102004039200A1 true DE102004039200A1 (en) | 2006-02-23 |
Family
ID=35721331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
DE200410039200 Ceased DE102004039200A1 (en) | 2004-08-12 | 2004-08-12 | Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program |
Country Status (1)
Country | Link |
---|---|
DE (1) | DE102004039200A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1959343A1 (en) | 2007-02-15 | 2008-08-20 | Giesecke & Devrient GmbH | Method for analysing the software configuration of a portable data storage device |
CN106909469A (en) * | 2015-12-22 | 2017-06-30 | 中国移动通信集团公司 | A kind of file verification method and apparatus |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE68924061T2 (en) * | 1989-05-12 | 1996-04-18 | Ibm | Version control in a data processing system. |
DE19530095A1 (en) * | 1995-08-16 | 1997-02-20 | Martin Engwicht | Access monitoring for software, data carriers |
DE10051645A1 (en) * | 1999-10-18 | 2001-08-09 | Fisher Rosemount Systems Inc | Method and device for controlling versions and producing logs and lists in a process control system incorporates a computer-readable medium and a processor for communicating with that medium. |
-
2004
- 2004-08-12 DE DE200410039200 patent/DE102004039200A1/en not_active Ceased
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE68924061T2 (en) * | 1989-05-12 | 1996-04-18 | Ibm | Version control in a data processing system. |
DE19530095A1 (en) * | 1995-08-16 | 1997-02-20 | Martin Engwicht | Access monitoring for software, data carriers |
DE10051645A1 (en) * | 1999-10-18 | 2001-08-09 | Fisher Rosemount Systems Inc | Method and device for controlling versions and producing logs and lists in a process control system incorporates a computer-readable medium and a processor for communicating with that medium. |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1959343A1 (en) | 2007-02-15 | 2008-08-20 | Giesecke & Devrient GmbH | Method for analysing the software configuration of a portable data storage device |
DE102007007481A1 (en) | 2007-02-15 | 2008-08-21 | Giesecke & Devrient Gmbh | Method for analyzing a software configuration of a portable data carrier |
CN106909469A (en) * | 2015-12-22 | 2017-06-30 | 中国移动通信集团公司 | A kind of file verification method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE19945992B4 (en) | Dynamically optimizing object code translator for architecture emulation and dynamically optimizing object code translation process | |
EP1723513B1 (en) | Method for configuring a computer program | |
Bartussek et al. | Using assertions about traces to write abstract specifications for software modules | |
DE69909945T2 (en) | Method and arrangement for correlating profile data dynamically generated by an optimized executable program with source code instructions | |
EP0432802A2 (en) | Method for the automatic parsing of the computer program text in compilers | |
EP1904923A1 (en) | Method and software system for the configuration of a modular system | |
CN112328226B (en) | Embedded system automatic test code generation method and device | |
DE19581754B4 (en) | System and method for conditionally compiling a software compilation unit | |
DE69907714T2 (en) | COMPONENT-BASED SOURCE CODE GENERATOR METHOD | |
DE112018002316T5 (en) | CODE COVERAGE TRACKING FOR A MICROCONTROLLER PROGRAM | |
EP2977888B1 (en) | Method and system for storage and version management of computer programs | |
WO2009010338A1 (en) | Method for the computer-assisted obfuscation of a software program and computer program product | |
DE102019008598A1 (en) | Identification and visualization of associations between code generated by a model and sources that influence code generation | |
DE102004039200A1 (en) | Version-marking of binary data function routines or DLLs to enable checking of consistency with a calling binary data or executable program, by incorporating a code within the DLL so that it can be checked by a calling EXE program | |
DE2249852A1 (en) | COMPUTER SYSTEM | |
DE102019105418B3 (en) | Method for generating a representation of program logic, decompiling device, recompiling system and computer program products | |
DE19924437A1 (en) | Global register initialization method in network, by using global variable information contained in object file | |
DE102010047954A1 (en) | Formal offline verification of executable models | |
DE10300541A1 (en) | Workable data file generation method, involves dividing target name into parts at given points | |
Strittmatter | A Reference Structure for Modular Metamodels of Quality-Describing Domain-Specific Modeling Languages | |
EP3759594A1 (en) | Method for executing a computer program in a computer network, in particular in order to control a microscope | |
DE102017212612A1 (en) | Method for automatically generating tests for the software of a vehicle | |
Gómez et al. | GraCoT, a tool for co-creation of models and metamodels in specific domains | |
Gniesser | Refactoring support for ATL-based model transformations | |
Hoffman et al. | Tool support for executable documentation of Java class hierarchies |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
OP8 | Request for examination as to paragraph 44 patent law | ||
R016 | Response to examination communication | ||
R016 | Response to examination communication | ||
R016 | Response to examination communication | ||
R002 | Refusal decision in examination/registration proceedings | ||
R006 | Appeal filed | ||
R008 | Case pending at federal patent court | ||
R003 | Refusal decision now final | ||
R010 | Appeal proceedings settled by withdrawal of appeal(s) or in some other way |