.586
Locals
jumps
.Model Flat, StdCall
UNICODE=0
 
include constants.inc
include macros.inc
include structures.inc
include common.inc

;include advapi32.inc
;include comctl32.inc
;include comdlg32.inc
;include gdi32.inc
include kernel32.inc
include user32.inc

;include nm32.inc
;*******************************************************************
;***** constants ***************************************************
;*******************************************************************

ERROR_COMMANDLINE		EQU 1
ERROR_FILE			EQU 2
ERROR_ALLOCATE			EQU 3
ERROR_READING			EQU 4

;DO NOT resort lines of next two structures. They must be exacptly like this.
NMSFILE STRUC
	pFileName		POINTER 0		;points to file name
	cNMDE		DWORD 0		;number of NMDE entries
	hFile		HFILE 0		;file handle
	hMapped		POINTER 0		;pointer in memory to read file
	cNames		DWORD 0		;number of names in STTB
	fileSize		DWORD 0		;size of file
	pNMDR		POINTER 0		;pointer to NMDR section in file
	cNMDECurrent	DWORD 0		;current procesing NMDE
	pNameOffsets	POINTER 0		;pointer to stringOffsets in STTB
	pStrings		POINTER 0		;pointer to strings (pStrings+[pNames]=string)
NMSFILE ENDS

TXTFILE STRUC
	pFileName		POINTER 0		;pointer to file name
	hMemUnlocked	HMEM 0		;memory handle
	hFile		HFILE 0		;file handle
	hMapped		POINTER 0		;pointer to memory
TXTFILE ENDS


;standard dialogbox constants
;IDBM_ALL_OK			equ 1
;IDBM_CANCEL			equ 2


;****************************************************************************
;***** Global Function and memory location defenitions **********************
;****************************************************************************


;****************************************************************************
;NM32
NM32_HEADER STRUC
	NM32				DWORD 0
	verMajor			DWORD 0
	verMinor			DWORD 0
	offNMDR			DWORD 0
	creationTime		DWORD 0
	creationNumber		DWORD 0
	fileType			DWORD 0
	fileLength		DWORD 0
	N1_NM32			DWORD 0
	N2_NM32			DWORD 0
	N3_NM32			DWORD 0
	N4_NM32			DWORD 0
	N5_NM32			DWORD 0
	N6_NM32			DWORD 0
	N7_NM32			DWORD 0
	N8_NM32			DWORD 0
	filePath			BYTE 0104h dup(0)
	copyrightString	BYTE 0100h dup(0)
NM32_HEADER ENDS
NM32s				EQU 032334D4Eh
CN_T_PUBLICONLY		EQU 01000h
CN_T_TYPEONLY			EQU 02000h
CN_T_SYMBOLSONLY		EQU 04000h
CN_T_SYMBOLS_SOURCE		EQU 08000h
CN_T_INCLUDESOURCE		EQU 010000h
CN_L_SYBOLSONLY		EQU 01h
CN_L_EXECUTABLE		EQU 02h
CN_L_EXECUTABLED		EQU 04h
CN_I_IGNOREDLL			EQU 0000h
CN_I_DLLEXPORTS		EQU 0100h
CN_I_DLLSYMBOLS		EQU 0200h
CN_B_STOPATWINMAIN		EQU 010h
CN_B_PROMPTFORCODE		EQU 040h
FT_PEEXE				EQU 02h
FT_PEDLL				EQU 04h
FT_LEVXD				EQU 06h
FT_NE				EQU 07h
FT_NMS				EQU 0Ah
FT_MAP				EQU 0Bh
FT_LX				EQU 0Eh

NMDR_HEADER STRUC
	NMDR				DWORD 0		;NMDR(string) /0
	cNMDE			DWORD 0		;number of debug enrties /4
	offGTYP			POINTER 0		;pointer to global types /8
	offSTTB			POINTER 0		;pointer to string table /C
	offSYMD			POINTER 0		;pointer to symbol data /10
	offSRCP			POINTER 0		;pointer to source copy /14
	offFPOD			POINTER 0		;pointer to pFPOD /18
	N1_NMDR			POINTER 0		;pointer to ? /1C
	N2_NMDR			POINTER 0		;pointer to ? /20
	N3_NMDR			POINTER 0		;pointer to ? /24
	N4_NMDR			POINTER 0		;pointer to ? /28
	N5_NMDR			POINTER 0		;pointer to ? /2C
	N6_NMDR			POINTER 0		;pointer to ? /30
	N7_NMDR			POINTER 0		;pointer to ? /34
NMDR_HEADER ENDS
NMDRs				EQU 52444D4Eh

NMDE_S STRUC
	NMDE				DWORD 0
	entryIndex		DWORD 0
	offEntry			POINTER 0
	entryLenght		DWORD 0
	N1_NMDE			DWORD 0
	N2_NMDE			DWORD 0
	N3_NMDE			DWORD 0
	N4_NMDE			DWORD 0
	N5_NMDE			DWORD 0
NMDE_S ENDS
NMDEs				EQU 45444D4Eh
INDEX_GTYP			EQU 01h
INDEX_STTB			EQU 02h
INDEX_NMTP			EQU 03h
INDEX_TYTB			EQU 04h
INDEX_HSHT			EQU 05h
INDEX_SYMD			EQU 06h
INDEX_SRCP			EQU 07h
INDEX_FPOD			EQU 08h

NMTP_HEADER STRUC
	NMTP				DWORD 0
	sectionLength		DWORD 0
	cTypes			DWORD 0
	N1_NMTP_HEADER		DWORD 0
	N2_NMTP_HEADER		DWORD 0
NMTP_HEADER ENDS
NMTPs				EQU 050544D4Eh
TYPE_LF_ARRAY			EQU 01003h
TYPE_LF_STRUCT			EQU 01005h
TYPE_LF_UNION			EQU 01006h
TYPE_LF_PROCEDURE		EQU 08h
TYPE_LF_LABEL			EQU 0Eh
TYPE_LF_ARGLIST		EQU 02201h
TYPE_LF_DERIVED		EQU 02204h
TYPE_LF_MEMBER			EQU 01406h
DATAS_LF_ARRAY STRUC
	lf_index			DWORD 0
	elemType			DWORD 0
	N1_LF_ARRAY		DWORD 0
	N2_LF_ARRAY		WORD 0
	length			DWORD 0
	indexType			DWORD 0
	N3_LF_ARRAY		DWORD 0
	length2			DWORD 0
	N4_LF_ARRAY		WORD 0
DATAS_LF_ARRAY ENDS
DATAS_LF_STRUCT STRUC
	lf_index			DWORD 0
	derivedType		DWORD 0
	iName			DWORD 0
	property			WORD 0
	cFields			DWORD 0
	length_LF_STRUCT	DWORD 0
	N1_LF_STRUCT		DWORD 0
	N2_LF_STRUCT		DWORD 0
	N3_LF_STRUCT		WORD 0
DATAS_LF_STRUCT ENDS
PRO_NULL				EQU 0h
PRO_PACKED			EQU 01h
PRO_CTOR				EQU 02h
PRO_OVEROPS			EQU 04h
PRO_ISNESTED			EQU 08h
PRO_CNESTED			EQU 010h
PRO_OPASSIGN			EQU 020h
PRO_OPCAST			EQU 040h
PRO_FWREF				EQU 080h
DATAS_LF_PROCEDURE STRUC
	lf_index			DWORD 0
	argList			DWORD 0
	rType			DWORD 0
	call_LF_PROCEDURE	DWORD 0
	argCount			DWORD 0
