Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mslinks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Griefed
mslinks
Commits
f6f03dc7
Commit
f6f03dc7
authored
8 years ago
by
BlackOverlord
Browse files
Options
Downloads
Patches
Plain Diff
fixed processing LinkTargetIDList section for different os versions
parent
8337ad4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mslinks/data/ItemID.java
+20
-8
20 additions, 8 deletions
src/mslinks/data/ItemID.java
with
20 additions
and
8 deletions
src/mslinks/data/ItemID.java
+
20
−
8
View file @
f6f03dc7
...
...
@@ -27,8 +27,13 @@ import mslinks.UnsupportedCLSIDException;
public
class
ItemID
implements
Serializable
{
private
static
final
GUID
mycomputer
=
new
GUID
(
"20d04fe0-3aea-1069-a2d8-08002b30309d"
);
private
static
byte
[]
ub1
=
new
byte
[]
{
8
,
0
,
4
,
0
,
-
17
,
-
66
};
// unknown bytes
private
static
byte
[]
ub1
=
new
byte
[]
{
4
,
0
,
-
17
,
-
66
};
// unknown bytes
private
static
byte
[]
ub2
=
new
byte
[]
{
42
,
0
,
0
,
0
};
// unknown bytes
private
static
final
int
EXT_VERSION_WINXP
=
3
;
private
static
final
int
EXT_VERSION_VISTA
=
7
;
private
static
final
int
EXT_VERSION_WIN7
=
8
;
private
static
final
int
EXT_VERSION_WIN8
=
9
;
// same for win10
public
static
final
int
TYPE_UNKNOWN
=
0
;
public
static
final
int
TYPE_FILE
=
0x32
;
...
...
@@ -67,11 +72,19 @@ public class ItemID implements Serializable {
br
.
read
();
pos
=
br
.
getPosition
();
int
sz
=
(
int
)
br
.
read2bytes
();
br
.
read6bytes
();
// unknown
int
extensionVersion
=
(
int
)
br
.
read2bytes
();
br
.
read4bytes
();
// unknown
br
.
read4bytes
();
// date created
br
.
read4bytes
();
// last accessed
br
.
seek
(
26
);
// unknown
longname
=
br
.
readUnicodeString
(
sz
-
44
);
// unknown blocks depended on os version
switch
(
extensionVersion
)
{
case
EXT_VERSION_WINXP:
br
.
seek
(
4
);
break
;
case
EXT_VERSION_VISTA:
br
.
seek
(
22
);
break
;
case
EXT_VERSION_WIN7:
br
.
seek
(
26
);
break
;
case
EXT_VERSION_WIN8:
br
.
seek
(
30
);
break
;
default
:
throw
new
ShellLinkException
(
"Unknown extension version"
);
}
longname
=
br
.
readUnicodeString
(
pos
+
sz
-
br
.
getPosition
());
br
.
seek
(
pos
+
sz
-
br
.
getPosition
());
// unknown
}
else
if
(
type
==
TYPE_CLSID
)
{
br
.
read
();
// unknown
...
...
@@ -121,16 +134,15 @@ public class ItemID implements Serializable {
if
(((
bw
.
getPosition
()
-
pos
)
&
1
)
!=
0
)
bw
.
write
(
0
);
bw
.
write2bytes
(
46
+
longname
.
length
()
*
2
);
bw
.
write2bytes
(
2
+
2
+
ub1
.
length
+
4
+
4
+
ub2
.
length
+
4
+
(
longname
.
length
()
+
1
)
*
2
+
2
);
bw
.
write2bytes
(
EXT_VERSION_WINXP
);
bw
.
writeBytes
(
ub1
);
bw
.
write4bytes
(
0
);
// date created
bw
.
write4bytes
(
0
);
// last accessed
bw
.
writeBytes
(
ub2
);
for
(
int
i
=
0
;
i
<
22
;
i
++)
// unknown
bw
.
write
(
0
);
bw
.
write4bytes
(
0
);
// unknown block depended on os version (always use WinXP)
bw
.
writeUnicodeString
(
longname
,
true
);
bw
.
write2bytes
((
shortname
.
length
()
&
~
1
)
+
16
);
}
public
String
getName
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment