Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-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
llvm-watermarker
Commits
894f16de
Commit
894f16de
authored
Jan 24, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function挿入順変更手法の埋め込み量を増やした
parent
50e0a92a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
FunctionWatermarkPass.cpp
src/nykk/pass/FunctionWatermarkPass.cpp
+25
-3
No files found.
src/nykk/pass/FunctionWatermarkPass.cpp
View file @
894f16de
...
@@ -103,11 +103,33 @@ namespace
...
@@ -103,11 +103,33 @@ namespace
}
}
// Inserts rest functions.
// Inserts rest functions.
const
auto
num_rests
=
functions
.
size
()
-
index
;
if
(
num_rests
>=
2
)
{
const
auto
perm_table
=
nykk
::
create_permutation_table
(
num_rests
);
// Part of watermark to embed.
const
auto
data
=
bit_stream
->
read
(
possible_embedding_bits
[
num_rests
]);
for
(
std
::
size_t
i
=
0
;
i
<
num_rests
;
i
++
)
{
const
auto
n
=
index
+
perm_table
.
at
(
data
).
at
(
i
);
functions
[
n
].
get
().
removeFromParent
();
module
.
getFunctionList
().
push_back
(
&
functions
[
n
].
get
());
}
num_embedded_bits
+=
possible_embedding_bits
[
num_rests
];
}
else
{
for
(;
index
<
functions
.
size
();
index
++
)
for
(;
index
<
functions
.
size
();
index
++
)
{
{
functions
[
index
].
get
().
removeFromParent
();
functions
[
index
].
get
().
removeFromParent
();
module
.
getFunctionList
().
push_back
(
&
functions
[
index
].
get
());
module
.
getFunctionList
().
push_back
(
&
functions
[
index
].
get
());
}
}
}
llvm
::
errs
()
<<
module
.
getName
()
<<
", "
<<
functions
.
size
()
<<
", "
<<
num_embedded_bits
<<
"
\n
"
;
llvm
::
errs
()
<<
module
.
getName
()
<<
", "
<<
functions
.
size
()
<<
", "
<<
num_embedded_bits
<<
"
\n
"
;
...
...
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