CN102521255A - Method for rapidly analyzing executable file path from shortcut - Google Patents

Method for rapidly analyzing executable file path from shortcut Download PDF

Info

Publication number
CN102521255A
CN102521255A CN2011103665450A CN201110366545A CN102521255A CN 102521255 A CN102521255 A CN 102521255A CN 2011103665450 A CN2011103665450 A CN 2011103665450A CN 201110366545 A CN201110366545 A CN 201110366545A CN 102521255 A CN102521255 A CN 102521255A
Authority
CN
China
Prior art keywords
file
shortcut
information
section
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011103665450A
Other languages
Chinese (zh)
Inventor
赵磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN2011103665450A priority Critical patent/CN102521255A/en
Publication of CN102521255A publication Critical patent/CN102521255A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for rapidly analyzing executable file path from a shortcut and belongs to the field of computer file systems. The method comprises the following steps: 1) reading a shortcut file according to the set path information, and analyzing the all-path file name of the shortcut file; 2) according to the all-path file name of the shortcut, judging whether the shortcut file exists or not, and if yes, establishing a mapping between the shortcut file and an internal memory; 3) reading optional attribute mark information in the shortcut file, and confirming the position of a file location information section of the shortcut file according to the total length information in the optional attribute mark information; and 4) reading the content of the file location information section, and extracting the file path of an executable file referred by the shortcut. The method is capable of greatly improving the operating efficiency of a program, and the program is very small in volume after being packaged into a function, thus the method is simple and easy to use.

Description

A kind of from shortcut fast resolving go out the executable file route method
Technical field
The invention belongs to the computer file system field, relate to and a kind ofly can from shortcut, parse the executable file route method quickly and easily.
Background technology
The method of from shortcut, resolving executable file that existing market is popular all is the mode of utilizing COM basically; Need to install com component; The benefit of using com component to develop is conspicuous, and encapsulation property is good, can dynamically insert easily or unload; Compatible good, can stride language development.
But, make that whole framework is huger and complicated, so can increase program volume and operational efficiency because com component need carry out encapsulation layer by layer to calling of various functions.
The present invention directly starts with from the file layout of shortcut; Directly go out our needed data such as path and parameter of its executable file pointed through analytical analysis to its file layout; Need not load unnecessary framework and the many functions that can not use; Can much and on the efficient be greatly improved for a short time on the volume; When only needing to resolve a spot of shortcut, possibly know from experience less than, but kill shortcut that soft or other industry software need carry out magnanimity when resolving at some, the difference of efficient just clearly.
Summary of the invention
To the problem that exists in the prior art, the object of the present invention is to provide a kind of from shortcut fast resolving go out the executable file route method, major technique of the present invention thes contents are as follows:
1) opens the shortcut file that to resolve, and set up the mapping (set up memory-mapped after can work as internal memory use to file, read and storage etc. operate all very convenient) of shortcut file to internal memory.
2) read optional attribute attribute field (Flags field) in the file header structure, and preserve.The Flags field is used for identifying has for which optional attribute in the shortcut file, these attributes are extremely important with processing to the document analysis of back.
3) the 0th according to the Flags field judged whether Shell item ID list section; First unsigned short integer of this section representes the total length of item ID list section; This section is resolved the executable file path to us and is had no impact; So after can reading the total length information of this section, directly skip no longer this field processed.
4) confirm the position of file location information section according to the total length information of Flags field; Read the content of file location information section then and judge that through the zone bit in this section the executable file that this shortcut is pointed to is to roll up in this locality or roll up at network; Just the length of routing information is calculated in the skew that deducts local path information of the skew through additional information in the words of this locality volume; Read executable file routing information character string (skew of the skew of additional information and local path information all has special-purpose son field storage in " file location information section ", be known information) according to the skew of local path information and the routing information length that calculates; (skew of network volume information table has special-purpose son field to store in " file location information section " in the skew through network volume information table of the words of network volume; Be known information) find the position of network volume information table; The value of preceding 4 bytes of network volume information table is the length of network volume information table; Length with network volume information table deducts the length that 20 bytes are the network shared name; The position of network volume information table adds that 20 bytes are the reference position of network shared name, reads executable file routing information character string according to the reference position of network shared name and the length of network shared name.
5) according to the value of the Flags field in the file header, can obtain describing character field, relative path section, working directory section, the information of order line section and icon file section.
The invention has the beneficial effects as follows:
The resolution file form must be installed com component from shortcut in the past, can increase volume, complexity of developing and the time complexity of program.After adopting method of the present invention; Any assembly and module need be installed,, can greatly improve the operational efficiency of program through directly the file layout of shortcut being resolved the path that can locate executable file fast; And volume is very little after being packaged into function, is simple and easy to use.
Through test; In the parsing of 10,000 grades of other shortcuts; The mode of using com component needed about 1 minute and 20 seconds and the present invention only needed 2 seconds just can all resolve completion, thus use the present invention that shortcut is resolved and can be increased work efficiency and customer experience by a grade the earth, and also the present invention is flexible; Can use as an independent device, also can be packaged into function and supply other routine call.
Description of drawings
Fig. 1 is a structural representation of the present invention;
Fig. 2 is a process flow diagram of the present invention.
Embodiment
In conjunction with accompanying drawing, further set forth embodiment of the present invention:
1) reads shortcut file according to the routing information of setting; And parse the complete trails filename of shortcut file; Judge whether this shortcut file exists,, then set up the mapping of file to internal memory if there is this shortcut file; Set up document memory mapping back and just can read and write this shortcut file, handled easily with the mode of read/write memory.If do not exist, then enter into the flow process of abnormality processing, print log informs that this shortcut file of user does not exist.
2) according to the file layout of shortcut, preceding 68 bytes are the file header structure, include the shortcut sign in the file header structure; Optional attribute sign in the shortcut file, target file attributes, document creation time; The file modification time, last access time of file, information such as file destination length; Optional attribute sign in the major concern shortcut file of the present invention reads and stores.
3) the 0th according to optional attribute sign in the shortcut file judged whether Shell item ID list section, if having, then reads the total length of this section, skips this section then and do not process.
4) read the content of file location information section and judge that through the zone bit in this section file is volume or in the length of network volume and calculating path information in this locality; If this file is rolled up in this locality; The character string that reads this length (length of the routing information that previous calculations goes out) from the skew of local path information reads the character string of this length from the skew of local path information, and (skew of local path information is that special-purpose son field storage is arranged in " file location information section "; This is known), this character string is exactly an executable file routing information character string; If this file is rolled up at network, then find the reference position of network shared name through network volume information table, read the character string of this length (length of the routing information that previous calculations goes out) from the original position of network shared name.
5) the 5th according to optional attribute sign in the shortcut file judges whether to exist command line parameter; If there is command line parameter; Just obtain command line parameter and be added in the back (some file has command line parameter, can't not carry out if do not add command line parameter when carrying out) of file path information character string.

Claims (6)

  1. One kind from shortcut fast resolving go out the executable file route method, the steps include:
    1) reads shortcut file according to the routing information of setting, and parse the complete trails filename of shortcut file;
    2) judge according to the complete trails filename of shortcut whether this shortcut file exists,, then set up of the mapping of this shortcut file to internal memory if exist;
    3) read optional attribute flag information in this shortcut file, and confirm the file location information fragment position of shortcut file according to the total length information in the optional attribute flag information;
    4) read the content of file location information section, extract the file path of the executable file that this shortcut points to.
  2. 2. the method for claim 1; It is characterized in that judging whether to exist the command line parameter of executable file according to optional attribute flag information in this shortcut file; If there is command line parameter, then obtains command line parameter and it is added in the back of executable file routing information character string.
  3. 3. according to claim 1 or claim 2 method is characterized in that extracting said executable file route method is: judge that at first executable file that this shortcut is pointed to is volume or roll up at network in this locality; If roll up in this locality; Then the skew of additional information in the said file location information section is deducted the skew of local path information; Calculate the length of routing information, read the character string of this length then from the skew of local path information, obtain the file path of executable file; If roll up at network; Then find the position of network volume information table according to the skew of network volume information table in the said file location information section; Obtain the length of network volume information table; Confirm the length and the reference position of network shared name then according to the length of network volume information table, read executable file routing information character string, obtain the file path of executable file.
  4. 4. method as claimed in claim 3 is characterized in that judging that according to the zone bit of file location information section the executable file that this shortcut is pointed to is to roll up in this locality or roll up at network.
  5. 5. method as claimed in claim 3 is characterized in that from said optional attribute flag information, extracting information and the output of describing character field, relative path section, working directory section, order line section and icon file section.
  6. 6. the method for claim 1 is characterized in that the routing information of said setting is the shortcut file clip directory information of input or the routing information of shortcut file.
CN2011103665450A 2011-11-17 2011-11-17 Method for rapidly analyzing executable file path from shortcut Pending CN102521255A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103665450A CN102521255A (en) 2011-11-17 2011-11-17 Method for rapidly analyzing executable file path from shortcut

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103665450A CN102521255A (en) 2011-11-17 2011-11-17 Method for rapidly analyzing executable file path from shortcut

Publications (1)

Publication Number Publication Date
CN102521255A true CN102521255A (en) 2012-06-27

Family

ID=46292177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103665450A Pending CN102521255A (en) 2011-11-17 2011-11-17 Method for rapidly analyzing executable file path from shortcut

Country Status (1)

Country Link
CN (1) CN102521255A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150395A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Directory path analysis method of solid state drive (SSD)-based file system
CN106156034A (en) * 2015-03-26 2016-11-23 北京畅游天下网络技术有限公司 The methods of exhibiting of a kind of executable file and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1979419A (en) * 2005-12-09 2007-06-13 腾讯科技(深圳)有限公司 Method for setting up short-cut of programe module in software and starting method therefor
CN101286767A (en) * 2007-04-09 2008-10-15 艾威梯软件技术(北京)有限公司 Method and system to implement wireless application between wireless equipments by shortcut

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1979419A (en) * 2005-12-09 2007-06-13 腾讯科技(深圳)有限公司 Method for setting up short-cut of programe module in software and starting method therefor
CN101286767A (en) * 2007-04-09 2008-10-15 艾威梯软件技术(北京)有限公司 Method and system to implement wireless application between wireless equipments by shortcut

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150395A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Directory path analysis method of solid state drive (SSD)-based file system
CN103150395B (en) * 2013-03-25 2014-07-23 中国人民解放军国防科学技术大学 Directory path analysis method of solid state drive (SSD)-based file system
CN106156034A (en) * 2015-03-26 2016-11-23 北京畅游天下网络技术有限公司 The methods of exhibiting of a kind of executable file and device

Similar Documents

Publication Publication Date Title
CN108628751B (en) Useless dependency item detection method and device
KR101120301B1 (en) Persistent saving portal
US8869025B2 (en) Method and system for identifying advertisement in web page
US20150363063A1 (en) Apparatus and method of delivering content between applications
CN110704063B (en) Method and device for compiling and executing intelligent contract
CN109542412A (en) Interface message generation method, device, computer equipment and storage medium
CN105183592B (en) Method and apparatus for supporting performance evaluation
CN101763255B (en) Format conversion method and device of special interface tool
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN109308254B (en) Test method, test device and test equipment
JP2006053894A (en) Support of spread sheet function specified by user
CN106294134A (en) The collapse localization method of code and device
CN101587441A (en) Apparatus, method, and system of assisting software development
CA2753626C (en) Packed data objects
CN110286917A (en) File packing method, device, equipment and storage medium
CN103177115A (en) Method and device of extracting page link of webpage
CN111198852A (en) Knowledge graph driven metadata relation reasoning method under micro-service architecture
CN110764941A (en) Method, device, medium and equipment for acquiring call stack frame instruction offset
CN104679495A (en) Method and device for recognizing software
CN113268245A (en) Code analysis method, device and storage medium
CN112527386B (en) Application program issuing method and device
CN102521255A (en) Method for rapidly analyzing executable file path from shortcut
CN102968805A (en) Picture superposition method and system
CN108845864A (en) A kind of JVM rubbish recovering method and device based on spring frame
CN110737588A (en) automatic point burying method, device, medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120627