%include "util.mac"
%include "icedump.inc"
%include "wiat.inc"


global Parse_Help


extern sdata
extern Parser.return


bits 32


segment _LTEXT
Parse_Help:
	mov	ebp,[pPrintToCommandWindow]
	mov	esi,.Table

.DisplayTable:
	lodsd
	test	eax, eax
	jz	near Parser.return

	push	esi
	mov	esi, eax
	call	ebp
	pop	esi
	jmp	short .DisplayTable


segment _LDATA
	align 4
.Table:		dd .helpVERSION
		dd .helpALLOC
		dd .helpBHRAMA
		dd .helpBREAKR3
		dd .helpCD
		dd .helpCLIP
		dd .helpDUMP
		dd .helpFDUMP
		dd .helpFPU
		dd .helpFREE
		dd .helpHASPCODE
		dd .helpHYDRA
		dd .helpKILL
		dd .helpLOAD
		dd .helpMP3
		dd .helpOPTION
		dd .helpPAGEFLAG
		dd .helpPBPM
		dd .helpPD
		dd .helpPEDUMP
		dd .helpPROTECT
		dd .helpRDMSR
		dd .helpRESUME
		dd .helpSCREENDUMP
		dd .helpSUSPEND
		dd .helpSUSPENDX
		dd .helpTETRIS
		dd .helpTRACE
		dd .helpTRACEX
		dd .helpWRMSR
		dd 0

.helpVERSION	: db 'icedump v',ICEDUMP_VERSION_ASCII,' for winice v',WINICE_VERSION_ASCII,0
.helpALLOC	: db 'ALLOC <address> <size>',0
.helpBHRAMA	: db 'BHRAMA <Bhrama window name>',0
.helpBREAKR3	: db 'BREAKR3 <R0TCB>',0
.helpCD		: db 'CD [<track>]',0
.helpCLIP	: db 'CLIP [AGPS [value]]',0
.helpDUMP	: db 'DUMP <address> [<length> <file>]',0
.helpFDUMP	: db 'FDUMP <RVA> <file>',0
.helpFPU	: db 'FPU <FPU register number> <floating point value>',0
.helpFREE	: db 'FREE <address>',0
.helpHASPCODE	: db 'HASPCODE <pwd1> <pwd2> <seed>',0
.helpHYDRA	: db 'HYDRA [<plugin name>]',0
.helpKILL	: db 'KILL <PID>',0
.helpLOAD	: db 'LOAD <address> <length> <file>',0
.helpMP3	: db 'MP3 <0,n,+,->',0
.helpOPTION	: db 'OPTION (Execute command for help)',0
.helpPAGEFLAG	: db 'PAGEFLAG <addr> pPrWsUcC',0
.helpPBPM	: db 'PBPM [ON|OFF]',0
.helpPD		: db 'PD <image base address> <eip> <file>',0
.helpPEDUMP	: db 'PEDUMP <image base address> <eip> <file>',0
.helpPROTECT	: db 'PROTECT [ON|OFF]',0
.helpRDMSR	: db 'RDMSR <MSR number>',0
.helpRESUME	: db 'RESUME <TID>|<PID>',0
.helpSCREENDUMP	: db 'SCREENDUMP [<file>]',0
.helpSUSPEND	: db 'SUSPEND <TID>|<PID>',0
.helpSUSPENDX	: db 'SUSPENDX <TID>|<PID>',0
.helpTETRIS	: db 'TETRIS [<speed>]',0
.helpTRACE	: db 'TRACE [<R0TCB> [<EIP low> [<EIP high>]]]',0
.helpTRACEX	: db 'TRACEX <EIP low> [<EIP high>]',0
.helpWRMSR	: db 'WRMSR <MSR number> <eax> [<edx>]',0
