1515 */
1616package psx ;
1717
18- import java .io .File ;
1918import java .io .IOException ;
2019import java .io .InputStream ;
2120import java .math .BigInteger ;
2221import java .util .*;
2322import java .util .concurrent .TimeUnit ;
2423
25- import javax .swing .JFileChooser ;
26- import javax .swing .filechooser .FileNameExtensionFilter ;
27-
2824import docking .widgets .OptionDialog ;
2925import ghidra .app .cmd .disassemble .DisassembleCommand ;
3026import ghidra .app .cmd .function .ApplyFunctionDataTypesCmd ;
6763import ghidra .util .exception .NotFoundException ;
6864import ghidra .util .task .TaskMonitor ;
6965import psyq .DetectPsyQ ;
70- import psyq .sym .SymFile ;
7166
7267public class PsxLoader extends AbstractLibrarySupportLoader {
7368
@@ -225,26 +220,6 @@ protected void load(ByteProvider provider, LoadSpec loadSpec, List<Option> optio
225220 }
226221
227222 monitor .setMessage ("Loading PSX binary done." );
228-
229- try {
230- TimeUnit .SECONDS .sleep (1 );
231- } catch (InterruptedException e ) {
232- }
233-
234- if (OptionDialog .YES_OPTION == OptionDialog .showYesNoDialogWithNoAsDefaultButton (null ,
235- "Question" , "Do you have .SYM file for this executable?" )) {
236- String symPath = showSelectFile ("Select file..." , program .getExecutablePath ());
237-
238- if (symPath == null ) {
239- return ;
240- }
241-
242- int transId = program .startTransaction ("Load and apply SYM file..." );
243- SymFile symFile = SymFile .fromBinary (symPath , program , log , monitor );
244- symFile .applyOverlays (program , log , monitor );
245- symFile .apply (program , log , monitor );
246- program .endTransaction (transId , true );
247- }
248223 }
249224
250225 public static DataTypeManagerService getDataTypeManagerService (Program program ) {
@@ -261,7 +236,8 @@ private static void addPsyqVerOption(Program program, long searchBase, MessageLo
261236 opts .registerOption (PSYQ_VER_OPTION , "" , null , "PsyQ version" );
262237
263238 if (!psyqVersion .isEmpty ()) {
264- String ver = String .format ("%s.%s" , psyqVersion .charAt (0 ), psyqVersion .charAt (1 ));
239+ char subVer = psyqVersion .charAt (2 );
240+ String ver = String .format ("%s.%s%s" , psyqVersion .charAt (0 ), psyqVersion .charAt (1 ), subVer != '0' ? subVer : "" );
265241 opts .setString (PSYQ_VER_OPTION , ver );
266242 }
267243 } catch (MemoryAccessException | AddressOutOfBoundsException ignored ) {
@@ -338,20 +314,6 @@ public static String getProgramPsyqVersion(Program program) {
338314 return opts .getString (PsxLoader .PSYQ_VER_OPTION , "" ).replace ("." , "" );
339315 }
340316
341- private static String showSelectFile (String title , String baseDir ) {
342- JFileChooser jfc = new JFileChooser (new File (baseDir ));
343- jfc .setDialogTitle (title );
344-
345- jfc .setFileFilter (new FileNameExtensionFilter ("Symbols File" , "sym" ));
346- jfc .setMultiSelectionEnabled (false );
347-
348- if (jfc .showOpenDialog (null ) == JFileChooser .APPROVE_OPTION ) {
349- return jfc .getSelectedFile ().getAbsolutePath ();
350- }
351-
352- return null ;
353- }
354-
355317 private static void setRegisterValue (FlatProgramAPI fpa , String name , long startAddress , long value , MessageLog log ) {
356318 Program program = fpa .getCurrentProgram ();
357319
0 commit comments