Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Linux Library Inject
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
Chu
Linux Library Inject
Commits
2d967c2f
Commit
2d967c2f
authored
Dec 24, 2019
by
Chu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用 memory_ 取代 loaded_
parent
1954c0c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
elf.cpp
inject/elf.cpp
+2
-3
elf.h
inject/elf.h
+0
-1
No files found.
inject/elf.cpp
View file @
2d967c2f
...
...
@@ -10,7 +10,7 @@
Elf
::~
Elf
()
{
if
(
loaded
_
)
if
(
memory
_
)
munmap
(
memory_
,
memory_length_
);
}
...
...
@@ -21,7 +21,7 @@ void Elf::set_base(unsigned long base)
std
::
size_t
Elf
::
find_symbol_address_by_name
(
std
::
string_view
name
)
{
if
(
!
loaded
_
)
if
(
!
memory
_
)
load_to_memory
();
for
(
auto
i
=
0
;
i
!=
ehdr_
->
e_shnum
;
++
i
)
...
...
@@ -66,5 +66,4 @@ void Elf::load_to_memory()
close
(
fd
);
ehdr_
=
reinterpret_cast
<
Elf64_Ehdr
*>
(
memory_
);
shdr_
=
reinterpret_cast
<
Elf64_Shdr
*>
(
memory_
+
ehdr_
->
e_shoff
);
loaded_
=
true
;
}
inject/elf.h
View file @
2d967c2f
...
...
@@ -17,7 +17,6 @@ public:
private
:
std
::
string
path_
;
unsigned
long
base_
=
0
;
bool
loaded_
=
false
;
std
::
size_t
memory_length_
=
0
;
unsigned
char
*
memory_
=
nullptr
;
Elf64_Ehdr
*
ehdr_
=
nullptr
;
...
...
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