Toggle navigation
Toggle navigation
This project
Loading...
Sign in
공재호
/
JJS_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이한솔
2020-06-20 23:42:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ea70b69a02ea5e8f14987a7e42e59e38577030ae
ea70b69a
1 parent
3e93963c
보고서 및 발표자료 업로드
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
src/llvm/lib/Transforms/Obfuscation/PreProcess.cpp
src/llvm/lib/Transforms/Obfuscation/ReturnObfuscation.cpp
진행보고서/[최종발표자료]_LLVM_기반의_Baremetal_IoT_디바이스_펌웨어_난독화.pptx
진행보고서/[최종보고서]_LLVM_기반의_Baremetal_IoT_디바이스_펌웨어_난독화.docx
src/llvm/lib/Transforms/Obfuscation/PreProcess.cpp
View file @
ea70b69
...
...
@@ -14,32 +14,36 @@ namespace {
static
char
ID
;
PreProcess
()
:
FunctionPass
(
ID
)
{
}
bool
runOnFunction
(
Function
&
F
)
override
{
bool
runOnFunction
(
Function
&
F
)
override
{
Module
*
mod
=
F
.
getParent
();
std
::
vector
<
Instruction
*>
instructions
;
std
::
vector
<
BasicBlock
*>
RetBlocks
;
bool
inserted
=
false
;
std
::
ofstream
functionFile
(
"functions.txt"
,
std
::
ios_base
::
app
);
if
(
functionFile
.
is_open
())
{
functionFile
<<
F
.
getName
().
str
()
<<
"
\n
"
;
if
(
!
F
.
getName
().
contains
(
"__cxx"
)
&&
!
F
.
getName
().
contains
(
"_GLOBAL"
))
functionFile
<<
F
.
getName
().
str
()
<<
"
\n
"
;
functionFile
.
close
();
}
for
(
auto
&
BB
:
F
)
{
for
(
auto
&
I
:
BB
)
{
if
(
I
.
getOpcode
()
==
Instruction
::
Ret
)
{
instructions
.
push_back
(
&
I
);
if
(
!
F
.
getName
().
contains
(
"__cxx"
)
&&
!
F
.
getName
().
contains
(
"_GLOBAL"
))
{
for
(
auto
&
BB
:
F
)
{
for
(
auto
&
I
:
BB
)
{
if
(
I
.
getOpcode
()
==
Instruction
::
Ret
)
{
instructions
.
push_back
(
&
I
);
}
}
}
}
for
(
auto
&
I
:
instructions
)
{
BasicBlock
*
BB
=
I
->
getParent
();
// One Instruction Basic Block has only one ret instructions
if
(
!
BB
->
size
()
<
2
)
{
BasicBlock
*
retblock
=
BB
->
splitBasicBlock
(
I
->
getIterator
(),
"obfuscatedreturn"
);
}
else
{
BB
->
setName
(
"obfuscatedreturn"
);
for
(
auto
&
I
:
instructions
)
{
BasicBlock
*
BB
=
I
->
getParent
();
// One Instruction Basic Block has only one ret instructions
if
(
!
BB
->
size
()
<
2
)
{
BasicBlock
*
retblock
=
BB
->
splitBasicBlock
(
I
->
getIterator
(),
"obfuscatedreturn"
);
}
else
{
BB
->
setName
(
"obfuscatedreturn"
);
}
}
}
return
true
;
}
...
...
src/llvm/lib/Transforms/Obfuscation/ReturnObfuscation.cpp
View file @
ea70b69
This diff is collapsed. Click to expand it.
진행보고서/[최종발표자료]_LLVM_기반의_Baremetal_IoT_디바이스_펌웨어_난독화.pptx
0 → 100644
View file @
ea70b69
No preview for this file type
진행보고서/[최종보고서]_LLVM_기반의_Baremetal_IoT_디바이스_펌웨어_난독화.docx
0 → 100644
View file @
ea70b69
No preview for this file type
Please
register
or
login
to post a comment