Ich habe da eine Lösung Mit Danilos Hilfe hatte ich damals herausgefunden, wie man sich die ID's beschafft.
Hier meine Variante, die bei mir wunderbar auch mit der 5.40 Final läuft...
Wobei ich gerne die Variante mit der Ver-, und Entpackungsgeschichte (BriefLZ) auch sehen würde
Code: Alles auswählen
;{==================================================================================
;: Name : BinToData
;: Author : Original by Stargate (modified by George Bisonte)
;: Date : July 02, 2014
;: Compiler : PureBasic 5.22 LTS (Windows - x86) - (c) 2014 Fantaisie Software
;: Subsystem : none
;: TargetOS : Windows
;: License : ???
;: ---------------------------------------------------------------------------------
;: http://
;}==================================================================================
;{==================================================================================
;: Configure as
;:
;: Commandline: "%FILE"
;:
;: [x] Wait until tool quits
;:
;}==================================================================================
Structure FindWindowParams
hWnd.i
Name.s
child.i
EndStructure
Structure xIDE_PREFERENCES
Map Key.s()
EndStructure
Global NewMap PB_Environment.s()
Global NewMap PBPrefs.xIDE_PREFERENCES()
Procedure GetPBEnvironment()
Protected Result = #False
ClearMap(PB_Environment())
If ExamineEnvironmentVariables()
While NextEnvironmentVariable()
If Left(UCase(EnvironmentVariableName()),Len("PB_TOOL_")) = "PB_TOOL_"
PB_Environment(UCase(EnvironmentVariableName())) = EnvironmentVariableValue()
EndIf
Wend
Result = #True
EndIf
ProcedureReturn Result
; ; Example
; Define NewMap PBE.s()
; If GetPBEnvironment(PBE.s())
; Debug PB_Environment("PB_TOOL_Compiler")
; EndIf
EndProcedure
Procedure ReadPBPreferences(PrefsFile.s = "")
Protected Result = #False
Protected *itemid.ITEMIDLIST
Protected location.s = Space(#MAX_PATH)
ClearMap(PBPrefs())
If FileSize(PrefsFile) < 1
If GetPBEnvironment()
PrefsFile = PB_Environment("PB_TOOL_PREFERENCES")
EndIf
If PrefsFile = ""
If SHGetSpecialFolderLocation_ (0, #CSIDL_APPDATA, @*itemid) = #NOERROR
If SHGetPathFromIDList_(*itemid, @location)
CoTaskMemFree_(*itemid)
If Right(location, 1) <> "\" : location + "\"
EndIf
PrefsFile = location
EndIf
EndIf
EndIf
EndIf
If FileSize(PrefsFile) > 0
If OpenPreferences(PrefsFile)
If ExaminePreferenceGroups()
While NextPreferenceGroup()
If ExaminePreferenceKeys()
While NextPreferenceKey()
PBPrefs(PreferenceGroupName())\Key(PreferenceKeyName()) = PreferenceKeyValue()
Wend
EndIf
Wend
EndIf
ClosePreferences()
Result = #True
EndIf
EndIf
ProcedureReturn Result
EndProcedure
Procedure.s GetPBPrefsValue(Group.s, Key.s)
Protected Value.s = ""
If FindMapElement(PBPrefs(), Group)
Value = PBPrefs(Group)\Key(Key)
EndIf
ProcedureReturn Value
EndProcedure
Procedure.s GetPBIndentString()
If Not FindMapElement(PBPrefs(), "Global")
ReadPBPreferences()
EndIf
If Val(GetPBPrefsValue("Global", "RealTab")) = 1
ProcedureReturn #TAB$
Else
ProcedureReturn Space(Val(GetPBPrefsValue("Global", "TabLength")))
EndIf
EndProcedure
Procedure IDE_Enum(WindowHandle, *Param.FindWindowParams)
Protected Class.s = Space(200)
If *Param\child = #True
EnumChildWindows_(WindowHandle, @IDE_Enum(), *Param)
EndIf
GetClassName_(WindowHandle, @Class, 200)
If FindString(Class, *Param\Name, 1)
If IsWindowVisible_(WindowHandle)
*Param\hWnd = WindowHandle
ProcedureReturn 0 ; stoppt die suche
Else
ProcedureReturn 1 ; lässt sie weiterlaufen
EndIf
Else
ProcedureReturn 1 ; lässt sie weiterlaufen
EndIf
EndProcedure
Procedure IDE_MAINWINDOW()
Protected Param.FindWindowParams
Protected hWnd = 0, Title.s = Space(1000)
Param\Name = "WindowClass_2"
Param\hWnd = 0
EnumWindows_(@IDE_Enum(),Param)
hWnd = Param\hWnd
GetWindowText_(hwnd, @Title, 1000)
If Left(Title, 10) = "PureBasic "
ProcedureReturn hWnd
Else
ProcedureReturn 0
EndIf
EndProcedure
Procedure IDE_SCINTILLA()
Protected Param.FindWindowParams
Protected WindowID = IDE_MAINWINDOW()
If WindowID
Param\Name = "Scintilla"
Param\hWnd = 0
Param\child = #True
EnumChildWindows_(WindowID, @IDE_Enum(), Param)
ProcedureReturn Param\hWnd
EndIf
ProcedureReturn #False
EndProcedure
Procedure SendToIDE(Message.s)
Protected ProcessID, PID, Length, Format, *Buffer, *MemoryID, hWnd
Protected WindowID , ScintillaID, Title.s = Space(1000)
Protected Param.FindWindowParams
WindowID = IDE_MAINWINDOW()
ScintillaID = IDE_SCINTILLA()
If ScintillaID
If GetWindowThreadProcessId_(WindowID, @PID)
ProcessID = OpenProcess_(#PROCESS_ALL_ACCESS, #False, PID)
If ProcessID
Select SendMessage_(ScintillaID, #SCI_GETCODEPAGE, #Null, #Null)
Case 0 : Format = #PB_Ascii
Case 65001 : Format = #PB_UTF8
EndSelect
Length = StringByteLength(Message, Format)
*Buffer = AllocateMemory(Length + SizeOf(Character))
If *Buffer
PokeS(*Buffer, Message, -1, Format)
*MemoryID = VirtualAllocEx_(ProcessID, #Null, Length, #MEM_RESERVE|#MEM_COMMIT, #PAGE_EXECUTE_READWRITE)
If *MemoryID
WriteProcessMemory_(ProcessID, *MemoryID, *Buffer, Length, #Null)
SendMessage_(ScintillaID, #SCI_REPLACESEL, 0, *MemoryID)
VirtualFreeEx_(ProcessID, *MemoryID, Length, #MEM_RELEASE)
EndIf
FreeMemory(*Buffer)
EndIf
CloseHandle_(ProcessID)
EndIf
EndIf
EndIf
EndProcedure
EnableExplicit
Enumeration
#File
#RegularExpression
EndEnumeration
Structure QuadArray
q.q[0]
EndStructure
Define.s IS, FileName, Label, Output
Define *Buffer.QuadArray, Length, LastIndex, Index
If Not GetPBEnvironment()
MessageRequester("Error", "Start this program from the PB-IDE !")
End
EndIf
IS = GetPBIndentString()
FileName = ProgramParameter(0)
Label = GetFilePart(FileName, #PB_FileSystem_NoExtension)
CreateRegularExpression(#RegularExpression, "\W")
Label = ReplaceRegularExpression(#RegularExpression, Label, "_")
FreeRegularExpression(#RegularExpression)
CreateRegularExpression(#RegularExpression, "^\d")
If MatchRegularExpression(#RegularExpression, Label)
Label = "_" + Label
EndIf
FreeRegularExpression(#RegularExpression)
If ReadFile(#File, FileName)
Length = Lof(#File)
If Length % SizeOf(Quad)
Length + (SizeOf(Quad) - Length % SizeOf(Quad))
EndIf
LastIndex = Length / SizeOf(Quad) - 1
*Buffer = AllocateMemory(Length)
If *Buffer
ReadData(#File, *Buffer, Length)
Output + "DataSection" + #CRLF$
Output + IS + Label + "_" + GetExtensionPart(FileName) + "_start: ;{ Datas : Size = " + Str(Length) + " Bytes"
For Index = 0 To LastIndex
If Index % 5 = 0
Output + #CRLF$ + IS + "Data.q $" + RSet(Hex(*Buffer\q[Index], #PB_Quad), 16, "0")
Else
Output + ",$" + RSet(Hex(*Buffer\q[Index], #PB_Quad), 16, "0")
EndIf
Next
Output + #CRLF$ + IS + Label + "_" + GetExtensionPart(FileName) + "_eof: ;}"
Output + #CRLF$ + "EndDataSection" + #CRLF$
SendToIDE(OutPut)
FreeMemory(*Buffer)
EndIf
CloseFile(#File)
EndIf