DATAS_LF_PROCEDURE ENDS
CALL_NEAR_C			EQU 0h
CALL_FAR_C			EQU 1h
CALL_NEAR_PASCAL		EQU 2h
CALL_FAR_PASCAL		EQU 3h
CALL_NEAR_FASTCALL		EQU 4h
CALL_FAR_FASTCALL		EQU 5h
CALL_PCODE			EQU 6h
CALL_NEAR_STDCALL		EQU 7h
CALL_FAR_STDCALL		EQU 8h
CALL_NEAR_SYSCALL		EQU 9h
CALL_FAR_SYSCALL		EQU Ah
CALL_THIS				EQU Bh
CALL_MIPS				EQU Ch
CALL_GENERIC			EQU Dh
DATAS_LF_LABEL STRUC
	lf_index			DWORD 0
	mode				DWORD 0
DATAS_LF_LABEL ENDS
LABEL_NEAR			EQU 0h
LABEL_FAR				EQU 04h
DATAS_LF_ARGLIST STRUC
	lf_index			DWORD 0
	N1_LF_ARGLIST		DWORD 0
	argCount_LF_ARGLIST	DWORD 0
	varType			DWORD 0
DATAS_LF_ARGLIST ENDS
DATAS_LF_DERIVED STRUC
	lf_index			DWORD 0
	N1_LF_DERIVED		DWORD 0
	memCount			DWORD 0
	memType			DWORD 0
DATAS_LF_DERIVED ENDS
DATAS_LF_MEMBER STRUC
	lf_index			DWORD 0
	indexType_LF_MEMBER	DWORD 0
	iName			DWORD 0
	access			WORD 0
	offset			WORD 0
	N1_LF_MEMBER		DWORD 0
DATAS_LF_MEMBER ENDS
ACCESS_NONE			EQU 0h
ACCESS_PRIVATE			EQU 1h
ACCESS_PROTECTED		EQU 2h
ACCESS_PUBLIC			EQU 3h

STTB_HEADER STRUC
	STTB				DWORD 0
	sectionLength		DWORD 0
	cNames_STTB		DWORD 0
	NN1				DWORD 0
	NN2				DWORD 0
STTB_HEADER ENDS
STTBs				EQU 042545453h

TYTB_HEADER STRUC
	TYTB				DWORD 0
	sectionLength		DWORD 0
	cTypes			DWORD 0
	offTypeTables		DWORD 0
	N1_TYTB			DWORD 0
	N2_TYTB			DWORD 0
TYTB_HEADER ENDS
TYTBs				EQU 042545954h
TYPETABLE STRUC
	type				DWORD 0
	iNameType			DWORD 0
TYPETABLE ENDS

HSHT_HEADER STRUC
	HSHT				DWORD 0
	sectionLength		DWORD 0
	sizeTableOffsets	DWORD 0
	cTypes_HSHT		DWORD 0
	offTableOffsets	DWORD 0
	offTypeTables_HSHT	DWORD 0
	N1_HSHT			DWORD 0
	N2_HSHT			DWORD 0
HSHT_HEADER ENDS
HSHTs			EQU 054485348h
HSHT_TYPETABLE STRUC
	offPreviousTable	DWORD 0
	hashNumber		DWORD 0
	iNameType_HSHT		DWORD 0
	type_HSHT			DWORD 0
	N1_TYPETABLE		DWORD 0
HSHT_TYPETABLE ENDS

SYMD_HEADER STRUC
	SYMD					DWORD 0
	sectionLength			DWORD 0
	offSegmentData_header	DWORD 0
	N1_SYMD_HEADER			DWORD 0
	N2_SYMD_HEADER			DWORD 0
	N3_SYMD_HEADER			DWORD 0
	N4_SYMD_HEADER			DWORD 0
	N5_SYMD_HEADER			DWORD 0
	N6_SYMD_HEADER			DWORD 0
	N7_SYMD_HEADER			DWORD 0
	N8_SYMD_HEADER			DWORD 0
SYMD_HEADER ENDS
SYMDs				EQU 0444D5953h
SEGMENTDATA_HEADER STRUC
	subSectionLength		DWORD 0
	cSourceFiles			DWORD 0
	cSegments				DWORD 0
