mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-5742 Cleanup preferred CommentType enum use. Changed SARIF data component comment JSON serialization from int to String.
This commit is contained in:
parent
4a65e9af3b
commit
8c441250f5
211 changed files with 4627 additions and 4860 deletions
|
@ -1,13 +1,12 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* 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.
|
||||
|
@ -18,17 +17,16 @@
|
|||
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.program.model.listing.Listing;
|
||||
|
||||
import ghidra.program.model.listing.*;
|
||||
|
||||
public class AddCommentToProgramScript extends GhidraScript {
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
Address minAddress = currentProgram.getMinAddress();
|
||||
Listing listing = currentProgram.getListing();
|
||||
CodeUnit codeUnit = listing.getCodeUnitAt( minAddress );
|
||||
codeUnit.setComment( CodeUnit.PLATE_COMMENT, "AddCommentToProgramScript - This is an added comment!" );
|
||||
}
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
Address minAddress = currentProgram.getMinAddress();
|
||||
Listing listing = currentProgram.getListing();
|
||||
CodeUnit codeUnit = listing.getCodeUnitAt(minAddress);
|
||||
codeUnit.setComment(CommentType.PLATE,
|
||||
"AddCommentToProgramScript - This is an added comment!");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue