Skip to content

Commit

Permalink
Prepared fix for issue #1118.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Nov 6, 2024
1 parent 3c18dd1 commit ecb410c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/org/nschmidt/ldparteditor/text/Win32LnkParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ public static File resolveLnkShortcut(File lnkFile) {
try (DataInputStream is = new DataInputStream(new FileInputStream(lnkFile))) {
// FIXME Needs implementation!

// Read header size
final int headerSize = Integer.reverseBytes(is.readInt());
System.out.println(Integer.toHexString(headerSize));

// Read and skip the header
is.readNBytes(headerSize);

// Read and skip 4 bytes of LinkFlags
is.readInt();

// Read and skip 4 bytes of FileAttributesFlags
is.readInt();

// Read and skip 4 bytes of HotKeyFlags
is.readInt();

// Read and skip the LinkTargetIDList
final int idListSize = is.readUnsignedShort();
is.readNBytes(idListSize);

} catch (IOException ex) {
NLogger.debug(Win32LnkParser.class, ex);
}
Expand Down

0 comments on commit ecb410c

Please sign in to comment.