Merge remote-tracking branch 'origin/GP-5144_ghidracadabra_PR-6307_sad-dev_LocRange'

This commit is contained in:
Ryan Kurtz 2024-11-20 10:54:37 -05:00
commit f6dfa0964a
2 changed files with 22 additions and 5 deletions

View file

@ -4,9 +4,9 @@
* 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.
@ -173,6 +173,16 @@ public class PcodeSyntaxTree implements PcodeFactory {
return vbank.locRange(addr);
}
/**
* return all Varnodes bounded between two Addresses
* @param min -- Minimum Address of Varnodes
* @param max -- Maximum Address of Varnodes
* @return -- Iterator to Varnodes
*/
public Iterator<VarnodeAST> getVarnodes(Address min, Address max) {
return vbank.locRange(min, max);
}
/**
* return all Varnodes of a given size that start at a given Address
* @param sz -- Size of Varnodes

View file

@ -4,9 +4,9 @@
* 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.
@ -210,7 +210,7 @@ public class VarnodeBank {
}
public Iterator<VarnodeAST> locRange(AddressSpace spaceid) {
VarnodeAST searchvn1 = new VarnodeAST(spaceid.getAddress(0),0,0);
VarnodeAST searchvn1 = new VarnodeAST(spaceid.getMinAddress(),0,0);
searchvn1.setInput(true);
VarnodeAST searchvn2 = new VarnodeAST(spaceid.getMaxAddress(), Integer.MAX_VALUE, 0);
return locTree.subSet(searchvn1, searchvn2).iterator();
@ -223,6 +223,13 @@ public class VarnodeBank {
searchvn2.setInput(true);
return locTree.subSet(searchvn1,searchvn2).iterator();
}
public Iterator<VarnodeAST> locRange(Address min, Address max) {
VarnodeAST searchvn1 = new VarnodeAST(min,0,0);
searchvn1.setInput(true);
VarnodeAST searchvn2 = new VarnodeAST(max, Integer.MAX_VALUE,0);
return locTree.subSet(searchvn1,searchvn2).iterator();
}
public Iterator<VarnodeAST> locRange(int sz,Address addr) {
VarnodeAST searchvn1 = new VarnodeAST(addr,sz,0);