Skip to content

Enable compatibility for Windows shortcut (.lnk) files on Linux and macOS.

License

Notifications You must be signed in to change notification settings

SECRET-GUEST/windows_link_reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

Version C Version Version

██╗     ███╗   ██╗██╗  ██╗    ██████╗ ███████╗ █████╗ ██████╗ ███████╗██████╗ 
██║     ████╗  ██║██║ ██╔╝    ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗
██║     ██╔██╗ ██║█████╔╝     ██████╔╝█████╗  ███████║██║  ██║█████╗  ██████╔╝
██║     ██║╚██╗██║██╔═██╗     ██╔══██╗██╔══╝  ██╔══██║██║  ██║██╔══╝  ██╔══██╗
███████╗██║ ╚████║██║  ██╗    ██║  ██║███████╗██║  ██║██████╔╝███████╗██║  ██║
╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝    ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚══════╝╚═╝  ╚═╝
                                                                              

LNK reader 🖥️

This program is designed to extract and open a file path from a Windows .lnk shortcut file on non-Windows systems. The program reads the binary content of the .lnk file, converts it into ASCII, attempts to find the longest valid path, and finally, tries to open the path using the system's default program.

Note: Older compilers may encounter issues with the use of the // style comments present in this code. If you're facing compilation issues, you might want to replace these comments with the traditional /* ... */ style. Alternatively, consider upgrading to a modern compiler version, such as GCC.

Capture.video.du.24-09-2023.01.32.40.webm

Note: In this video, it might seem slow because I was waiting for you to read the titles. This program opens .lnk links almost instantly, faster than Windows.




📋 Table of Contents

  1. Features
  2. Prerequisites
  3. Usage
  4. Recommendations
  5. Installation
  6. License
  7. Support & Questions

🌟 Features

  1. Binary to ASCII Conversion:

    • The program can convert binary data to its ASCII representation. This is especially handy for extracting textual information from binary data.
  2. RegEx-based Path Extraction:

    • Uses regular expressions to extract the longest valid file path from the ASCII representation of the .lnk file.
  3. OS Notification System:

    • Detects the underlying operating system (Linux or MacOS) and notifies the user using an appropriate notification mechanism if there are any errors or issues.
  4. Path Normalization:

    • Transforms any Windows-style backslashes in paths (\) to UNIX-style forward slashes (/), ensuring compatibility with non-Windows systems.
  5. Mounted Path Detection:

    • If the direct path extracted from the .lnk file doesn't exist on the file system, the program will attempt to find a corresponding mounted path (useful for systems with mounted Windows filesystems).
  6. Default System Program Path Opening:

    • Once a valid path is identified, the program attempts to open it using the default program of the OS. If the path is not directly accessible, it will try to open its parent directory.
  7. Fast install :

    • You can install it faster with the script setup.sh

🔍 Prerequisites

Before you begin, ensure you have the following installed:

  • GCC (GNU Compiler Collection) to compile the source code.
  • Linux or macOS (other Unix-like systems may work but are not officially supported).

💎 Recommendations

In your quest for more tools to enhance your desktop productivity, these additional repositories are worth a look:

  • File organizer : A versatile tool for sorting and organizing files efficiently, ideal for managing recovered data.

Looking for more? Discover user-friendly, GUI-free script here:

If you're a 3D animator, consider:

📥 Installation

LINUX Systems:

  1. Simply run setup.sh in same directory where is lnkReader.c
    chmod +x setup.sh
    then right click, execute or
    ./setup.sh

But if you prefere a manual installation you can follow steps behind :

  1. Clone the repository:

    git clone https://github.com/SECRET-GUEST/windows_link_reader.git
  2. Navigate to the project folder:

    cd REPOSITORY
  3. Compile the program:

    gcc lnkReader.c -o open_lnk
  4. Try the program:

    ./open_lnk YOUR_FILE.lnk

Debian Systems - Creating a .desktop Application to run lnk by simple click

  1. Create a new .desktop file:
    vim ~/.local/share/applications/open_lnk.desktop

Note: use vim nano or whatever else txt editor

  1. Add the following content to the file, adjusting paths as necessary:

    [Desktop Entry]
    Version=1.0
    Name=Open LNK
    Comment=Open a Windows .lnk file
    Exec=/path_to_compiled_program/open_lnk %U
    Terminal=true
    Type=Application
    Categories=Utility;
    
  2. Make the .desktop file executable:

    chmod +x ~/.local/share/applications/open_lnk.desktop
  3. Now, you just have to use the program by default for .lnk files, by "open with" or in the properties.

MacOS Systems:

I don't know why am I doing this tutorial but let's go ;
  1. Ensure you have the Xcode command line tools installed. This provides you with the necessary compilers:

    xcode-select --install
  2. Compile the program as indicated in the General Setup.

  3. To run the program, you can use the Terminal as in the General Setup or create a simple script or Automator application for easier access.

📜 License

This repository is released under the MIT License. Please see the LICENSE file for more information.

❓ Support & Questions

If you have any questions or need support, please feel free to open an issue, a new discussion, or join my twitter.

     _ ._  _ , _ ._            _ ._  _ , _ ._    _ ._  _ , _ ._      _ ._  _ , _ .__  _ , _ ._   ._  _ , _ ._   _ , _ ._   .---.  _ ._   _ , _ .__  _ , _ ._   ._  _ , _ ._      _ ._  _ , _ .__  _ , _ . .---<__. \ _
   (_ ' ( `  )_  .__)        (_ ' ( `  )_  .__ (_ ' ( `  )_  .__)  (_ '    ___   ._( `  )_  .__)  ( `  )_  .__)   )_  .__)/     \(_ ' (    )_  ._( `  )_  .__)  ( `  )_  .__)  (_ ' ( `  )_  ._( `` )_  . `---._  \ \ \
 ( (  (    )   `)  ) _)    ( (  (    )   `)  ) (  (    )   `)  ) _ (  (   (o o) )     )   `)  ) _    )   `)  ) _    `)  ) \.@-@./(  (    )   `)     )   `)  ) _    )   `)  ) _ (  (    )   `)         `) ` ),----`- `.))  
(__ (_   (_ . _) _) ,__)  (__ (_   (_ . _) _) _ (_   (_ . _) _) ,__ (_   (  V  ) _) (_ . _) _) ,_  (_ . _) _) ,_ . _) _) ,/`\_/`\ (_   (  . _) _) (_ . _) _) ,_  (_ . _) _) ,__ (_   (_ . _) _) (__. _) _)/ ,--.   )  |
    `~~`\ ' . /`~~`           `~~`\ ' . /`~~`   `~~`\ ' . /`~~`     `~~`/--m-m- ~~`\ ' . /`~~`   `\ ' . /`~~`  `\ ' . /  //  _  \\ ``\ '  . /`~~`\ ' . /`~~`   `\ ' . /`~~`     `~~`\ ' . /`~~`\ ' . /`~~/_/    >     |
         ;   ;                     ;   ;             ;   ;               ;   ;      ;   ;          ;   ;         ;   ;  | \     )|_   ;    ;      ;   ;          ;   ;               ;   ;      ;   ;    |,\__-'      |
         /   \                     /   \             /   \               /   \      /   \          /   \         /   \ /`\_`>  <_/ \  /    \      /   \          /   \               /   \      /   \     \__         \
________/_ __ \___________________/_ __ \___________/_ __ \______ __ ___/_ __ \____/_ __ \________/_ __ \_______/_ __ \\__/'---'\__/_/_  __ \____/_ __ \________/_ __ \_____ _______/_ __ \____/_ __ \____ __\___      )