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
db9f45a5
Commit
db9f45a5
authored
2 years ago
by
blackoverlord
Browse files
Options
Downloads
Patches
Plain Diff
exposed some methods for testing
parent
31d3aa33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pause.bat
+7
-2
7 additions, 2 deletions
pause.bat
src/io/ByteReader.java
+10
-0
10 additions, 0 deletions
src/io/ByteReader.java
src/io/ByteWriter.java
+10
-0
10 additions, 0 deletions
src/io/ByteWriter.java
src/mslinks/ShellLink.java
+13
-3
13 additions, 3 deletions
src/mslinks/ShellLink.java
with
40 additions
and
5 deletions
pause.bat
+
7
−
2
View file @
db9f45a5
@echo
%cd%
@pause
\ No newline at end of file
@echo
off
echo
Current
file
:
%
0
echo
Current
directory
:
%cd%
if
not
"
%
*"
==
""
(
echo
Command
line
:
%
*
)
pause
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/io/ByteReader.java
+
10
−
0
View file @
db9f45a5
...
...
@@ -37,6 +37,16 @@ public class ByteReader extends InputStream {
le
=
!
le
;
return
this
;
}
public
ByteReader
setLittleEndian
()
{
le
=
true
;
return
this
;
}
public
ByteReader
setBigEndian
()
{
le
=
false
;
return
this
;
}
public
boolean
seek
(
int
n
)
throws
IOException
{
if
(
n
<=
0
)
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/io/ByteWriter.java
+
10
−
0
View file @
db9f45a5
...
...
@@ -38,6 +38,16 @@ public class ByteWriter extends OutputStream {
return
this
;
}
public
ByteWriter
setLittleEndian
()
{
le
=
true
;
return
this
;
}
public
ByteWriter
setBigEndian
()
{
le
=
false
;
return
this
;
}
@Override
public
void
close
()
throws
IOException
{
...
...
This diff is collapsed.
Click to expand it.
src/mslinks/ShellLink.java
+
13
−
3
View file @
db9f45a5
...
...
@@ -84,6 +84,12 @@ public class ShellLink {
parse
(
reader
);
}
}
public
ShellLink
(
ByteReader
reader
)
throws
IOException
,
ShellLinkException
{
try
(
reader
)
{
parse
(
reader
);
}
}
private
void
parse
(
ByteReader
data
)
throws
ShellLinkException
,
IOException
{
header
=
new
ShellLinkHeader
(
data
);
...
...
@@ -119,10 +125,15 @@ public class ShellLink {
}
}
}
public
void
serialize
(
OutputStream
out
)
throws
IOException
{
var
bw
=
new
ByteWriter
(
out
);
serialize
(
bw
);
out
.
close
();
}
public
void
serialize
(
ByteWriter
bw
)
throws
IOException
{
LinkFlags
lf
=
header
.
getLinkFlags
();
ByteWriter
bw
=
new
ByteWriter
(
out
);
header
.
serialize
(
bw
);
if
(
lf
.
hasLinkTargetIDList
())
idlist
.
serialize
(
bw
);
...
...
@@ -144,7 +155,6 @@ public class ShellLink {
i
.
serialize
(
bw
);
bw
.
write4bytes
(
0
);
out
.
close
();
}
public
ShellLinkHeader
getHeader
()
{
return
header
;
}
...
...
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