mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-04-26 01:35:22 +02:00
GP-6754: Jython is now an extension
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
## ###
|
||||
# IP: GHIDRA
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
##
|
||||
# Adds a comment to a program.
|
||||
|
||||
# DISCLAIMER: This is a recreation of a Java Ghidra script for example
|
||||
# use only. Please run the Java version in a production environment.
|
||||
|
||||
#@category Examples.Python
|
||||
#@runtime Jython
|
||||
|
||||
|
||||
from ghidra.program.model.address.Address import *
|
||||
from ghidra.program.model.listing.CodeUnit import *
|
||||
from ghidra.program.model.listing.Listing import *
|
||||
|
||||
minAddress = currentProgram.getMinAddress()
|
||||
listing = currentProgram.getListing()
|
||||
codeUnit = listing.getCodeUnitAt(minAddress)
|
||||
codeUnit.setComment(codeUnit.PLATE_COMMENT, "AddCommentToProgramScript - This is an added comment!")
|
||||
Reference in New Issue
Block a user