Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
ae8f9d61
Commit
ae8f9d61
authored
May 27, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write module into stdout if output file name is '-'
parent
948d2592
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
kyut.cpp
src/kyut.cpp
+11
-3
No files found.
src/kyut.cpp
View file @
ae8f9d61
...
...
@@ -15,14 +15,22 @@ int main(int argc, char *argv[]) {
return
1
;
}
const
std
::
string
inputFile
=
argv
[
1
];
const
std
::
string
watermark
=
argv
[
2
];
const
std
::
string
outputFile
=
argv
[
3
];
wasm
::
Module
module
;
wasm
::
ModuleReader
{}.
read
(
argv
[
1
]
,
module
);
wasm
::
ModuleReader
{}.
read
(
inputFile
,
module
);
const
auto
stream
=
kyut
::
CircularBitStream
::
from_string
(
argv
[
2
]
);
const
auto
stream
=
kyut
::
CircularBitStream
::
from_string
(
watermark
);
kyut
::
pass
::
embedWatermarkOperandSwapping
(
module
,
*
stream
);
wasm
::
ModuleWriter
{}.
write
(
module
,
argv
[
3
]);
if
(
outputFile
==
"-"
)
{
wasm
::
ModuleWriter
{}.
writeBinary
(
module
,
""
);
}
else
{
wasm
::
ModuleWriter
{}.
write
(
module
,
outputFile
);
}
}
catch
(
wasm
::
ParseException
&
e
)
{
fmt
::
print
(
std
::
cerr
,
"parse error
\n
"
);
e
.
dump
(
std
::
cerr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment