public class

TypeLibraryService

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryService

Class Overview

Sole implementation of the TLS. There is one TLS per JEB engines context. It can be retrieved via getTypeLibraryService().

This class is thread-safe.

Summary

Constants
int GROUPID_TYPELIB_LINUX
int GROUPID_TYPELIB_LINUX_ANDROID
int GROUPID_TYPELIB_POSIX
int GROUPID_TYPELIB_TEST
int GROUPID_TYPELIB_TEST1
int GROUPID_TYPELIB_TEST2
int GROUPID_TYPELIB_TEST3
int GROUPID_TYPELIB_TEST4
int GROUPID_TYPELIB_WIN32
int GROUPID_TYPELIB_WINDDK
String TYPELIB_FILE_EXTENSION
int UUID_TYPELIB_ANDROID_ARM
int UUID_TYPELIB_ANDROID_ARM64
int UUID_TYPELIB_ANDROID_CONSTANTS
int UUID_TYPELIB_ANDROID_X64
int UUID_TYPELIB_ANDROID_X86
int UUID_TYPELIB_GLIBC_ARM
int UUID_TYPELIB_GLIBC_ARM64
int UUID_TYPELIB_GLIBC_MIPS
int UUID_TYPELIB_GLIBC_MIPS64
int UUID_TYPELIB_GLIBC_X64
int UUID_TYPELIB_GLIBC_X86
int UUID_TYPELIB_LINUX_CONSTANTS
int UUID_TYPELIB_NTDLL_X64
int UUID_TYPELIB_NTDLL_X86
int UUID_TYPELIB_TEST_ARM
int UUID_TYPELIB_TEST_ARM64
int UUID_TYPELIB_TEST_MIPS
int UUID_TYPELIB_TEST_MIPS64
int UUID_TYPELIB_TEST_X64
int UUID_TYPELIB_TEST_X86
int UUID_TYPELIB_TEST_X86_2
int UUID_TYPELIB_WIN32_ARM
int UUID_TYPELIB_WIN32_ARM64
int UUID_TYPELIB_WIN32_CONSTANTS
int UUID_TYPELIB_WIN32_X64
int UUID_TYPELIB_WIN32_X86
int UUID_TYPELIB_WINDDK_ARM64
int UUID_TYPELIB_WINDDK_CONSTANTS
int UUID_TYPELIB_WINDDK_X64
int UUID_TYPELIB_WINDDK_X86
Public Constructors
TypeLibraryService()
Create a new TLS.
TypeLibraryService(File folder)
Create a new TLS with an initial folder.
Public Methods
synchronized void addFolder(File folder, boolean doRescan)
Add a typelib folder to this TLS.
synchronized INativeMethodItem findRoutineByName(String name, ProcessorType procType, int groupId)
Find a routine by simple name in the currently loaded typelibs.
synchronized INativeMethodItem findRoutineByName(String name, ProcessorType procType)
Convenience method.
synchronized INativeType findTypeBySignature(String signature, ProcessorType procType, int groupId)
Find a type by signature in the currently loaded typelibs.
synchronized INativeType findTypeBySignature(String signature, ProcessorType procType)
Find a type by signature in the currently loaded typelibs.
synchronized List<TypeLibraryEntry> getAvailables()
Get the list of available type library entries.
synchronized List<ITypeLibrary> getLoadedTypeLibraries()
Get the list of loaded type libraries.
synchronized List<ITypeLibrary> getNotLoadedTypeLibraries()
Get the list of type libraries that have not been loaded yet.
static String groupIdToName(int id)
synchronized boolean load(ProcessorType processorType, int groupId, int maxCount)
Load type libraries matching the given processor and group.
synchronized boolean load(ProcessorType processorType, int groupId)
Load all type libraries matching the given processor and group.
synchronized boolean load(TypeLibraryEntry entry)
Load the provided type library into this TLS.
synchronized boolean loadExternal(ITypeLibrary typelib)
synchronized boolean loadSingle(ProcessorType processorType, int groupId)
Load the highest priority type library matching the given processor type and group.
synchronized void rescan(boolean deleteOldEntries)
Rescan the type library folders to register/unregister additional/removed typelib binary files.
synchronized void rescan()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int GROUPID_TYPELIB_LINUX

Constant Value: 2 (0x00000002)

public static final int GROUPID_TYPELIB_LINUX_ANDROID

Constant Value: 3 (0x00000003)

public static final int GROUPID_TYPELIB_POSIX

Constant Value: 1 (0x00000001)

public static final int GROUPID_TYPELIB_TEST

Constant Value: 100 (0x00000064)

public static final int GROUPID_TYPELIB_TEST1

Constant Value: 101 (0x00000065)

public static final int GROUPID_TYPELIB_TEST2

Constant Value: 102 (0x00000066)

public static final int GROUPID_TYPELIB_TEST3

Constant Value: 103 (0x00000067)

public static final int GROUPID_TYPELIB_TEST4

Constant Value: 104 (0x00000068)

public static final int GROUPID_TYPELIB_WIN32

Constant Value: 10 (0x0000000a)

public static final int GROUPID_TYPELIB_WINDDK

Constant Value: 20 (0x00000014)

public static final String TYPELIB_FILE_EXTENSION

Constant Value: ".typelib"

public static final int UUID_TYPELIB_ANDROID_ARM

Constant Value: 202 (0x000000ca)

public static final int UUID_TYPELIB_ANDROID_ARM64

Constant Value: 203 (0x000000cb)

public static final int UUID_TYPELIB_ANDROID_CONSTANTS

Constant Value: 1002 (0x000003ea)

public static final int UUID_TYPELIB_ANDROID_X64

Constant Value: 201 (0x000000c9)

public static final int UUID_TYPELIB_ANDROID_X86

Constant Value: 200 (0x000000c8)

public static final int UUID_TYPELIB_GLIBC_ARM

Constant Value: 102 (0x00000066)

public static final int UUID_TYPELIB_GLIBC_ARM64

Constant Value: 103 (0x00000067)

public static final int UUID_TYPELIB_GLIBC_MIPS

Constant Value: 104 (0x00000068)

public static final int UUID_TYPELIB_GLIBC_MIPS64

Constant Value: 105 (0x00000069)

public static final int UUID_TYPELIB_GLIBC_X64

Constant Value: 101 (0x00000065)

public static final int UUID_TYPELIB_GLIBC_X86

Constant Value: 100 (0x00000064)

public static final int UUID_TYPELIB_LINUX_CONSTANTS

Constant Value: 1003 (0x000003eb)

public static final int UUID_TYPELIB_NTDLL_X64

Constant Value: 21 (0x00000015)

public static final int UUID_TYPELIB_NTDLL_X86

Constant Value: 20 (0x00000014)

public static final int UUID_TYPELIB_TEST_ARM

Constant Value: 10002 (0x00002712)

public static final int UUID_TYPELIB_TEST_ARM64

Constant Value: 10003 (0x00002713)

public static final int UUID_TYPELIB_TEST_MIPS

Constant Value: 10004 (0x00002714)

public static final int UUID_TYPELIB_TEST_MIPS64

Constant Value: 10005 (0x00002715)

public static final int UUID_TYPELIB_TEST_X64

Constant Value: 10001 (0x00002711)

public static final int UUID_TYPELIB_TEST_X86

Constant Value: 10000 (0x00002710)

public static final int UUID_TYPELIB_TEST_X86_2

Constant Value: 10010 (0x0000271a)

public static final int UUID_TYPELIB_WIN32_ARM

Constant Value: 12 (0x0000000c)

public static final int UUID_TYPELIB_WIN32_ARM64

Constant Value: 13 (0x0000000d)

public static final int UUID_TYPELIB_WIN32_CONSTANTS

Constant Value: 1000 (0x000003e8)

public static final int UUID_TYPELIB_WIN32_X64

Constant Value: 11 (0x0000000b)

public static final int UUID_TYPELIB_WIN32_X86

Constant Value: 10 (0x0000000a)

public static final int UUID_TYPELIB_WINDDK_ARM64

Constant Value: 33 (0x00000021)

public static final int UUID_TYPELIB_WINDDK_CONSTANTS

Constant Value: 1001 (0x000003e9)

public static final int UUID_TYPELIB_WINDDK_X64

Constant Value: 31 (0x0000001f)

public static final int UUID_TYPELIB_WINDDK_X86

Constant Value: 30 (0x0000001e)

Public Constructors

public TypeLibraryService ()

Create a new TLS. At least one folder must be added using addFolder(File, boolean).

public TypeLibraryService (File folder)

Create a new TLS with an initial folder. The folder will be scanned.

Public Methods

public synchronized void addFolder (File folder, boolean doRescan)

Add a typelib folder to this TLS.

Parameters
doRescan if true, rescan() will be invoked after the folder addition

public synchronized INativeMethodItem findRoutineByName (String name, ProcessorType procType, int groupId)

Find a routine by simple name in the currently loaded typelibs. Convenience routine.

Parameters
name routine name
procType optional
groupId optional (0 if none/unknown)

public synchronized INativeMethodItem findRoutineByName (String name, ProcessorType procType)

Convenience method.

Parameters
name routine name
procType optional

public synchronized INativeType findTypeBySignature (String signature, ProcessorType procType, int groupId)

Find a type by signature in the currently loaded typelibs. Convenience routine.

Parameters
procType optional
groupId optional (0 if none/unknown)

public synchronized INativeType findTypeBySignature (String signature, ProcessorType procType)

Find a type by signature in the currently loaded typelibs. Convenience routine.

Parameters
procType optional

public synchronized List<TypeLibraryEntry> getAvailables ()

Get the list of available type library entries. An available typelib is not necessarily loaded. Refer to TypeLibraryEntry for additional details about the state of a given typelib.

public synchronized List<ITypeLibrary> getLoadedTypeLibraries ()

Get the list of loaded type libraries. More type libraries may be available, eg non-loaded ones.

public synchronized List<ITypeLibrary> getNotLoadedTypeLibraries ()

Get the list of type libraries that have not been loaded yet.

public static String groupIdToName (int id)

public synchronized boolean load (ProcessorType processorType, int groupId, int maxCount)

Load type libraries matching the given processor and group.

Returns
  • success indicator if one or more typelib was loaded

public synchronized boolean load (ProcessorType processorType, int groupId)

Load all type libraries matching the given processor and group.

Returns
  • success indicator if one or more typelib was loaded

public synchronized boolean load (TypeLibraryEntry entry)

Load the provided type library into this TLS.

public synchronized boolean loadExternal (ITypeLibrary typelib)

public synchronized boolean loadSingle (ProcessorType processorType, int groupId)

Load the highest priority type library matching the given processor type and group.

Returns
  • success indicator

public synchronized void rescan (boolean deleteOldEntries)

Rescan the type library folders to register/unregister additional/removed typelib binary files.

public synchronized void rescan ()