JNative v1.3 project : see http://jnative.sf.net


org.xvolks.jnative.util
Class DbgHelp

java.lang.Object
  extended by org.xvolks.jnative.util.DbgHelp

public class DbgHelp
extends java.lang.Object


Field Summary
static java.lang.String DLL_NAME
           
 
Constructor Summary
DbgHelp()
           
 
Method Summary
static LONG ImageRvaToVa(Pointer NtHeaders, Pointer Base, LONG Rva, Pointer LastRvaSection)
          ImageRvaToVa Locates a relative virtual address (RVA) within the image header of a file that is mapped as a file and returns the virtual address of the corresponding byte in the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DLL_NAME

public static final java.lang.String DLL_NAME
See Also:
Constant Field Values
Constructor Detail

DbgHelp

public DbgHelp()
Method Detail

ImageRvaToVa

public static LONG ImageRvaToVa(Pointer NtHeaders,
                                Pointer Base,
                                LONG Rva,
                                Pointer LastRvaSection)
                         throws NativeException,
                                java.lang.IllegalAccessException
ImageRvaToVa

Locates a relative virtual address (RVA) within the image header of a file that is mapped as a file and returns the virtual address of the corresponding byte in the file.

PVOID ImageRvaToVa(
  PIMAGE_NT_HEADERS NtHeaders,
  PVOID Base,
  ULONG Rva,
  PIMAGE_SECTION_HEADER* LastRvaSection
);

Parameters

NtHeaders
    [in] A pointer to an IMAGE_NT_HEADERS structure. This structure can be obtained by calling the ImageNtHeader function.
Base
    [in] The base address of an image that is mapped into memory through a call to the MapViewOfFile function.
Rva
    [in] The relative virtual address to be located.
LastRvaSection
    [in, out] A pointer to an IMAGE_SECTION_HEADER structure that specifies the last RVA section. This is an optional parameter. When specified, it points to a variable that contains the last section value used for the specified image to translate an RVA to a VA.

Return Values

If the function succeeds, the return value is the virtual address in the mapped file.

If the function fails, the return value is NULL. To retrieve extended error information, call GetLastError.

Throws:
java.lang.IllegalAccessException
NativeException

JNative v1.3 project : see http://jnative.sf.net