Grinch_ Posted July 7, 2018 Share Posted July 7, 2018 (edited) Binary IPL If you don't know anything about ipl I'll suggest you read from below sites first covering the text ipl files. GTA Mods Basically binary ipl files are text ipl in binary format.Its only present in GTA San Andreas, GTA IV, and Bully Scholarship Edition. Only INST & CARS sections are found used by R*, about the rest sections are unknown. These files are basically located inside IMG archives Before we start, I'm listing tools you'll need, 1.Text Editor(Notepad will do) 2.An IMG Editor. I suggest this one IMG Factory 3.A text to the binary ipl compiler. I suggest Fastman92 processor Basically, binary & text ipl are totally the same. There's a structure for the binary ipl here. Let's take a look at an inst line Normal Ipl: Quote 15072, PLS_carpark, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1 Binary Ipl: Quote 15072, dummy, 0, 2579.8796445, 645.50208432, 9.93, 0, 0, 0, 1, -1 These above two lines are the placement data of the same object. First one is the line in text ipl files & the second one is the decompiled form of the binary line. It's not actually related to this converting thingy but I just wanted to point it out that the name is actually ignored by the game both in text & binary form. So, now extract the fastman92 processor in a folder. After that copy your ipl files there. Let's take a look at our ipl file, Now edit the fastman92_processor.bat You'll find a window like this, Next, you'll have to do is change this line, fastman92_processor.exe /file_type ipl /input_type binary /input_game GAME_EXACT_BULLY_SCHOLARSHIP_EDITION_PC /input_filename "trich.ipb" /output_type text /output_game GAME_EXACT_BULLY_SCHOLARSHIP_EDITION_PC /output_filename "trich.ipl" /string_list data\bully_strings.txt With this one below, fastman92_processor.exe /file_type ipl /input_type text /input_game GAME_EXACT_GTASA_PC /input_filename "bin.ipl" /output_type binary /output_game GAME_EXACT_GTASA_PC /output_filename "bin_stream.ipl" Change your input and output file names in the above code but keep the _stream extension in the output file name or you'll have to add it later. Next, save it and run. After running you'll end up with something like this, after this open up your IMG archive(gta3.img or other) using IMG Factory and import it and rebuild. Then create a new text file and rename it with your output file but without the _stream extension. I've only used "bin_stream.ipl" file but multiple binary ipl files can also be loaded through a single text counterpart by using below naming scheme, Quote bin_stream0.ipl bin_stream1.ipl bin_stream2.ipl bin_stream3.ipl ... etc The file preview You can leave this file empty but it's necessary to load the binary file. Please be caution with naming. The only difference with this and the binary file should be "_stream" or it won't work. After this copy this file location and goto your game directory data/ and open up the gta.dat file. Then goto ipl section paste your file location like this, or if you got modloader you can just paste the location in a text file and put it in mod loader directory. Then save it. Now run your game and check if the object is spawned or not. Thanks to fastman92 and junior for their help with this. Note: I learned all this through trial and error process. So, if I wrote anything wrong, please point it and I'll fix it as soon as I can. Thanks! Edited May 24, 2019 by Grinch_ damiann69, kkjj and RyanDri3957V 3 Link to comment Share on other sites More sharing options...
fastman92 Posted July 16, 2018 Share Posted July 16, 2018 I recommend you to make a batch script for converting the file in both ways. Fastman92 processor is command-line application. It's your task to make some form of GUI if necessary. RyanDri3957V and Grinch_ 2 Link to comment Share on other sites More sharing options...
Grinch_ Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) 5 hours ago, fastman92 said: I recommend you to make a batch script for converting the file in both ways. Fastman92 processor is command-line application. It's your task to make some form of GUI if necessary. hmm.Still,its one of the best one yet.Cause most of them I've tied didnt work for me rather than this. Edited July 16, 2018 by Inan-Ahammad Link to comment Share on other sites More sharing options...
fastman92 Posted July 16, 2018 Share Posted July 16, 2018 Binary placement files are also used in Bully Scholarship Editor. Grinch_ and RyanDri3957V 2 Link to comment Share on other sites More sharing options...
boludoz Posted April 7, 2021 Share Posted April 7, 2021 (edited) #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <AutoItConstants.au3> #include <Process.au3> Global $g_sFilePath = "", $g_sSetFile = "", $g_hSelect = 0 Global $g_hForm1, $g_hLabel2, $g_hButton1, $g_hBackup, $g_hButton2, $g_hLog #Region ### START Koda GUI section ### Form=C:\ufc\pywrite\Form1.kxf $g_hForm1 = GUICreate("GTA San Andreas IPL CONVERTER.", 295, 296, 379, 211) $g_hLabel2 = GUICtrlCreateLabel("IPL CONVERTER. (It is automatic Backup/decomp.).", 16, 32, 242, 17) $g_hButton1 = GUICtrlCreateButton("Select", 32, 88, 73, 25) $g_hSelect = GUICtrlCreateInput("Select fileload.* file.", 16, 56, 265, 21) $g_hBackup = GUICtrlCreateCheckbox("Backup", 176, 88, 81, 17) $g_hButton2 = GUICtrlCreateButton("Start", 104, 256, 89, 25) $g_hLog = GUICtrlCreateEdit("", 16, 128, 257, 113) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $g_hButton1 ; Select ; Create a constant variable in Local scope of the filepath that will be read/written to. $g_sFilePath = FileOpenDialog("Select IPL file.", @ScriptDir & "\", "IPL (*.ipl)|All Files (*.*)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT)) If @error <> 0 Or StringIsSpace($g_sFilePath) Then $g_sFilePath = $g_sSetFile If $g_sFilePath <> $g_sSetFile Then $g_sSetFile = String($g_sFilePath) GUICtrlSetData($g_hSelect, $g_sFilePath) EndIf Case $g_hButton2 ; Start FixTool() EndSwitch WEnd Func FixTool() Static $sLog = "Fail", $sExtended = 0 Local $aFiles = StringSplit($g_sFilePath, "|", 2) If Not @error Or FileExists($g_sFilePath) Then If StringInStr($g_sFilePath, "|") > 0 Then For $s = 1 To UBound($aFiles) -1 $aFiles[$s] = $aFiles[0] & "\" & $aFiles[$s] Next _ArrayDelete($aFiles, 0) Else Local $aFiles[1] = [$g_sFilePath] EndIf ; _ArrayDisplay($aFiles) $sLog = "# LOG" & @CRLF For $s in $aFiles If FileExists($s) = 0 Then ContinueLoop ; Open the file for reading and store the handle to a variable. Local $hFileOpen = FileOpen($s, $FO_BINARY) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file. - " & $s) ContinueLoop EndIf ; Read the contents of the file using the handle returned by FileOpen. Local $sFileRead = FileRead($hFileOpen) Local $sBaka = $s & '.tmp' FileCopy($s, $sBaka) SetLog(StringLeft($sFileRead, 10)) If StringLeft($sFileRead, 10) = "0x626E7279" Then FileClose($hFileOpen) $sExtended = runHelper('"' & @ScriptDir & "\fastman92_processor.exe" & '" /file_type ipl /input_type binary /input_game GAME_EXACT_GTASA_PC /input_filename "' & $s & '" /output_type text /output_game GAME_EXACT_GTASA_PC /output_filename "' & $sBaka & '"') $sExtended = "input_type binary" If _IsChecked($g_hBackup) Then FileCopy($s, $s & ".oldbin") EndIf Else FileCopy($s, $sBaka) $sExtended = runHelper('"' & @ScriptDir & "\fastman92_processor.exe" & '" /file_type ipl /input_type text /input_game GAME_EXACT_GTASA_PC /input_filename "' & $s & '" /output_type binary /output_game GAME_EXACT_GTASA_PC /output_filename "' & $sBaka & '"') $sExtended = "input_type text" If _IsChecked($g_hBackup) Then FileCopy($s, $s & ".oldtext") EndIf EndIf FileMove($s & ".tmp", $s, $FC_OVERWRITE) $sLog &= $s & " - " & $sExtended & @CRLF Next EndIf GUICtrlSetData($g_hLog, $sLog) EndFunc ;==>Example Func Write($sFilePath, $dBINARYDATA) Local $hFile = FileOpen($sFilePath, $FO_OVERWRITE + $FO_BINARY) FileWrite($hFile, $dBINARYDATA) FileClose($hFile) EndFunc ;==>Example Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func runHelper($sMsg) Local $sCommand, $sDOS, $tHelperStartTime, $tTime_Difference Static $sMessage = '' SetLog($sMsg) $sCommand = $sMsg $sDOS = Run($sCommand, "", @SW_HIDE, 8) $tHelperStartTime = TimerInit() $sMessage = '' While 1 $sMessage &= StdoutRead($sDOS) If @error Then ExitLoop WEnd _RunDos("taskkill -f -im fastman92_processor.exe") ; force kill Return StringStripWS($sMessage, 7) EndFunc ;==>runHelper Func SetLog($s = "", $s2Dummy = "") ConsoleWrite($s & @CRLF) EndFunc AutoIT Script It has some bugs, but it is supposed to detect whether it is binary or text. Edited April 7, 2021 by boludoz Link to comment Share on other sites More sharing options...
Jieyang Posted July 20, 2021 Share Posted July 20, 2021 thank you Link to comment Share on other sites More sharing options...