Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"View as Text"/"Save to File" buttons do not function #10

Closed
headsetguy37 opened this issue Sep 10, 2020 · 9 comments
Closed

"View as Text"/"Save to File" buttons do not function #10

headsetguy37 opened this issue Sep 10, 2020 · 9 comments
Labels

Comments

@headsetguy37
Copy link

headsetguy37 commented Sep 10, 2020

Hello,

I am trying to extract resources from several classic Mac applications, but the buttons in the resource fork tab do not seem to do anything.

Example: A freeware Mac program called "99 Bottles" (which sings the infamous "99 Bottles of Beer" song at various speeds) contains several sound files. Here are the steps I take to attempt to extract one:

  1. Open volume containing 99 Bottles (specifically an HFV for SheepShaver)
  2. Right-click on 99 Bottles and click "Information" (alternatively, click on 99Bottles and then click "Info" button)
  3. Go to "Resource fork" tab
  4. Click on a snd file with the name "billion"
  5. Click "Save to File"
  6. Select the location where I want to save
  7. Name the file "billion.snd"
  8. Go to location I selected
  9. The location is empty

Expected behavior: It should have saved a file with the name I gave it in the place I specified.

Also, the "View as Text" button doesn't seem to do anything either.

HFSExplorer: 0.23.1, Build 230100 (latest)
OS: Windows 10, Build 1903
Java Runtime Environment: 1.8.0_261 (EDIT: Installed that version after original post; update did not fix it)

Any help would be appreciated!

-Johnny

@unsound
Copy link
Owner

unsound commented Sep 10, 2020

Hi, is there any error message or output in the debug console (File->Debug console)?

@unsound
Copy link
Owner

unsound commented Sep 10, 2020

Also if you could somehow share the HFV file I could take a look at it, see what's going on for myself.

@headsetguy37
Copy link
Author

headsetguy37 commented Sep 10, 2020

The HFV file was just one example. I'm hesitant to share it here because it contains sensitive information on it. The program does the same thing with every HFS image I've tested.
As for the debug console, see below for errors:

Exception in thread "AWT-EventQueue-0" org.catacombae.io.RuntimeIOException: Stream is closed!
at org.catacombae.io.SynchronizedReadableRandomAccessStream.addReference(SynchronizedReadableRandomAccessStream.java:238)
at org.catacombae.io.ReadableRandomAccessSubstream.(ReadableRandomAccessSubstream.java:46)
at org.catacombae.hfsexplorer.fs.ResourceForkReader.getResourceStream(ResourceForkReader.java:153)
at org.catacombae.hfsexplorer.gui.ResourceForkViewPanel$3.actionPerformed(ResourceForkViewPanel.java:151)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

@unsound
Copy link
Owner

unsound commented Sep 10, 2020

This was really quite simple to reproduce and a fix has been put on the 'proposed' branch (4092990). Let me know if the fix is valid.

@headsetguy37
Copy link
Author

Sorry, I'm having a heck of a time trying to build it. What are all the tools I need, and which batch files should I run? (I'm just so used to building from a Visual Studio solution, or using MinGW.)

@unsound
Copy link
Owner

unsound commented Sep 11, 2020

You'll need Oracle's JDK (https://java.sun.com) and also Apache Ant (https://ant.apache.org). Then after all the paths are set up (i.e. the javac and ant commands work in a shell) the command should be 'ant build-all'.
However for your convenience I'm attaching an up-to-date build of the the jar file (wrapped in a zip file because github only allows certain file extensions) that you can just drop into the 'lib' directory where HFSExplorer is installed:
hfsx.jar.zip

@headsetguy37
Copy link
Author

headsetguy37 commented Sep 11, 2020

Thank you! It works.
...Sort of. I now have a file, but it is the entire resource fork beginning with the resource I want. (For example, "billion.snd" begins with "billion", followed by "eigh", "eight", and so on.)

@unsound
Copy link
Owner

unsound commented Sep 11, 2020

That was a bug in a core I/O class that has now been fixed. It extracted too much data to the point that it overflowed the bounds of the resource fork entry. 984ec4b should fix it.
I'm attaching the updated jar file (zip wrapped) that you can place in 'lib':
csframework.jar.zip

@headsetguy37
Copy link
Author

And that fixed that one! Thank you so much! I'm marking this as closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants