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
Compare revisions
44cfc100775e3d69f9b627e9d98d52b3ff797faa to 732a3a9b2c8d17f6f9f25048f921c3f36b6a071d
Project 'allnp/SMPStaticAnalyzer' was moved to 'opensrc/SMPStaticAnalyzer'. Please update any links and bookmarks that may still have the old path.
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
opensrc/SMPStaticAnalyzer
Select target project
No results found
732a3a9b2c8d17f6f9f25048f921c3f36b6a071d
Select Git revision
Swap
Target
opensrc/SMPStaticAnalyzer
Select target project
opensrc/SMPStaticAnalyzer
1 result
44cfc100775e3d69f9b627e9d98d52b3ff797faa
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Added exception handling around EHP for processing non-linux binaries where EHP is ineffective.
· 732a3a9b
Jason Hiser
authored
5 years ago
732a3a9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/interfaces/idapro/STARSInterface.cpp
+39
-31
39 additions, 31 deletions
src/interfaces/idapro/STARSInterface.cpp
with
39 additions
and
31 deletions
src/interfaces/idapro/STARSInterface.cpp
View file @
732a3a9b
...
...
@@ -477,38 +477,46 @@ bool STARS_IDA_Interface_t::AuditEHFunctionBoundaries(void) {
// Use the FDEs (Frame Descriptor Entries) from the eh_frame section
// to perform the same algorithm as above: an FDE should contain only one func.
const
string
ExeFileName
=
global_STARS_program
->
GetRootFileName
();
auto
EHParser
=
EHP
::
EHFrameParser_t
::
factory
(
ExeFileName
);
const
auto
FDEvecptr
=
EHParser
->
getFDEs
();
for
(
const
auto
FDEveciter
:
*
FDEvecptr
)
{
uint64_t
startAddr
=
FDEveciter
->
getStartAddress
();
uint64_t
endAddr
=
FDEveciter
->
getEndAddress
();
// See if start and end of FDE landing pad are in the same IDA Pro func.
STARS_ea_t
CurrStartEA
=
(
STARS_ea_t
)
startAddr
;
STARS_ea_t
CurrEndEA
=
(
STARS_ea_t
)
endAddr
;
func_t
*
StartFunc
=
::
get_func
(
CurrStartEA
);
func_t
*
EndFunc
=
::
get_func
(
CurrEndEA
-
1
);
if
(
StartFunc
!=
EndFunc
)
{
STARS_Segment_t
*
FuncSeg
=
this
->
getseg
(
CurrStartEA
);
assert
(
nullptr
!=
FuncSeg
);
char
SegName
[
STARS_MAXSTR
];
STARS_ssize_t
SegNameLen
=
FuncSeg
->
GetSegmentName
(
SegName
,
STARS_MAXSTR
-
1
);
assert
(
0
<
SegNameLen
);
const
bool
PLTflag
=
(
nullptr
!=
strstr
(
SegName
,
"plt"
));
const
bool
DYNflag
=
(
nullptr
!=
strstr
(
SegName
,
"dyn"
));
if
(
!
(
PLTflag
||
DYNflag
))
{
ProblemFound
=
true
;
SMP_msg
(
"INFO: FUNCBOUNDS: FDE range from %llx to %llx spans functions in segment %s
\n
"
,
(
uint64_t
)
CurrStartEA
,
(
uint64_t
)
(
CurrEndEA
-
1
),
SegName
);
bool
success
=
this
->
RedefineIDAFuncBounds
(
StartFunc
,
EndFunc
,
CurrStartEA
,
CurrEndEA
);
if
(
success
)
SMP_msg
(
"INFO: Redefined IDA FuncBounds successfully.
\n
"
);
else
SMP_msg
(
"ERROR: Failed to redefine IDA FuncBounds.
\n
"
);
try
{
auto
EHParser
=
EHP
::
EHFrameParser_t
::
factory
(
ExeFileName
);
const
auto
FDEvecptr
=
EHParser
->
getFDEs
();
for
(
const
auto
FDEveciter
:
*
FDEvecptr
)
{
uint64_t
startAddr
=
FDEveciter
->
getStartAddress
();
uint64_t
endAddr
=
FDEveciter
->
getEndAddress
();
// See if start and end of FDE landing pad are in the same IDA Pro func.
STARS_ea_t
CurrStartEA
=
(
STARS_ea_t
)
startAddr
;
STARS_ea_t
CurrEndEA
=
(
STARS_ea_t
)
endAddr
;
func_t
*
StartFunc
=
::
get_func
(
CurrStartEA
);
func_t
*
EndFunc
=
::
get_func
(
CurrEndEA
-
1
);
if
(
StartFunc
!=
EndFunc
)
{
STARS_Segment_t
*
FuncSeg
=
this
->
getseg
(
CurrStartEA
);
assert
(
nullptr
!=
FuncSeg
);
char
SegName
[
STARS_MAXSTR
];
STARS_ssize_t
SegNameLen
=
FuncSeg
->
GetSegmentName
(
SegName
,
STARS_MAXSTR
-
1
);
assert
(
0
<
SegNameLen
);
const
bool
PLTflag
=
(
nullptr
!=
strstr
(
SegName
,
"plt"
));
const
bool
DYNflag
=
(
nullptr
!=
strstr
(
SegName
,
"dyn"
));
if
(
!
(
PLTflag
||
DYNflag
))
{
ProblemFound
=
true
;
SMP_msg
(
"INFO: FUNCBOUNDS: FDE range from %llx to %llx spans functions in segment %s
\n
"
,
(
uint64_t
)
CurrStartEA
,
(
uint64_t
)
(
CurrEndEA
-
1
),
SegName
);
bool
success
=
this
->
RedefineIDAFuncBounds
(
StartFunc
,
EndFunc
,
CurrStartEA
,
CurrEndEA
);
if
(
success
)
SMP_msg
(
"INFO: Redefined IDA FuncBounds successfully.
\n
"
);
else
SMP_msg
(
"ERROR: Failed to redefine IDA FuncBounds.
\n
"
);
}
}
}
}
// end for (const auto FDEveciter : *FDEvecptr)
}
// end for (const auto FDEveciter : *FDEvecptr)
}
catch
(
const
std
::
exception
&
e
)
{
const
auto
msg
=
string
(
"WARN: Unhandled exception when processing EH frame: "
)
+
e
.
what
();
SMP_msg
(
msg
.
c_str
());
}
#endif // __X64__
#endif // STARS_USE_EHP_LIB
...
...
This diff is collapsed.
Click to expand it.