██╗ ███╗ ██╗██╗ ██╗ ██████╗ ███████╗ █████╗ ██████╗ ███████╗██████╗
██║ ████╗ ██║██║ ██╔╝ ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔══██╗
██║ ██╔██╗ ██║█████╔╝ ██████╔╝█████╗ ███████║██║ ██║█████╗ ██████╔╝
██║ ██║╚██╗██║██╔═██╗ ██╔══██╗██╔══╝ ██╔══██║██║ ██║██╔══╝ ██╔══██╗
███████╗██║ ╚████║██║ ██╗ ██║ ██║███████╗██║ ██║██████╔╝███████╗██║ ██║
╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
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.
-
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.
-
RegEx-based Path Extraction:
- Uses regular expressions to extract the longest valid file path from the ASCII representation of the
.lnk
file.
- Uses regular expressions to extract the longest valid file path from the ASCII representation of the
-
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.
-
Path Normalization:
- Transforms any Windows-style backslashes in paths (
\
) to UNIX-style forward slashes (/
), ensuring compatibility with non-Windows systems.
- Transforms any Windows-style backslashes in paths (
-
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).
- If the direct path extracted from the
-
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.
-
Fast install :
- You can install it faster with the script setup.sh
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).
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:
- Simply run setup.sh in same directory where is lnkReader.c
then right click, execute or
chmod +x setup.sh
./setup.sh
But if you prefere a manual installation you can follow steps behind :
-
Clone the repository:
git clone https://github.com/SECRET-GUEST/windows_link_reader.git
-
Navigate to the project folder:
cd REPOSITORY
-
Compile the program:
gcc lnkReader.c -o open_lnk
-
Try the program:
./open_lnk YOUR_FILE.lnk
- Create a new
.desktop
file:vim ~/.local/share/applications/open_lnk.desktop
Note: use vim nano or whatever else txt editor
-
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;
-
Make the
.desktop
file executable:chmod +x ~/.local/share/applications/open_lnk.desktop
-
Now, you just have to use the program by default for .lnk files, by "open with" or in the properties.
-
Ensure you have the Xcode command line tools installed. This provides you with the necessary compilers:
xcode-select --install
-
Compile the program as indicated in the General Setup.
-
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.
This repository is released under the MIT License. Please see the LICENSE
file for more information.
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- ~~`\ ' . /`~~` `\ ' . /`~~` `\ ' . / // _ \\ ``\ ' . /`~~`\ ' . /`~~` `\ ' . /`~~` `~~`\ ' . /`~~`\ ' . /`~~/_/ > |
; ; ; ; ; ; ; ; ; ; ; ; ; ; | \ )|_ ; ; ; ; ; ; ; ; ; ; |,\__-' |
/ \ / \ / \ / \ / \ / \ / \ /`\_`> <_/ \ / \ / \ / \ / \ / \ \__ \
________/_ __ \___________________/_ __ \___________/_ __ \______ __ ___/_ __ \____/_ __ \________/_ __ \_______/_ __ \\__/'---'\__/_/_ __ \____/_ __ \________/_ __ \_____ _______/_ __ \____/_ __ \____ __\___ )