Linux의 Windows *.lnk 바로가기에서 정보를 어떻게 덤프합니까?

Linux의 Windows *.lnk 바로가기에서 정보를 어떻게 덤프합니까?

Linux에서 Windows lnk 바로가기를 실행하려면 wine start qqq.lnk.

하지만 이에 대한 정보(명령줄, 현재 디렉터리)를 볼 수 있나요? strings충분하지 않다.

답변1

이 작업을 수행할 수 있는 프로그램이 많지 않은 것 같습니다. 어느 정도 작동하는 Perl 스크립트 두 개를 찾았습니다.

lslnk.pl그리고lnk 구문 분석

다음과 같이 사용하세요:<whicheverscript> Name.lnk

답변2

lnkinfo다음에서 도구를 사용할 수 있습니다 .liblnk( liblnk-utils데비안 패키지):

lnkinfo <file.lnk>

스크립트에서의 사용 예:

LOCAL_PATH=$(lnkinfo "$1" | grep 'Local path' | cut -d':' -f2-)
ARGS=$(lnkinfo "$1" | grep 'Command line arguments' | cut -d':' -f2-)

예제 출력:

$ lnkinfo 'Program Files - Shortcut.lnk'
lnkinfo 20171101

Windows Shortcut information:
        Contains a link target identifier
        Contains a relative path string

Link information:
        Creation time           : Jul 14, 2009 03:20:08.555426400 UTC
        Modification time       : Apr 23, 2019 21:36:46.017274100 UTC
        Access time         : Apr 23, 2019 21:36:46.017274100 UTC
        File size           : 12288 bytes
        Icon index          : 0
        Show Window value       : 0x00003000
        Hot Key value           : 12288
        File attribute flags        : 0x00000011
                Is read-only (FILE_ATTRIBUTE_READ_ONLY)
                Is directory (FILE_ATTRIBUTE_DIRECTORY)
        Drive type          : Fixed (3)
        Drive serial number     : 0x0e1909c6
        Volume label            : Local Disk
        Local path          : C:\Program Files
        Relative path           : ..\..\..\Program Files

Link target identifier:
        Shell item list
                Number of items     : 3

        Shell item: 1
                Item type       : Root folder
                Class type indicator    : 0x1f (Root folder)
                Shell folder identifier : 20d04fe0-3aea-1069-a2d8-08002b30309d
                Shell folder name   : My Computer

        Shell item: 2
                Item type       : Volume
                Class type indicator    : 0x2f (Volume)
                Volume name     : C:\

        Shell item: 3
                Item type       : File entry
                Class type indicator    : 0x31 (File entry: Directory)
                Name            : PROGRA~1
                Modification time   : Apr 23, 2019 21:36:48
                File attribute flags    : 0x00000011
                        Is read-only (FILE_ATTRIBUTE_READ_ONLY)
                        Is directory (FILE_ATTRIBUTE_DIRECTORY)
        Extension block: 1
                Signature       : 0xbeef0004 (File entry extension)
                Long name       : Program Files
                Localized name      : @shell32.dll,-21781
                Creation time       : Jul 14, 2009 03:20:10
                Access time     : Apr 23, 2019 21:36:48
                NTFS file reference : MFT entry: 878, sequence: 1



Distributed link tracking data:
        Machine identifier      : <snip>
        Droid volume identifier     : b2638d5e-f5b8-480c-bda0-fdb25ab91131
        Droid file identifier       : 968b84a2-a646-11e9-a124-0021cc6948e3
        Birth droid volume identifier   : b2638d5e-f5b8-480c-bda0-fdb25ab91131
        Birth droid file identifier : 968b84a2-a646-11e9-a124-0021cc6948e3

답변3

질문에는 cygwin을 사용한다고 나와 있지 않지만 그렇다면 Cygutils 패키지와 함께 제공되는 readshortcut을 제안합니다.

참고: 표시되지 않는 몇 가지 단축키를 찾았으므로 무차별 대입도 제안합니다.

문자열 -el

또는

16 진 덤프 -c

READSHORTCUT(1) Cygutils
READSHORTCUT(1)

NAME readshortcut - Windows 바로 가기(.lnk) 파일에서 데이터 읽기

개요 읽기바로가기 [OPTION]* 바로가기

설명 readshortcut은 Windows 바로 가기 파일(OLE 링크라고도 함)을 읽기 위한 명령줄 도구입니다. 가장 실용적인 용도는 바로가기가 가리키는 대상을 확인하는 것입니다. 비대화형 사용을 위해 스크립트나 배치 파일에서 쉽게 실행할 수 있습니다.

관련 정보