From ecb410ced5ac91dcd4158e626d1a20efd45bd22c Mon Sep 17 00:00:00 2001 From: Nils Schmidt Date: Wed, 6 Nov 2024 21:59:21 +0100 Subject: [PATCH] Prepared fix for issue #1118. --- .../ldparteditor/text/Win32LnkParser.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/org/nschmidt/ldparteditor/text/Win32LnkParser.java b/src/org/nschmidt/ldparteditor/text/Win32LnkParser.java index 1a2bf53b..96e14982 100644 --- a/src/org/nschmidt/ldparteditor/text/Win32LnkParser.java +++ b/src/org/nschmidt/ldparteditor/text/Win32LnkParser.java @@ -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); }