mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-20 10:37:27 +08:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
@@ -306,6 +306,10 @@ import pdb # imports Python's pdb
|
||||
import pdb_ # imports Ghidra's pdb
|
||||
```
|
||||
## Change History
|
||||
__2.0.2:__
|
||||
* [`pyghidra.open_program()`](#pyghidraopen_program) now properly throws an exception if the project
|
||||
exists and is locked.
|
||||
|
||||
__2.0.1:__
|
||||
* PyGhidra now respects the `application.settingsdir` property set in Ghidra's `launch.properties`
|
||||
file.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
##
|
||||
__version__ = "2.0.1"
|
||||
__version__ = "2.0.2"
|
||||
|
||||
# stub for documentation and typing
|
||||
# this is mostly to hide the function parameter
|
||||
|
||||
@@ -85,7 +85,7 @@ def _setup_project(
|
||||
) -> Tuple["GhidraProject", "Program"]:
|
||||
from ghidra.base.project import GhidraProject
|
||||
from java.lang import ClassLoader # type:ignore @UnresolvedImport
|
||||
from java.io import IOException # type:ignore @UnresolvedImport
|
||||
from ghidra.framework.model import ProjectLocator # type:ignore @UnresolvedImport
|
||||
if binary_path is not None:
|
||||
binary_path = Path(binary_path)
|
||||
if project_location:
|
||||
@@ -95,7 +95,6 @@ def _setup_project(
|
||||
if not project_name:
|
||||
project_name = f"{binary_path.name}_ghidra"
|
||||
project_location /= project_name
|
||||
project_location.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
if isinstance(loader, str):
|
||||
from java.lang import ClassNotFoundException # type:ignore @UnresolvedImport
|
||||
@@ -113,13 +112,14 @@ def _setup_project(
|
||||
|
||||
# Open/Create project
|
||||
program: "Program" = None
|
||||
try:
|
||||
if ProjectLocator(project_location, project_name).exists():
|
||||
project = GhidraProject.openProject(project_location, project_name, True)
|
||||
if binary_path is not None:
|
||||
if project.getRootFolder().getFile(binary_path.name):
|
||||
program = project.openProgram("/", binary_path.name, False)
|
||||
except IOException:
|
||||
project = GhidraProject.createProject(project_location, project_name, False)
|
||||
else:
|
||||
project_location.mkdir(exist_ok=True, parents=True)
|
||||
project = GhidraProject.createProject(project_location, project_name, False)
|
||||
if binary_path is not None:
|
||||
if project.getRootFolder().getFile(binary_path.name):
|
||||
program = project.openProgram("/", binary_path.name, False)
|
||||
|
||||
# NOTE: GhidraProject.importProgram behaves differently when a loader is provided
|
||||
# loaderClass may not be null so we must use the correct method override
|
||||
|
||||
@@ -1327,7 +1327,7 @@ vselcond: "ge"
|
||||
vselcond: "gt"
|
||||
is ((TMode=0 & c2021=0b11)
|
||||
| (TMode=1 & thv_c2021=0b11))
|
||||
{ tmp:1 = (!ZR); export tmp; }
|
||||
{ tmp:1 = (!ZR && NG==OV); export tmp; }
|
||||
vselcond: "vs"
|
||||
is ((TMode=0 & c2021=0b01)
|
||||
| (TMode=1 & thv_c2021=0b01))
|
||||
|
||||
Reference in New Issue
Block a user