Page 1 of 1

How can an application obtain its full path?

Posted: Tue Aug 26, 2014 8:25 pm
by seppe
How can an application obtain it's full path?
Note: the thread info record only reveals it's application name.

Re: How can an application obtain its full path?

Posted: Tue Aug 26, 2014 9:09 pm
by Mario_r4

Code: Select all

	use32
	org 0x0
	db 'MENUET01'	; 8 byte id
	dd 0x01		; header version
	dd START	; start of code
	dd IM_END	; size of image
	dd I_END	; memory for app
	dd stacktop	; esp
	dd ext_dest_cmdline	; I_Param
	dd path		; APPLICATION PACH

...

path:
	rb  4096

Re: How can an application obtain its full path?

Posted: Tue Aug 26, 2014 10:01 pm
by hidnplayr
yes, if the last dword of header is non-zero, the kernel will thread it as a 4096 byte buffer where it will write path into.