SEGMENTDATA_HEADER ENDS
SEGMENTDATA STRUC
	nSeg					WORD 0
	iNameSegment			DWORD 0
	N1_SEGMENTDATA			DWORD 0
	physSize				DWORD 0
	offProcDef			DWORD 0
	cProcedures			DWORD 0
	offLVarDef			DWORD 0
	offSCLineDef			DWORD 0
	offVLPDef				DWORD 0
	cVLP					DWORD 0
	offVLPOffsets			DWORD 0
	offSourceSDef			DWORD 0
	cSourceSec			DWORD 0
	offSCLineDef2			DWORD 0
SEGMENTDATA ENDS
;SEGMENTDATA STRUC
;	nSeg				WORD 0
;	iNameSegment		DWORD 0
;	seg1				DWORD 0
;	physSize			DWORD 0
;	offProcDef		DWORD 0
;	cProcedures		DWORD 0
;	offLVarDef		DWORD 0
;	offSCodeDef2		DWORD 0
;	offVLPDef			DWORD 0
;	cVLP				DWORD 0
;	offVLPOffsets		DWORD 0
;	offSourceSDef		DWORD 0
;	cSourceSec		DWORD 0
;	offSCodeDef		DWORD 0
;SEGMENTDATA ENDS
SEGDATA_PROCEDURE STRUC
	offStartProc			DWORD 0
	offEndProc			DWORD 0
	offLocalVariables		DWORD 0
	cLocalVariables		DWORD 0
	N1_SD_PROCEDURE		DWORD 0
	N2_SD_PROCEDURE		DWORD 0
	M1					DWORD 0
SEGDATA_PROCEDURE ENDS
SEGDATA_SOURCELINES STRUC
	offInCode				DWORD 0
	lineNumber			DWORD 0
SEGDATA_SOURCELINES ENDS
SEGDATA_SOURCESECTION STRUC
	offStartSourceSection	DWORD 0
	offEndSourceSection		DWORD 0
	offSourceLine			DWORD 0
	cLinesTables			DWORD 0
	offInSFDef			DWORD 0
SEGDATA_SOURCESECTION ENDS
SEGDATA_VLPTABLE STRUC
	ten					WORD 0
	tableType				WORD 0
	type_VLP				DWORD 0
	iNameVLP				DWORD 0
	offVLP				DWORD 0
SEGDATA_VLPTABLE ENDS
TT_LOCALV					EQU 01h
TT_LABEL					EQU 04h
TT_VARIABLE				EQU 05h
TT_GLOBALV				EQU 06h
TT_LOCALP					EQU 07h
TT_GLOBALP				EQU 08h
TT_IMPORTD				EQU 09h
SEGDATA_SOURCEFILE STRUC
	iNameSource			DWORD 0
	offSource				DWORD 0
	sourceLength			DWORD 0
	N1_SD_SOURCEFILE		DWORD 0
	N2_SD_SOURCEFILE		DWORD 0
SEGDATA_SOURCEFILE ENDS

FPOD_HEADER STRUC
	FPOD				DWORD 0
	sectionLength		DWORD 0
	N1_FPOD			DWORD 0
	N2_FPOD			DWORD 0
	N3_FPOD			DWORD 0
	N4_FPOD			DWORD 0
	N5_FPOD			DWORD 0
	N6_FPOD			DWORD 0
	N7_FPOD			DWORD 0
	N8_FPOD			DWORD 0
	N9_FPOD			DWORD 0
	NA_FPOD			DWORD 0
FPOD_HEADER ENDS
FPODs				EQU 0444F5046h

SRCP_HEADER STRUC
	SRCP				DWORD 0
	sectionLength		DWORD 0
	offSourceFiles		DWORD 0
	N1_SRCP			DWORD 0
	N2_SRCP			DWORD 0
SRCP_HEADER ENDS
SRCPs				EQU 050435253h

GTYP_HEADER STRUC
	GTYP				DWORD 0
	sectionLength		DWORD 0
	offNMTP			DWORD 0
	offSTTB			DWORD 0
	offTYTB			DWORD 0
	offHSHT			DWORD 0
	N1_GTYP			DWORD 0
	N2_GTYP			DWORD 0
GTYP_HEADER ENDS
GTYPs				EQU 050595447h
