Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SMPStaticAnalyzer
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
SMPStaticAnalyzer
Commits
5a99431c
Commit
5a99431c
authored
9 years ago
by
jdh8d
Browse files
Options
Downloads
Patches
Plain Diff
Former-commit-id: ea50cbea6d3d6dd0f341dde51592eb91f3f398ad
parent
8459c5a3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/interfaces/irdb/STARSOp.h
+54
-0
54 additions, 0 deletions
include/interfaces/irdb/STARSOp.h
with
54 additions
and
0 deletions
include/interfaces/irdb/STARSOp.h
+
54
−
0
View file @
5a99431c
...
...
@@ -34,18 +34,72 @@ class STARS_IRDB_op_t : public STARS_op_t
virtual
bool
operator
<
(
const
STARS_op_t
&
rOp
)
const
{
assert
(
0
);
}
// Less-than operator for use in STL ordered containers, e.g. sets.
// Get methods
// maybe convert Set/GetOpGlobalIndex to take/return a typedef.
//typedef unsigned int SSANameIndex_t
// Get/SetOpGlobalIndex just needs to record a unsigned int so clone can copy it.
virtual
unsigned
int
GetOpGlobalIndex
(
void
)
const
{
assert
(
0
);
}
// Get STARS SSA name index.
// e.g. mov [eax+addr], 0 ==> return addr, assert
// e.g. mov [eax+ebx+8+addr], 0 ==> return addr, assert
// e.g. jeq +5 ==> 0x8048005
// e.g. jmp +5 ==> 0x8048005
// e.g. mov eax <- 0x8048f00 ==> assert, assert
// e.g. call +5 ==> 0x8048005
// e.g. mov [0x8048f00] <- eax ==> 0x8048f00, assert
// e.g. mov fs:[0x8048f00], eax ==> 0x8048f00, assert
// e.g. lea eax <- [0x8048f00] ==> assert, 0x8048f00
// e.g. mov eax <- 0x8048f00 ==> assert, assert
// e.g. inc eax ==> assert
virtual
STARS_ea_t
GetAddr
(
void
)
const
{
assert
(
0
);
}
// should be straightforward enough.
// jmp +5 ==> return o_near
// mov [ebx+ecx*4+40],0 ==> return STARS_o_displ, STARS_o_imm
// mov [ebx+ecx*4],rax ==> return STARS_o_phrase, STARS_o_reg
// mov [ebx], reg ==> return STARS_o_phrase, STARS_o_reg
// mov [ebx+40],imm ==> return STARS_o_displ, STARS_o_imm
// mov [0x8048f040], 0 ==> return STARS_o_mem, STARS_o_imm
// mov mm0, [mem] ==> return STARS_o_mmxreg, STARS_o_phrase
// mov xmm0, [mem] ==> return STARS_o_xmmreg, STARS_o_phrase
// mov ymm0, [mem] ==> return o_ymmreg, o_phrase
// also see intel.hpp:56 for o_trreg, o_crreg, o_dbreg, o_fpreg.
virtual
unsigned
char
GetOpType
(
void
)
const
{
assert
(
0
);
}
// Get type o_reg, o_displ, etc.
// STARS_x86_R_al
// STARS_x86_R_ah
// STARS_x86_R_ax (means ax, eax, rax)
// STARS_x86_R_mm0
// STARS_x86_R_xmm0
// STARS_x86_R_ymm0
// STARS_x86_R_st0 (fp stack reg 0)
// probably also CR, TR, and DB regs.
// seg registers aren't
// see STARSTypes.h: enum STARS_RegNo
virtual
uint16_t
GetReg
(
void
)
const
{
assert
(
0
);
}
// Get reg field of operand, whether it is an addressing reg or directly used reg in register operand
// mov fs:[0x80481234], eax ==> return seg_fs, assert.
virtual
uint16_t
GetSegReg
(
void
)
const
{
assert
(
0
);
}
// Get segment register of operand; R_none if no segment register
// return SIB byte if exists.
virtual
char
GetSIB
(
void
)
const
{
assert
(
0
);
}
// Get x86 SIB byte (dense encoding of base reg, index reg, and scale factor)
virtual
int
MDGetSIBBaseReg
(
void
)
const
{
assert
(
0
);
}
// Get x86 SIB byte base register
virtual
short
MDGetSIBIndexReg
(
void
)
const
{
assert
(
0
);
}
// Get x86 SIB byte index register
virtual
int
GetSIBScaleFactor
(
void
)
const
{
assert
(
0
);
}
// Extract scale factor from SIB byte
// clc to investigate removing need for this function in base class
// probably will still use in STARS_IDA_Op_t.
virtual
char
GetSpecFlag4
(
void
)
const
{
assert
(
0
);
}
// Get specflag4 byte, used to hold a copy of the auxpref byte in x86-64 programs.
virtual
STARS_uval_t
GetImmedValue
(
void
)
const
{
assert
(
0
);
}
// Get value field for immediate operands; uint32 for x86-32, uint64 for x86-64
// return STARS_dt_byte, etc.
// see STARSTypes.h:112
// probably don't need it.
virtual
char
GetOpDtyp
(
void
)
const
{
assert
(
0
);
}
// Get field that determines byte width
// return 1, 2, 4, 8, 16, etc.
virtual
uint16_t
GetByteWidth
(
void
)
const
{
assert
(
0
);
}
// Set methods
...
...
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