Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Add code handling endbr64 and RIP relative lea instructions #98

Merged
merged 3 commits into from
Sep 1, 2020

Conversation

GBuella
Copy link
Contributor

@GBuella GBuella commented Feb 7, 2020

This change is Reviewable

@GBuella GBuella requested a review from marcinslusarz February 7, 2020 11:45
@GBuella
Copy link
Contributor Author

GBuella commented Feb 7, 2020

Fixes #97
Hopefully!

@GBuella GBuella force-pushed the add_endbr64_and_lea branch 5 times, most recently from 29f6104 to acf7503 Compare February 7, 2020 14:44
@codecov-io
Copy link

codecov-io commented Feb 7, 2020

Codecov Report

Merging #98 into master will decrease coverage by 0.89%.
The diff coverage is 92.95%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #98     +/-   ##
=========================================
- Coverage   91.95%   91.05%   -0.9%     
=========================================
  Files          11       12      +1     
  Lines         957      973     +16     
=========================================
+ Hits          880      886      +6     
- Misses         77       87     +10
Flag Coverage Δ
#pmemfile_tests ?
#regular_tests 91.05% <92.95%> (+0.25%) ⬆️
Impacted Files Coverage Δ
src/patcher.c 95.16% <100%> (+0.45%) ⬆️
src/intercept_util.c 96.15% <100%> (+0.5%) ⬆️
src/intercept.h 100% <100%> (ø)
src/disasm_wrapper.c 86.9% <66.66%> (+0.23%) ⬆️
src/intercept.c 80.86% <88.88%> (+0.09%) ⬆️
src/intercept_log.c 91.57% <0%> (-4.03%) ⬇️
src/intercept_desc.c 94.35% <0%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7031a8f...ea124fb. Read the comment docs.

src/patcher.c Show resolved Hide resolved
src/disasm_wrapper.c Show resolved Hide resolved
@GBuella GBuella force-pushed the add_endbr64_and_lea branch from acf7503 to 9cf5367 Compare February 8, 2020 14:37
Older versions of capstone are not aware
of this (now common) instruction, thus it is
now hardwired into libsyscall_itercept.
@GBuella GBuella force-pushed the add_endbr64_and_lea branch from 9cf5367 to ea124fb Compare February 21, 2020 07:01
Copy link
Contributor Author

@GBuella GBuella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 18 files reviewed, 1 unresolved discussion (waiting on @marcinslusarz)


src/patcher.c, line 597 at r1 (raw file):

Previously, GBuella (Gabor Buella) wrote…

Oh, right, I'll just change the comment to make it more clear.
e.g.:
lea 1234(%rip), %rdi, where %rip has the value 2222
is changed to:
movabs %rdi, 3456 (where 3456 = 1234 + 2222)
So we just compute the result of the lea instruction, and put it into the immediate value used in movabs. So it is a movabs with an immediate operand, doesn't dereference anything.

Done.

@GBuella GBuella merged commit f7cebb7 into pmem:master Sep 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants