;
; Virogen's API Importer v0.10
; Fri. 05/07/99 8:00pm
; ----------------------------------------------------------------
; This procedure finds API addresses by traversing the export table
; of a given module handle (base), thereby removing the necessity of
; GetProcAddress. The usefulness of this is clear, combined with my 
; procedure to find the kernel32 base, one can import kernel32 API
; addresses without relying on the system module loader in any way,
; or on any pre-imported APIs. This procedure may also be useful
; on other occaisions where it is desirable not to use GetProcAddress.
; Many people asked for explainations on how lorez and heretic 
; performed this operation, so here'z to yall.
;
; This procedure simply traverses the export table of the given
; module, and finds the API address. This is best described in
; the following formulas:
;
;    APINameIndex=Number of the entry in the ExportNamePointerTable
;    Ordinal Number=OrdinalTable[(APINameIndex+1)*2]
;    API RVA=ExportAddressTable[(OrdinalNumber-OrdinalBase)*4]
;
; DWORD VgImport(DWORD ModuleBase, DWORD pAPIName, DWORD Ordinal)
;
; ModuleBase=Base of the module you want to import the API from.
; pAPIName  =pointer to the ASCIIz name of the API, or NULL if you
; 	     are importing by ordinal.
; Ordinal   =Ordinal number if you wish to import by ordinal, use
; 	     0 if pAPIName is supplied.
;
; Returns:
; 0 if error, otherwise the return value (in eax) is the address
; of the API.
;
;
;
;						Enjoy!
;						Virogen
;						http://virogen.cjb.net
