Interface INativeMethodItem
- All Superinterfaces:
ICodeItem,ICodeMethod,INativeItem,INativeItemListenable
A method item references an external or internal native routine. Internal routines have
associated
INativeMethodDataItem objects defining them.-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
FLAG_ABSTRACT, FLAG_ANNOTATION, FLAG_ANONYMOUS, FLAG_ARTIFICIAL, FLAG_BRIDGE, FLAG_CONSTRUCTOR, FLAG_DECLARED_SYNCHRONIZED, FLAG_DESTRUCTOR, FLAG_ENUM, FLAG_FINAL, FLAG_INNER, FLAG_INTERFACE, FLAG_INTERNAL, FLAG_NATIVE, FLAG_PRIVATE, FLAG_PROTECTED, FLAG_PUBLIC, FLAG_STATIC, FLAG_STRICT, FLAG_SYNCHRONIZED, FLAG_SYNTHETIC, FLAG_TRANSIENT, FLAG_VARARGS, FLAG_VIRTUAL, FLAG_VOLATILE -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the native class item owning this method.Get the type of the class holding this method.getData()If the method is internal, retrieve the method's definition object.Retrieve the final rendered method name.Retrieve the function-pointer type for this method.List<? extends IInstruction> Retrieve a list of instructions for this method.default LongConvenience method to retrieve the physical address of the routine start, if a definition object is present.Retrieve a hint specifying whether or not the method returns to its caller.getParameterName(int index) Retrieve a parameter name.Retrieve a list of parameter names.List<? extends INativeType> Get the method's parameters list.Retrieve the method prototype, if one was set.Get the method's return type.booleanDetermine if the native prototype was auto-generated.booleanDetermine whether this method matched a well-known method signed by one of JEB's code signing system.booleanDetermine whether this method is a placeholder.booleanDetermine whether this method is virtual.voidsetNonReturning(Boolean nonReturning) Specify whether the method returns to its caller upon completion.voidsetParameterName(int index, String name) Set a parameter name.voidsetParameterNames(Collection<String> names) Set parameter names.voidsetPrototype(IPrototypeItem prototype) Set or update a prototype.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
getAddress, getAddress, getGenericFlags, getIndex, getItemId, getName, getName, getSignature, getSignature, getSignature, isArtificial, isInternalMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.items.INativeItem
addFlags, dispose, getAttribute, getAttributes, hasAttribute, hasFlag, hasTrueAttribute, isAutoGenerated, isDisposed, isRenamed, removeAttribute, removeFlags, setAttribute, setAutoGenerated, setFlags, setNameMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.items.INativeItemListenable
addListener, removeListener
-
Method Details
-
isAutoGeneratedPrototype
boolean isAutoGeneratedPrototype()Determine if the native prototype was auto-generated. The value is irrelevant ifgetPrototype()returns null.- Returns:
- true if the prototype was automatically generated
-
getPrototype
IPrototypeItem getPrototype()Retrieve the method prototype, if one was set.- Returns:
- the prototype or null (if unknown)
-
setPrototype
Set or update a prototype. Any wildcard prototype attached to the routine will be nullified.- Parameters:
prototype- new prototype, or null
-
getData
INativeMethodDataItem getData()If the method is internal, retrieve the method's definition object.- Returns:
- the method data object; null if the method is external
-
getMemoryAddress
Convenience method to retrieve the physical address of the routine start, if a definition object is present.- Returns:
- an address or null if this reference does not link to a definition object
-
getClassType
IClassType getClassType()Description copied from interface:ICodeMethodGet the type of the class holding this method. This method will return null if the method is class-less (example, a native sub-routine not contained in any class).- Specified by:
getClassTypein interfaceICodeMethod- Returns:
- the class type, null if unknown
-
getClassItem
INativeClassItem getClassItem()Retrieve the native class item owning this method.- Returns:
- class item, or null
-
isVirtualMethod
boolean isVirtualMethod()Determine whether this method is virtual.- Returns:
- true if this method is virtual
-
getReturnType
INativeType getReturnType()Description copied from interface:ICodeMethodGet the method's return type.- Specified by:
getReturnTypein interfaceICodeMethod- Returns:
- the return type, null if unknown
-
getParameterTypes
List<? extends INativeType> getParameterTypes()Description copied from interface:ICodeMethodGet the method's parameters list.- Specified by:
getParameterTypesin interfaceICodeMethod- Returns:
- the parameter types, null if unknown
-
getParameterNames
Retrieve a list of parameter names.- Returns:
- a list, possibly empty (or containing less entries than the actual parameter count); never null
-
getParameterName
Retrieve a parameter name.- Parameters:
index- parameter index- Returns:
- parameter name, or null
-
setParameterNames
Set parameter names.- Parameters:
names- parameter names
-
setParameterName
Set a parameter name.- Parameters:
index- parameter indexname- parameter name
-
getFunctionPointer
IReferenceType getFunctionPointer()Retrieve the function-pointer type for this method.- Returns:
- function-pointer type
-
getInstructions
List<? extends IInstruction> getInstructions()Retrieve a list of instructions for this method. It is preferable to usegetData()andINativeMethodDataItem.getCFG()instead.- Specified by:
getInstructionsin interfaceICodeMethod- Returns:
- null if the method has no body; else, a list (possibly empty) of instructions
-
getNonReturning
Boolean getNonReturning()Retrieve a hint specifying whether or not the method returns to its caller. Note that this information may be provided inprototype.- Returns:
- null if not present or not computed
-
setNonReturning
Specify whether the method returns to its caller upon completion. Note that this information may be provided inprototype.- Parameters:
nonReturning- non-returning hint, or null
-
isPlaceholderMethod
boolean isPlaceholderMethod()Determine whether this method is a placeholder.- Returns:
- true if this method is a placeholder
-
isDetectedAsLibraryCode
boolean isDetectedAsLibraryCode()Determine whether this method matched a well-known method signed by one of JEB's code signing system.- Returns:
- true if this method was detected as library code
-
getFinalName
String getFinalName()Retrieve the final rendered method name.- Returns:
- final method name
-