Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
6ad3ad56
Commit
6ad3ad56
authored
5 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
fixes for pcrel with out-of-bounds memory accesses as well as getRegNo fixes for EIP
parent
c038638e
No related branches found
No related tags found
No related merge requests found
Pipeline
#3410
passed
5 years ago
Stage: clean
Stage: build
Changes
2
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
irdb-libs/libIRDB-core/src/decode_csx86.cpp
+8
-5
8 additions, 5 deletions
irdb-libs/libIRDB-core/src/decode_csx86.cpp
irdb-libs/libIRDB-core/src/operand_csx86.cpp
+7
-0
7 additions, 0 deletions
irdb-libs/libIRDB-core/src/operand_csx86.cpp
with
15 additions
and
5 deletions
irdb-libs/libIRDB-core/src/decode_csx86.cpp
+
8
−
5
View file @
6ad3ad56
...
...
@@ -73,13 +73,14 @@ static bool isPartOfGroup(const cs_insn* the_insn, const x86_insn_group the_grp)
static
bool
isJmp
(
cs_insn
*
the_insn
)
{
const
auto
is_jmp_grp
=
isPartOfGroup
(
the_insn
,
X86_GRP_JUMP
);
const
auto
is_loop
=
const
auto
is_jmp_grp
=
isPartOfGroup
(
the_insn
,
X86_GRP_JUMP
);
const
auto
is_ljmp
=
the_insn
->
id
==
X86_INS_LJMP
;
const
auto
is_loop
=
the_insn
->
id
==
X86_INS_LOOP
||
the_insn
->
id
==
X86_INS_LOOPE
||
the_insn
->
id
==
X86_INS_LOOPNE
;
return
is_jmp_grp
||
is_loop
;
return
is_jmp_grp
||
is_loop
||
is_ljmp
;
}
template
<
class
type
>
...
...
@@ -361,8 +362,10 @@ bool DecodedInstructionCapstoneX86_t::isUnconditionalBranch() const
bool
DecodedInstructionCapstoneX86_t
::
isConditionalBranch
()
const
{
if
(
!
valid
())
throw
std
::
logic_error
(
string
(
"Called "
)
+
__FUNCTION__
+
" on invalid instruction"
);
const
auto
the_insn
=
static_cast
<
cs_insn
*>
(
my_insn
.
get
());
return
isJmp
(
the_insn
)
&&
getMnemonic
()
!=
"jmp"
;
const
auto
the_insn
=
static_cast
<
cs_insn
*>
(
my_insn
.
get
());
const
auto
mnemonic
=
getMnemonic
();
const
auto
is_uncond_type
=
mnemonic
==
"jmp"
||
mnemonic
==
"ljmp"
;
return
isJmp
(
the_insn
)
&&
!
is_uncond_type
;
}
bool
DecodedInstructionCapstoneX86_t
::
isReturn
()
const
...
...
This diff is collapsed.
Click to expand it.
irdb-libs/libIRDB-core/src/operand_csx86.cpp
+
7
−
0
View file @
6ad3ad56
...
...
@@ -34,6 +34,13 @@ static uint32_t to_seg_reg_number(const x86_reg ®)
static
uint32_t
to_reg_number
(
const
x86_reg
&
reg
)
{
if
(
X86_REG_XMM0
<=
reg
&&
reg
<=
X86_REG_XMM31
)
return
reg
-
X86_REG_XMM0
;
if
(
X86_REG_YMM0
<=
reg
&&
reg
<=
X86_REG_YMM31
)
return
reg
-
X86_REG_YMM0
;
if
(
X86_REG_ZMM0
<=
reg
&&
reg
<=
X86_REG_ZMM31
)
return
reg
-
X86_REG_ZMM0
;
switch
(
reg
)
{
case
X86_REG_AH
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment