Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cwe_checker
Overview
Overview
Details
Activity
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
fact-depend
cwe_checker
Commits
19eac24e
Unverified
Commit
19eac24e
authored
Feb 07, 2022
by
Enkelmann
Committed by
GitHub
Feb 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some (but not all) AVR8 issues (#286)
parent
c0a33fc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
HelperFunctions.java
src/ghidra/p_code_extractor/internal/HelperFunctions.java
+5
-5
ParseCspecContent.java
src/ghidra/p_code_extractor/internal/ParseCspecContent.java
+1
-1
TermCreator.java
src/ghidra/p_code_extractor/internal/TermCreator.java
+3
-3
No files found.
src/ghidra/p_code_extractor/internal/HelperFunctions.java
View file @
19eac24e
...
...
@@ -94,13 +94,13 @@ public final class HelperFunctions {
/**
* @param constant:
Constant value
* @return:
Constant v
alue without prefix
* @param constant:
Value which may have a prefix
* @return:
V
alue without prefix
*
* Removes
the consts prefix
from the constant.
* Removes
prefixes like "const:" and "mem:"
from the constant.
*/
public
static
String
remove
Constant
Prefix
(
String
constant
)
{
return
constant
.
replaceFirst
(
"^(
const
:)"
,
""
);
public
static
String
removePrefix
(
String
constant
)
{
return
constant
.
replaceFirst
(
"^(
[a-zA-Z]*
:)"
,
""
);
}
...
...
src/ghidra/p_code_extractor/internal/ParseCspecContent.java
View file @
19eac24e
...
...
@@ -162,7 +162,7 @@ public class ParseCspecContent {
*/
public
static
ResourceFile
getLdefFile
()
{
String
processorDef
=
String
.
format
(
"%s.ldefs"
,
program
.
getLanguage
().
getLanguageDescription
().
getProcessor
().
toString
());
if
(
processorDef
.
startsWith
(
"MIPS"
))
{
if
(
processorDef
.
startsWith
(
"MIPS"
)
||
processorDef
.
startsWith
(
"AVR"
)
)
{
processorDef
=
processorDef
.
toLowerCase
();
}
if
(
processorDef
.
startsWith
(
"PowerPC"
))
{
...
...
src/ghidra/p_code_extractor/internal/TermCreator.java
View file @
19eac24e
...
...
@@ -31,7 +31,7 @@ public class TermCreator {
*/
public
static
Term
<
Program
>
createProgramTerm
()
{
Tid
progTid
=
new
Tid
(
String
.
format
(
"prog_%s"
,
HelperFunctions
.
ghidraProgram
.
getMinAddress
().
toString
()),
HelperFunctions
.
ghidraProgram
.
getMinAddress
().
toString
());
String
imageBase
=
HelperFunctions
.
ghidraProgram
.
getImageBase
().
toString
(
);
String
imageBase
=
HelperFunctions
.
removePrefix
(
HelperFunctions
.
ghidraProgram
.
getImageBase
().
toString
()
);
return
new
Term
<
Program
>(
progTid
,
new
Program
(
new
ArrayList
<
Term
<
Sub
>>(),
HelperFunctions
.
addEntryPoints
(
symTab
),
imageBase
));
}
...
...
@@ -195,10 +195,10 @@ public class TermCreator {
var
.
setName
(
HelperFunctions
.
renameVirtualRegister
(
node
.
getAddress
().
toString
()));
var
.
setIsVirtual
(
true
);
}
else
if
(
node
.
isConstant
())
{
var
.
setValue
(
HelperFunctions
.
remove
Constant
Prefix
(
node
.
getAddress
().
toString
()));
var
.
setValue
(
HelperFunctions
.
removePrefix
(
node
.
getAddress
().
toString
()));
var
.
setIsVirtual
(
false
);
}
else
if
(
node
.
isAddress
())
{
var
.
setAddress
(
node
.
getAddress
().
toString
(
));
var
.
setAddress
(
HelperFunctions
.
removePrefix
(
node
.
getAddress
().
toString
()
));
var
.
setIsVirtual
(
false
);
}
else
if
(
node
.
isFree
())
{
var
.
setAddress
(
HelperFunctions
.
removeStackPrefix
(
node
.
getAddress
().
toString
()));
...
...
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