### Setup Controller Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/AbstractClientContext Sets up the controller. This method is called from the start() method. ```APIDOC ## setupController ### Description Sets up the controller. ### Method `public abstract boolean setupController()` ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **boolean** - True if the controller was set up successfully, false otherwise. #### Response Example ``` true ``` ``` -------------------------------- ### Example Usage of IDNewInfo Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/IDNewInfo Demonstrates the instantiation of a class 'Foo' using the 'new' keyword with arguments. This example highlights the typical usage pattern that IDNewInfo represents. ```Java Foo x = new Foo(1, "abc"); ^^^^^^^^^^^^^^^^^^^ ``` -------------------------------- ### AbstractInteractiveBinaryUnit Constructor Example (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/AbstractInteractiveBinaryUnit Provides an example of a typical constructor for a derived class of AbstractInteractiveBinaryUnit. It demonstrates how to call the superclass constructor and includes placeholder for custom initialization. ```java public DerivedClass(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) { super(..., input, ..., name, unitProcessor, parent, pdm); ... } ``` -------------------------------- ### AbstractInteractiveUnit Constructor Example (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/AbstractInteractiveUnit Provides an example of how to implement a constructor for a derived class of AbstractInteractiveUnit. This constructor typically calls the superclass constructor with necessary parameters and performs additional setup for the derived unit. ```java public DerivedClass(String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) { super(..., name, unitProcessor, parent, pdm); ... } ``` -------------------------------- ### Start MCP Server (Default) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/mcp/class-use/IJebMcpServer Starts the singleton MCP server using default port and endpoint configurations. This method ensures the server is running and accessible. ```APIDOC ## POST /jeb/mcp/server/start/default ### Description Starts the singleton MCP server bound to the current JEB engines, using the default port and default endpoint. If the server is already running, this operation might have no effect or restart the server depending on the implementation. ### Method POST ### Endpoint /jeb/mcp/server/start/default ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the server start status, e.g., "started" or "already running". #### Response Example ```json { "status": "started" } ``` ``` -------------------------------- ### Java Array Creation Examples Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/IDNewArrayInfo Illustrates the declaration and initialization of integer and character arrays in Java. These examples show the syntax for creating arrays of specific types and sizes, or with initial values. ```java int[] ints = new int[3]; char[] chars = new char[]{'h', 'e', 'l', 'l', 'o'}; ``` -------------------------------- ### Get Engines Context Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/AbstractClientContext Gets the JEB engines instance. Should ideally never be null unless an error occurred during start() or the context is for a floating controller. ```APIDOC ## getEnginesContext ### Description Get the JEB engines instance. ### Method `public final IEnginesContext getEnginesContext()` ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **IEnginesContext** - The JEB engines instance. #### Response Example ```json { "instance_type": "EnginesContext" } ``` ``` -------------------------------- ### Emulator Setup and Configuration Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/decompiler/ir/emulator/EEmulator Methods for configuring and initializing the emulator environment, including setting preferred stack bases and registers. ```APIDOC ## Emulator Setup and Configuration ### Description Methods for configuring and initializing the emulator environment, including setting preferred stack bases and registers. ### Methods - **`setPreferredStackBase(long address)`** - **Description**: Must be called before `setup()`. - **Return Type**: `void` - **`setResetUnknownRegisters(boolean enabled)`** - **Description**: Must be called before `setup()`. - **Return Type**: `void` - **`setup()`** - **Description**: Initializes the emulator environment. - **Return Type**: `boolean` - **`teardown()`** - **Description**: Cleans up temporary constructs built during `setup()`. - **Return Type**: `void` ``` -------------------------------- ### Get Core Context Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/AbstractClientContext Gets the JEB core instance. Should ideally never be null unless an error occurred during start() or the context is for a floating controller. ```APIDOC ## getCoreContext ### Description Get the JEB core instance. ### Method `public final ICoreContext getCoreContext()` ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **ICoreContext** - The JEB core instance. #### Response Example ```json { "instance_type": "CoreContext" } ``` ``` -------------------------------- ### setupCustomProperties Method Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/INativePlugin Documentation for the `setupCustomProperties` method within the `INativePlugin` interface. ```APIDOC ## void setupCustomProperties(IPropertyDefinitionManager pdm) ### Description Customize the properties of the native plugin. Properties set up by the generic native identifier master plugin can be modified; other properties, specific to this module, can be added. ### Method `void setupCustomProperties` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **pdm** (IPropertyDefinitionManager) - The property definition manager. ### Request Example None ### Response #### Success Response (200) None (method returns void) #### Response Example None ``` -------------------------------- ### Display Demo Information Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/AbstractClientContext Displays demo-specific information. This method is called from the start() method. ```APIDOC ## displayDemoInformation ### Description Displays demo-specific information. ### Method `public abstract void displayDemoInformation(String demoInfo)` ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Get Item at Address Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/analyzer/IMemoryModel Retrieves the memory item starting at a specific address. ```APIDOC ## GET /model/item/at ### Description Retrieve the item starting at the given address. ### Method GET ### Endpoint /model/item/at #### Query Parameters - **address** (long) - Required - The address to query. ### Response #### Success Response (200) - **item** (INativeContinuousItem) - The item found at the specified address, or null if none exists. #### Response Example ```json { "item": { "address": 1024, "size": 16, "value": "0x1234ABCD" } } ``` ``` -------------------------------- ### Get Property Type Details Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/properties/impl/PropertyTypeBoolean Examples of retrieving the name and default value of a boolean property type. ```APIDOC ## Get Property Type Details ### Method `String getName()` ### Description Get the type name of the property. ### Endpoint N/A (This is an instance method) ### Request Body N/A ### Response #### Success Response (200) - **String** (String) - The name of the property type (e.g., "boolean"). ### Request Example ```java String typeName = booleanType.getName(); // Assuming booleanType is an instance of PropertyTypeBoolean ``` ### Response Example ```json "boolean" ``` --- ### Method `Boolean getDefault()` ### Description Get the default value of the property. This value cannot be null. ### Endpoint N/A (This is an instance method) ### Request Body N/A ### Response #### Success Response (200) - **Boolean** (Boolean) - The default value of the property. ### Request Example ```java Boolean defaultValue = booleanType.getDefault(); // Assuming booleanType is an instance of PropertyTypeBoolean ``` ### Response Example ```json false ``` ``` -------------------------------- ### JEB Client Context Initialization Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/HeadlessClientContext This section details the initialization process for the JEB client context, including the constructor and the `initialize` method. ```APIDOC ## Constructor Details ### HeadlessClientContext ```java public HeadlessClientContext() ``` **Description:** Initializes a new instance of the `HeadlessClientContext` class. ## Method Details ### initialize ```java public void initialize(String[] argv) ``` **Description:** Initializes the client context with the provided command-line arguments. **Overrides:** `initialize` in class `AbstractClientContext` ``` -------------------------------- ### RuntimeProjectUtil Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/RuntimeProjectUtil Initializes a new instance of the RuntimeProjectUtil class. ```APIDOC ## RuntimeProjectUtil Constructor ### Description Initializes a new instance of the RuntimeProjectUtil class. ### Method Constructor ### Endpoint N/A ### Parameters None ### Request Example ```java new RuntimeProjectUtil(); ``` ### Response N/A ``` -------------------------------- ### Get MCP Server Instance Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/mcp/class-use/IJebMcpServer Retrieves the singleton instance of the MCP server. If the server is not running, this method may start it depending on the implementation. ```APIDOC ## GET /jeb/mcp/server/instance ### Description Retrieves the singleton instance of the IJebMcpServer. This is the primary way to access the MCP server functionality. ### Method GET ### Endpoint /jeb/mcp/server/instance ### Parameters None ### Request Example None ### Response #### Success Response (200) - **serverInstance** (IJebMcpServer) - The singleton instance of the MCP server. #### Response Example ```json { "serverInstance": "" } ``` ``` -------------------------------- ### getFirstRealStatement API Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/decompiler/ast/CUtil Gets the next 'real' statement to be executed in a block, starting from a given index, skipping over certain structural statements like do-while or if(true) constructs. ```APIDOC ## getFirstRealStatement ### Description Get the next "real" statement to be executed in the block, starting at the given index inclusively. In particular, this method skips over: * the `do {` part of a do-while block * the `while(true) {` part of a while block * the `if(true) {` part of a conditional statement Note: label statements are not skipped over. ### Method `public static ICStatement getFirstRealStatement(ICBlock b, int i)` ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **b** (ICBlock) - The block to search within. - **i** (int) - The index in the block, at which to start the search. ### Request Example ```java ICStatement nextStatement = CUtil.getFirstRealStatement(block, startIndex); ``` ### Response #### Success Response (200) - **ICStatement** - The first real statement found, or `null` if none is found from the given index onwards. ``` -------------------------------- ### Get Segment After Key (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/collect/ISegmentMap Retrieves the closest segment that starts after the provided key (address), without containing it. Returns null if no such segment exists. ```java V getSegmentAfter(K key) Get the closest segment after the provided address, which does not contain it. Parameters: `key` - address to probe Returns: the next segment, null if none (final gap) ``` -------------------------------- ### MathUtil - Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/math/MathUtil Initializes a new instance of the MathUtil class. ```APIDOC ## MathUtil Constructor ### Description Initializes a new instance of the MathUtil class. ### Method `public MathUtil()` ### Endpoint N/A (Constructor) ### Parameters None ### Request Example N/A ### Response N/A ### Response Example N/A ``` -------------------------------- ### ActionData Constructors Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/actions/ActionData Provides details on how to instantiate the ActionData class, with options for setting initial hints. ```APIDOC ## ActionData Constructors ### ActionData() Default constructor for ActionData. ### ActionData(boolean hintNoInfoRequest) Constructor for ActionData with a hint to indicate if minimal action is needed. Parameters: - `hintNoInfoRequest` (boolean) - If true, indicates that only minimal action is required, bypassing current state checks. ``` -------------------------------- ### SegmentMap - Get Segment After Key Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/collect/SegmentMap The `getSegmentAfter` method finds the segment immediately following a given key, without containing the key itself. This is useful for identifying the next available segment or the start of a gap. ```java public V getSegmentAfter(K key) Description copied from interface: `ISegmentMap` Get the closest segment after the provided address, which does not contain it. Specified by: `getSegmentAfter` in interface `ISegmentMap,V extends ISegment>` Parameters: `key` - address to probe Returns: the next segment, null if none (final gap) ``` -------------------------------- ### ActionContext Constructors Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/actions/ActionContext Details on how to create and initialize an ActionContext object. ```APIDOC ## Constructor Summary ### `ActionContext(IInteractiveUnit unit, int actionId, long itemId)` Create an object, requesting action information for the provided item or provided address. **Parameters:** - `unit` (IInteractiveUnit) - mandatory target unit - `actionId` (int) - mandatory action id - `itemId` (long) - optional item id (0 for none) ### `ActionContext(IInteractiveUnit unit, int actionId, long itemId, String address)` Create an object, requesting action information for the provided item or provided address. **Parameters:** - `unit` (IInteractiveUnit) - The unit. - `actionId` (int) - The action identifier. - `itemId` (long) - The item identifier. - `address` (String) - The address. ### `ActionContext(IInteractiveUnit unit, int actionId, long itemId, String address, AddressConversionPrecision precision)` Create an object, requesting action information for the provided item or provided address. **Parameters:** - `unit` (IInteractiveUnit) - mandatory target unit - `actionId` (int) - mandatory action id - `itemId` (long) - optional item id (0 for none) - `address` (String) - optional address (null for none) - `precision` (AddressConversionPrecision) - precision of the address ``` -------------------------------- ### Get Basic Block by Address in Java Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/controlflow/CFG Retrieves a basic block from the Control Flow Graph (CFG) that starts at a given address or offset. Returns null if no block begins at the specified location. ```Java public BasicBlock getBlockAt(long address) ``` -------------------------------- ### Get Block Addresses - Java Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/IBasicBlock Retrieves the start and end addresses of instructions within a basic block. These methods return long values representing memory addresses. ```java long getFirstAddress() long getBase() long getLastAddress() long getEndAddress() ``` -------------------------------- ### Unit Configuration and Initialization Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/IUnit Methods for setting unit processors, initializing properties, and handling post-deserialization logic. ```APIDOC ## void setUnitProcessor(IUnitProcessor processor) ### Description Set the unit processor. This method is called by the managing project or (engines) context. ### Method PUT ### Endpoint /units/{unitId}/processor ### Parameters #### Query Parameters None #### Request Body - **processor** (IUnitProcessor) - Required - The unit processor to set. ### Response #### Success Response (200) - **void** - Operation successful. #### Response Example ```json { "message": "Unit processor set successfully." } ``` ## void initializePropertyObjects(IUnitCreator parent, IUnitProcessor processor, IPropertyDefinitionManager pdm) ### Description Initialize the property manager and property definition manager used by this unit. Code that needs access to the unit's property manager right after deserialization can safely do so after execution of this method. ### Method POST ### Endpoint /units/{unitId}/initializeProperties ### Parameters #### Query Parameters None #### Request Body - **parent** (IUnitCreator) - Required - The parent unit or artifact. - **processor** (IUnitProcessor) - Required - The processor. - **pdm** (IPropertyDefinitionManager) - Required - The property definition manager for units of this type. ### Response #### Success Response (200) - **void** - Operation successful. #### Response Example ```json { "message": "Property objects initialized successfully." } ``` ## void postDeserialization(IRuntimeProject prj) ### Description This method is called by the engines after a unit has been fully deserialized. Final repairs (eg, retrieving and re-connecting global objects that were not serialized) may be done by this method. The unit's project and engines are now accessible. ### Method POST ### Endpoint /units/{unitId}/postDeserialization ### Parameters #### Query Parameters None #### Request Body - **prj** (IRuntimeProject) - Required - The project to which this unit belongs. ### Response #### Success Response (200) - **void** - Operation successful. #### Response Example ```json { "message": "Post deserialization actions completed." } ``` ## void setParent(IUnitCreator parent) ### Description Set the parent unit or artifact. ### Method PUT ### Endpoint /units/{unitId}/parent ### Parameters #### Query Parameters None #### Request Body - **parent** (IUnitCreator) - Required - The parent. ### Response #### Success Response (200) - **void** - Operation successful. #### Response Example ```json { "message": "Parent unit set successfully." } ``` ``` -------------------------------- ### Resolve Expressions Backward Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/decompiler/ir/EUtil Applies a list of IEStatements to user targets, resolving expressions starting from the last IEStatement to the first. Returns false if any error occurs during translation. Provides an example of how the resolution proceeds. ```java public static boolean resolveExpressionsBackward(Object name, IEConverter conv, List r, IEGeneric... targets) Apply a list of IEStatements to user targets, resolving expression starting from last `IEStatement` to first. If any error occur (something can not be translated for example), this method returns false. As an example: ``` r = {R0 = 7; R0 = R0 + 4; R1 = 8} targets = [R0, R1] i = 2 => targets = [R0, 8] i = 1 => targets = [R0+4, 8] i = 0 => targets = [11, 8] return true ``` ``` -------------------------------- ### CMethodSimulatorUtils - Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/decompiler/ast/simulator/CMethodSimulatorUtils Initializes a new instance of the CMethodSimulatorUtils class. ```APIDOC ## CMethodSimulatorUtils() ### Description Initializes a new instance of the CMethodSimulatorUtils class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example ```json { "example": "new CMethodSimulatorUtils()" } ``` ### Response #### Success Response (200) An instance of CMethodSimulatorUtils. #### Response Example ```json { "example": "Instance of CMethodSimulatorUtils" } ``` ``` -------------------------------- ### Get Table Part - ITableDocument Interface Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/output/table/impl/StaticTableDocument Retrieves a specific portion of the table document, defined by a starting row index and a count of rows. This method is part of the ITableDocument interface. ```java public ITableDocumentPart getTablePart(int start, int count) ``` -------------------------------- ### Get Used Variables (JEB API) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/IDInstruction Retrieves a list of all variables read (used) by the instruction. The list may contain duplicates if a variable is used multiple times. Example: `z = x + (y * x)` returns `[y, x, x]`. ```Java List getUsedVariables() // Gets the variables used (read) by this instruction. // Returns: the list of all variables used, potentially with duplicates. ``` -------------------------------- ### ZipEntry: Get Data Offset Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/encoding/zip/fsr/ZipEntry Retrieves the offset to the start of the compressed data for the ZIP entry within the archive. This method is useful for low-level data access and is part of the ZipEntry class. ```java public int getOffsetToData() ``` -------------------------------- ### Get or Create JEB Core Instance (with License and Options) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/class-use/ICoreContext Retrieves or creates an instance of the JEB core using a provided license key and specific core options. This offers advanced control over JEB initialization. ```APIDOC ## POST /core/instance/{licenseKey} ### Description Retrieves or creates an instance of the JEB core using a provided license key and specific core options. This offers advanced control over JEB initialization. ### Method POST ### Endpoint /core/instance/{licenseKey} ### Parameters #### Path Parameters - **licenseKey** (String) - Required - The license key for JEB. #### Query Parameters None #### Request Body - **options** (CoreOptions) - Optional - Options to configure the JEB core instance. ### Request Example ```json POST /core/instance/YOUR_LICENSE_KEY { "options": { "logLevel": "INFO", "workingDirectory": "/path/to/jeb" } } ``` ### Response #### Success Response (200) - **coreInstance** (ICoreContext) - The retrieved or newly created JEB core instance. #### Response Example ```json { "coreInstance": { ... } } ``` ``` -------------------------------- ### Get Basic Block Address Information (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/IBasicBlockSkeleton Provides methods to obtain the starting, ending, and last addresses of a basic block. These methods are essential for understanding the memory layout and boundaries of the code segment. ```java long getFirstAddress() Address of first instruction in the block. ``` ```java long getLastAddress() Address of last instruction in the block. ``` ```java long getEndAddress() Address following the last instruction of the block (ie, last exclusive address). ``` -------------------------------- ### Create State - Basic Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/IDGlobalContext Creates a fresh, uninitialized IR state with default settings. Emulator and sandbox are disabled by default. ```APIDOC ## createState ### Description Create a fresh, uninitialized IR state. The IR state is context-less (no `context` is created). Settings are left on default values, in particular, the maximum iteration count and duration are set to the default values (see `IDState.DEFAULT_MAX_ITERCOUNT`, `IDState.DEFAULT_MAX_DURATION`). The emulator and sandbox are disabled. The client should use the State's setters before proceeding with emulation. ### Method `IDState createState()` ### Endpoint N/A (Method Call) ### Parameters None ### Request Example ``` // No request body for this method ``` ### Response #### Success Response - **IDState** - a new IR state ``` -------------------------------- ### Get Table Part by Range (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/output/table/ITableDocument Retrieves a specific portion (a 'part') of the table document, defined by a starting row index and a count of rows. This allows for efficient handling of large tables by accessing only necessary data. ```Java ITableDocumentPart getTablePart(int start, int count) // Get a part of the document. // Parameters: // start - starting row index // count - number of rows to be returned // Returns: // the part ``` -------------------------------- ### Net Object Constructors Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/net/Net Provides details on how to create Net objects, either with default global proxy settings or by copying an existing Net object. ```APIDOC ## Constructors ### Net() Creates a standard Net object using global proxy settings. The user-agent is set to "PNF Software UP", and default timeouts are applied. Redirects are followed. ### Net(Net net0) Copy constructor. Creates a new Net object with the same properties as the provided `net0` object. ``` -------------------------------- ### Get Address-to-Block Map in Java Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/controlflow/CFG Retrieves a map of all basic blocks in the Control Flow Graph (CFG), keyed by their starting addresses. This method is optimized for scenarios requiring multiple lookups of blocks by address, offering better performance than repeated calls to `getBlockAt`. ```Java public TreeMap> getAddressBlockMap() ``` -------------------------------- ### SimpleFSFileStore Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/dao/impl/SimpleFSFileStore Initializes a new instance of the SimpleFSFileStore class. This constructor sets up the file store based on a provided base directory. ```APIDOC ## SimpleFSFileStore Constructor ### Description Initializes a new instance of the SimpleFSFileStore class with the specified base directory. ### Method Constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` new SimpleFSFileStore("/path/to/store") ``` ### Response #### Success Response (Constructor) N/A #### Response Example N/A ``` -------------------------------- ### Create State - With Emulation and Settings Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/IDGlobalContext Creates a fresh IR state, optionally initializing it for emulation and loading dexdec emulator settings. ```APIDOC ## createState ### Description Create a fresh IR state. The IR state is context-less (no `context` is created). ### Method `IDState createState(boolean initForEmulation, boolean loadDexdecEmuSettings)` ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **initForEmulation** (boolean) - if true, the state settings are changed to allow for IR emulation - **loadDexdecEmuSettings** (boolean) - if true, the global dexdec emulator configuration file (`dexdec-emu.cfg` in your plugins folder) is used to further configure the State ### Request Example ```java // Example of calling the method: IDState state = yourObject.createState(true, true); ``` ### Response #### Success Response - **IDState** - a new IR state ``` -------------------------------- ### Get Entry Block in Java Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/controlflow/CFG Retrieves the unique entry block of the Control Flow Graph (CFG). The entry block is the starting point of the graph's execution flow. This method is guaranteed to return a non-null value and throws an error if the entry block cannot be determined. ```Java public BasicBlock getEntryBlock() ``` -------------------------------- ### CborEncoder Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/encoding/cbor/CborEncoder Initializes a new CborEncoder instance with a specified output stream. ```APIDOC ## CborEncoder Constructor ### Description Creates a new `CborEncoder` instance. ### Method `public CborEncoder(OutputStream os)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java // No direct request body for constructor ``` ### Response #### Success Response (200) N/A (Constructor) #### Response Example ```json // No direct response body for constructor ``` ``` -------------------------------- ### Get Basic Block Containing Address in Java Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/controlflow/CFG Retrieves a basic block from the CFG that contains the given address. The address only needs to fall within the block's range, not necessarily point to the start of an instruction. This is useful for finding which block an arbitrary address belongs to. ```Java public BasicBlock getBlockContaining(long address) ``` -------------------------------- ### Get Anchors within a TextDocumentPart (Java) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/output/text/impl/TextDocumentPart Retrieves all anchors associated with this text document part. Anchors are used to mark specific positions or elements within the text. The last anchor can indicate the start of the next part, useful for spanning lines. ```java public List getAnchors() ``` -------------------------------- ### NativeCodeUtil Constructor Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/NativeCodeUtil Initializes a new instance of the NativeCodeUtil class. ```APIDOC ## NativeCodeUtil() ### Description Initializes a new instance of the `NativeCodeUtil` class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example ``` // No request body for constructors ``` ### Response #### Success Response (200) N/A (Constructor) #### Response Example ``` // No response body for constructors ``` ``` -------------------------------- ### Java DEX IR Optimizer Skeleton for JEB Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/android/ir/package-summary A fundamental Java class outlining the structure for a DEX IR optimizer plugin within JEB. This example traverses the Control Flow Graph (CFG) and logs details of each instruction, functioning as a starting point for creating custom IR optimization logic in Java. ```java //?type=dexdec-ir import com.pnfsoftware.jeb.core.units.code.android.controlflow.BasicBlock; import com.pnfsoftware.jeb.core.units.code.android.ir.AbstractDOptimizer; import com.pnfsoftware.jeb.core.units.code.android.ir.IDInstruction; public class DOptSampleJava extends AbstractDOptimizer { // note: implicit no-arg constructor is calling super() @Override public int perform() { // do not perform optimizations, simply print out each IR instruction of the current IR CFG for(BasicBlock b: cfg) { for(IDInstruction insn: b) { logger.info("%04X: %s", insn.getOffset(), insn); } } // no optimization performed return 0; } } ``` -------------------------------- ### Initialize Engines Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/AbstractClientContext Initializes the core context and engines context. This protected method may throw JebException. ```APIDOC ## initializeEngines ### Description Initialize the core context and an engines context. ### Method `protected final void initializeEngines() throws JebException` ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ### Throws - **JebException** - If an error occurs during initialization. ``` -------------------------------- ### Get or Create JEB Core Instance (with License) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/class-use/ICoreContext Retrieves or creates an instance of the JEB core using a provided license key. This endpoint allows for programmatic initialization of JEB. ```APIDOC ## POST /core/instance/{licenseKey} ### Description Retrieves or creates an instance of the JEB core using a provided license key. This endpoint allows for programmatic initialization of JEB. ### Method POST ### Endpoint /core/instance/{licenseKey} ### Parameters #### Path Parameters - **licenseKey** (String) - Required - The license key for JEB. #### Query Parameters None #### Request Body None ### Request Example ``` POST /core/instance/YOUR_LICENSE_KEY ``` ### Response #### Success Response (200) - **coreInstance** (ICoreContext) - The retrieved or newly created JEB core instance. #### Response Example ```json { "coreInstance": { ... } } ``` ``` -------------------------------- ### Procedure Definition Start Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/render/GenericCodeFormatter Retrieves the string that marks the start of a procedure definition. ```APIDOC ## GET /api/procedureDefinitionStart ### Description Retrieves the string that marks the start of a procedure definition. ### Method GET ### Endpoint /api/procedureDefinitionStart ### Parameters No parameters required. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **startString** (String) - The string marking the start of a procedure definition. #### Response Example ```json { "startString": "proc" } ``` ``` -------------------------------- ### Start Thread Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/concurrent/AbstractThreadManager Creates and starts a new daemon thread to execute a given Runnable task. ```APIDOC ## POST /start ### Description Creates and starts a new daemon thread to execute a given Runnable task. ### Method POST ### Endpoint `/start` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **r** (Runnable) - Required - The Runnable task to be executed by the new thread. ### Request Example ```json { "r": "// Runnable code here" } ``` ### Response #### Success Response (200) - **Thread** (Thread) - The newly created and started daemon thread. #### Response Example ```json { "thread": "// Thread object representation" } ``` ``` -------------------------------- ### CFG Constructor Details Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/cfg/CFG Details about the various constructors available for creating CFG objects. ```APIDOC ## CFG Constructor Details ### CFG(long entry, List> blocks) **Description**: Creates a standard CFG using a pre-constructed list of basic blocks. **Parameters**: - `entry` (long) - The entry point address. - `blocks` (List>) - A list of basic blocks. ### CFG(List insns, List irrdata) **Description**: Convenience constructor. Equivalent to `CFG(insns, irrdata, null, 0, 0, 0)`. **Parameters**: - `insns` (List) - A list of sequential instructions. They must be contiguous, meaning the first instruction is at address `base`, the second at `base`+sizeofFirstInstruction, and so on. - `irrdata` (List) - Irregular control flow information. ### CFG(List insns, List irrdata, IInstructionAugmenter augmenter, long base, long entry, int flags) **Description**: Creates a CFG by recursively processing a list of sequential instructions. Delay-slot instruction sets are not supported by this constructor. **Parameters**: - `insns` (List) - A list of sequential instructions. They must be contiguous, meaning the first instruction is at address `base`, the second at `base`+sizeofFirstInstruction, and so on. - `irrdata` (List) - Irregular control flow information. - `augmenter` (IInstructionAugmenter) - An optional instruction augmenter. - `base` (long) - The routine base address. - `entry` (long) - The routine entry-point address. - `flags` (int) - Parsing flags (see `FLAG_xxx` constants). ### CFG(Map offsetToInsn, List irrdata, IInstructionAugmenter augmenter, long entry, int flags) **Description**: Creates a CFG by recursively processing a collection of instructions. Delay-slot instruction sets are not supported by this constructor. **Parameters**: - `offsetToInsn` (Map) - A map of address-to-instructions. - `irrdata` (List) - Irregular control flow information. - `augmenter` (IInstructionAugmenter) - An optional instruction augmenter. - `entry` (long) - The routine entry-point address. - `flags` (int) - Parsing flags (see `FLAG_xxx` constants). ``` -------------------------------- ### Get Items in Range (Filtered) Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/analyzer/IMemoryModel Gets a map of items within a specified range, filtered by a predicate. ```APIDOC ## GET /model/items/range/filtered ### Description Get a map of items in the given range, filtered by a predicate. ### Method GET ### Endpoint /model/items/range/filtered #### Query Parameters - **addressBegin** (long) - Required - The starting address of the range. - **includePartialFirstItem** (boolean) - Required - Include the first item if it spans over (not starts on) the start address. - **addressEnd** (long) - Required - The ending address of the range. - **includePartialLastItem** (boolean) - Required - Include the last item if it spans over (not ends on) the last address. - **predicate** (Predicate) - Required - A predicate to filter the items. ### Response #### Success Response (200) - **items** (SortedMap) - A map of filtered items within the specified range. #### Response Example ```json { "items": { "3000": {"address": 3000, "size": 4, "value": "0x..."} } } ``` ``` -------------------------------- ### AbstractUnitRepresentation Constructors Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/output/AbstractUnitRepresentation Details on how to create instances of AbstractUnitRepresentation. ```APIDOC ## AbstractUnitRepresentation Constructors ### Constructor Details * ### AbstractUnitRepresentation ```java public AbstractUnitRepresentation(String label) ``` Create a new non-default document presentation. The identifier will be determined automatically. Parameters: `label` - The label for the document. * ### AbstractUnitRepresentation ```java public AbstractUnitRepresentation(String label, boolean defaultRepresentation) ``` Create a new document presentation. The identifier will be determined automatically. Parameters: `label` - The label for the document. `defaultRepresentation` - Indicates if this representation is the default one for the unit. * ### AbstractUnitRepresentation ```java public AbstractUnitRepresentation(long id, String label, boolean defaultRepresentation) ``` Create a new document presentation. Parameters: `id` - The unique identifier for the document. `label` - The label for the document. `defaultRepresentation` - Indicates if this representation is the default one for the unit. ``` -------------------------------- ### Thread Creation and Start Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/util/concurrent/ThreadUtil Provides methods to create and start new daemon threads, with options for naming the thread. ```APIDOC ## ThreadUtil API ### Description Utility methods to manipulate threads. ### Methods #### `static Thread create(Runnable r)` ##### Description Create a daemon thread. ##### Method `static` ##### Parameters - **r** (Runnable) - Required - The runnable task to execute in the new thread. #### `static Thread create(String name, Runnable r)` ##### Description Create a daemon thread with a specified name. ##### Method `static` ##### Parameters - **name** (String) - Required - The name of the thread. - **r** (Runnable) - Required - The runnable task to execute in the new thread. #### `static Thread start(Runnable r)` ##### Description Create and start a new daemon thread. ##### Method `static` ##### Parameters - **r** (Runnable) - Required - The runnable task to execute in the new thread. #### `static Thread start(String name, Runnable r)` ##### Description Create and start a new daemon thread with a specified name. ##### Method `static` ##### Parameters - **name** (String) - Required - The name of the thread. - **r** (Runnable) - Required - The runnable task to execute in the new thread. ``` -------------------------------- ### EState Creation and Initialization Source: https://www.pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/core/units/code/asm/decompiler/ir/class-use/EState APIs for creating and initializing EState objects for IR emulation. ```APIDOC ## IEGlobalContext.buildEmptyState() ### Description Creates a machine state for IR emulation. ### Method `default EState` ### Endpoint N/A (Class Method) ### Parameters None ### Request Example ```json { "example": "EState state = IEGlobalContext.buildEmptyState();" } ``` ### Response #### Success Response (200) - **EState** (object) - An empty machine state. #### Response Example ```json { "example": "// EState object created" } ``` ## IEGlobalContext.buildState() ### Description Creates a machine state for IR emulation with all defined registers, symbols, and globals reset to 0. ### Method `default EState` ### Endpoint N/A (Class Method) ### Parameters None ### Request Example ```json { "example": "EState state = IEGlobalContext.buildState();" } ``` ### Response #### Success Response (200) - **EState** (object) - A machine state with all values initialized to 0. #### Response Example ```json { "example": "// EState object created with zeroed values" } ``` ## IEGlobalContext.buildState(boolean initRegisters, boolean initSymbols, boolean initGlobals) ### Description Creates a machine state for IR emulation with options to initialize registers, symbols, and globals. ### Method `default EState` ### Endpoint N/A (Class Method) ### Parameters - **initRegisters** (boolean) - Required - Whether to initialize registers. - **initSymbols** (boolean) - Required - Whether to initialize symbols. - **initGlobals** (boolean) - Required - Whether to initialize globals. ### Request Example ```json { "example": "EState state = IEGlobalContext.buildState(true, false, true);" } ``` ### Response #### Success Response (200) - **EState** (object) - A machine state configured based on initialization flags. #### Response Example ```json { "example": "// EState object created with specified initializations" } ``` ## IERoutineContext.buildEmptyState() ### Description Initializes a state to emulate this routine. ### Method `EState` ### Endpoint N/A (Method of IERoutineContext) ### Parameters None ### Request Example ```json { "example": "EState state = routineContext.buildEmptyState();" } ``` ### Response #### Success Response (200) - **EState** (object) - An initialized state for routine emulation. #### Response Example ```json { "example": "// EState object for routine emulation created" } ``` ```