[Solved] Dump process

Get help with using AutoHotkey and its commands and hotkeys
Sergo_bro
Posts: 22
Joined: 22 Feb 2014, 23:10

[Solved] Dump process

24 Jul 2014, 13:43

- text could not be restored -
Last edited by Sergo_bro on 27 Jul 2014, 09:58, edited 1 time in total.
Sergo_bro
Posts: 22
Joined: 22 Feb 2014, 23:10

Re: Dump process

25 Jul 2014, 15:06

No one can help?
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Dump process

25 Jul 2014, 20:25

Code: Select all

Process, Exist
PID := ErrorLevel	; PID for the currently running script


/* 
	http://msdn.microsoft.com/en-us/library/windows/desktop/ms684320%28v=vs.85%29.aspx
	
	HANDLE WINAPI OpenProcess(
	  _In_  DWORD dwDesiredAccess,
	  _In_  BOOL bInheritHandle,
	  _In_  DWORD dwProcessId
	);
	
	PROCESS_DUP_HANDLE (0x0040)
	PROCESS_QUERY_INFORMATION (0x0400)
	PROCESS_VM_READ (0x0010)
*/
hProcess := DllCall("OpenProcess"
	, "UInt",	0x0450
	, "Int",	false
	, "UInt",	PID)


/*
	http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx
	
	HANDLE WINAPI CreateFile(
	  _In_      LPCTSTR lpFileName,
	  _In_      DWORD dwDesiredAccess,
	  _In_      DWORD dwShareMode,
	  _In_opt_  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
	  _In_      DWORD dwCreationDisposition,
	  _In_      DWORD dwFlagsAndAttributes,
	  _In_opt_  HANDLE hTemplateFile
	);
	
	GENERIC_READ (0x80000000)
	GENERIC_WRITE (0x40000000)
	FILE_SHARE_READ (0x00000001)
	FILE_SHARE_WRITE (0x00000002)
	CREATE_ALWAYS (2)
*/
hFile := DllCall("CreateFile" (A_IsUnicode ? "W" : "A")
	, "Str",	A_ScriptDir "\" A_Hour "_" A_Min "_" A_Sec "-Dumped.dmp"
	, "UInt",	0xC0000000
	, "UInt",	3
	, "Int",	0
	, "UInt",	2
	, "UInt",	0
	, "Int",	0)


/*
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms680360(v=vs.85).aspx
	**See also**	http://msdn.microsoft.com/en-us/library/windows/desktop/ee416349%28v=vs.85%29.aspx
	
    BOOL WINAPI MiniDumpWriteDump(
    _In_  HANDLE hProcess,
    _In_  DWORD ProcessId,
    _In_  HANDLE hFile,
    _In_  MINIDUMP_TYPE DumpType,
    _In_  PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
    _In_  PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
    _In_  PMINIDUMP_CALLBACK_INFORMATION CallbackParam
    );
*/
Dump(hProcess, ProcessId, hFile) {
	static Ptr := A_PtrSize ? "Ptr" : "UInt"
    return DllCall("dbghelp\MiniDumpWriteDump"
		, Ptr,		hProcess
		, "UInt",	ProcessId
		, Ptr,		hFile
		, "Int",	0
		, "Int",	0
		, "Int",	0
		, "Int",	0)
}

MsgBox, % Dump(hProcess, PID, hFile)
Sergo_bro
Posts: 22
Joined: 22 Feb 2014, 23:10

Re: Dump process

26 Jul 2014, 00:51

Thank you very much!
Sergo_bro
Posts: 22
Joined: 22 Feb 2014, 23:10

Re: Dump process

26 Jul 2014, 07:35

And as you can read the resulting file?
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Dump process

26 Jul 2014, 10:14

Analyzing a Minidump wrote:To analyze a minidump
  • Open Visual Studio.
  • On the File menu, click Open Project.
  • Set Files of type to Dump Files, navigate to the dump file, select it, and click Open.
  • Run the debugger.
Although I don't have much experience with this, it appeared to work for me.
Sergo_bro
Posts: 22
Joined: 22 Feb 2014, 23:10

Re: Dump process

26 Jul 2014, 11:47

I would like to automate this, without user intervention means AHK(Google translated =))
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Dump process

27 Jul 2014, 00:33

You want to automate opening the file?

If the .dmp file type is associated with a program you can just use:
Run, "%Var_Containing_File_Path%"

Or if you want to specify a program to open it with:
Run, "%Var_Containing_Program_Path%" "%Var_Containing_File_Path%"
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: .

27 Jul 2014, 11:35

Please do not edit your post to be blank. Your post could be helpful to another user, so be courteous to them by leaving your question intact.
adrianh
Posts: 81
Joined: 28 Jul 2014, 15:34

Re: .

29 Jul 2014, 09:21

Agreed. That is just rude. :(
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: .

30 Jul 2014, 01:11

Incredible!What amazes! It has deleted the message!
Some admin should close the post.
Everything is possible!
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: .

30 Jul 2014, 01:20

Please never delete your post after it is solved. After it is solved you can rename your post to something like [Solved] Thread name here.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
User avatar
joedf
Posts: 7926
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Solved] Dump process

30 Jul 2014, 16:46

- topic renamed -
dont know how to restore the post... :(
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: [Solved] Dump process

31 Jul 2014, 00:35

joedf, don't waste your time...I think it's not worth it.
Everything is possible!
User avatar
joedf
Posts: 7926
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [Solved] Dump process

31 Jul 2014, 00:58

Agreed. Report closed.

Return to “Ask For Help”

Who is online

Users browsing this forum: mikeyww, TAC109, Xtra and 35 guests