startseite produkte
resource tuner console
beispiel-skripts
Bearbeiten der String-Tabelle
Dieser Skript zeigt, wie man eine String-Tabelle oder Message-Tabelle verändert, indem man die Werte einer externeren Unicode-Textdatei benutzt.
Dieses Skript bearbeitet die Strings in der Demo-EXE (wird mit dem RTC-Paket mitgeliefert) mit Werten aus der Definitionsdatei. Es ändert die Stringtabelle und fügt eine neue Messagetabelle mit Einträgen aus den externen Unicode-Textdateien "strings.txt" und "messages.txt" hinzu. Die modifizierte Datei wird in den Zielordner gespeichert.
Hinweis: Wenn Sie den Script-Code kopieren, stellen Sie bitte sicher, dass er keine Zeilenumbrüche enthält. Dies ist eine Anforderung von VBScript: der gesamte Befehl muss in einer Zeile stehen.
'------------------------------------------------------------------------------ ' ' This sample VBScript code provides a real-world example that demonstrates ' many of the features available in Resource Tuner Console. ' ' This code shows how to: ' - Modify a String Table using values from an external unicode text file. ' - Add a Message Table using values from an external unicode text file. ' ' The script will modify strings in DemoApp1.exe using the values from: ' - definition file "demoapp1.drc" in the "Demo\defs\" folder ' - unicode text file "strings.txt" in the "Demo\Src" folder ' - unicode text file "messages.txt" in the "Demo\Src" folder ' ' The resulting files will be created in the directory named "..\Demo\Release" ' ' '------------------------------------------------------------------------------ Sub Main PEFileProxy.PostDebugString "Aktualisierung der Prüfsumme im PE Dateikopf ist aktiviert." PEFileProxy.UpdateCheckSum = True PEFileProxy.PostDebugString "Die Erstellung einer Sicherungskopie ist deaktiviert." PEFileProxy.CreateBackUp = False PEFileProxy.PostDebugString "Opening the file..." PEFileProxy.OpenFile ".\demo\src\DemoApp1.exe" if (PEFileProxy.Terminated) then PEFileProxy.PostDebugString "Opening the file produced a fatal error." else PEFileProxy.PostDebugString "File successfully opened." if (not PEFileProxy.HasResources) then PEFileProxy.PostDebugString "The file contains no resources." else PEFileProxy.PostDebugString "The file contains resources." PEFileProxy.ClearDefinitions PEFileProxy.PostDebugString "Opening the definition file..." PEFileProxy.OpenDefinitionFile ".\demo\defs\demoapp1.drc" LangID = 0 ' Default PEFileProxy.PostDebugString "Editing String Table using TXT file..." ResourcesProxy.EditStringTableFromFileW LangID, CREATE_IF_NOT_EXIST, ".\demo\src\strings.txt" PEFileProxy.PostDebugString "Adding a New Message Table using the TXT file" ResourcesProxy.EditMessageTableFromFileW "1", LangID, CREATE_IF_NOT_EXIST, ".\demo\src\messages.txt" PEFileProxy.PostDebugString "Compiling all the changes..." PEFileProxy.Compile PEFileProxy.PostDebugString "Saving the file as a new file..." PEFileProxy.SaveAsNewImage ".\demo\release\demoapp1.exe" end if PEFileProxy.PostDebugString "Closing this file..." PEFileProxy.CloseFile end if end Sub '------------------------------------------------------------------------------ |
Um die Änderungen, die man in Test-EXE-Dateien gemacht hat, zu sehen, empfehlen wir die Benutzung von Resource Tuner GUI, einem visuellen Ressourcen-Editor.
Nachdem Sie Resource Tuner Console installiert haben, finden Sie die Beispiel-Skripts in dem Verzeichnis, in dem RTC installiert wurde. Das Setup-Programm erstellt auch das Verzeichnis "Demo" im RTC-Verzeichnis, der Testanwendungen im Unterverzeichnis "Demo\Src" enthält.
Die komplett illustrierte Schritt für Schritt Anleitung wie man Skripte benutzt
Download 60-Tage Resource Tuner Console Testversion
Kaufen Sie die Vollversion