Thanks Dr Newcomer,
for posting the #defines
PMDST(something, x) if((something) == (x)) printf(#x)
switch(something)
{
#define MDSTcase(x) case x: printf(#x); break
MDSTcase(UnusedStream);
#undef MDSTcase
}
i at the moment used what tim posted in one of the earlier posts
now on to next question
typedef enum _MINIDUMP_TYPE {
MiniDumpNormal = 0x00000000,
MiniDumpWithDataSegs = 0x00000001,
MiniDumpWithUnloadedModules = 0x00000020,
}MINIDUMP_TYPE;
now if i have a flag of 21
i should be printing all the three strings isnt it ??
int mask = 0
if ( (Flags & mask) == mask)
{
dont know why Dumpchk omits the flag 0 MiniDumpNormal i can start with
int mask = 1; to get the same behavior but i dont think that would
print the MiniDumpNormal String ever
here is a sample snippet i glued together to parse the Flags and print
out the MiniDumptypes
struct MiniDumpTypeLookup {
int Value;
PSTR Str;
} MiniDumpTypeLookupTable = {
MAKE_LOOKUP( MiniDumpNormal ),
MAKE_LOOKUP( MiniDumpWithDataSegs ),
MAKE_LOOKUP( MiniDumpValidTypeFlags ),
{ 0 , NULL }
};
char MiniDumpTypeNameBuff[0x1000] = {0};
PCHAR MiniDumpTypeName (ULONG64 Flags)
{
struct MiniDumpTypeLookup * mlk = MiniDumpTypeLookupTable;
int i = 0;
int mask = 0;
while ( mask < 0x7ffff )
{
if( (Flags & mask ) == mask )
{
if(mlk->Value == mask)
{
strncat_s(
MiniDumpTypeNameBuff,
sizeof(MiniDumpTypeNameBuff),
"\n ",
_TRUNCATE
);
strncat_s(
MiniDumpTypeNameBuff,
sizeof(MiniDumpTypeNameBuff),
mlk->Str,
_TRUNCATE
);
}
}
mask = 1<
_i++;
mlk++;
}
return MiniDumpTypeNameBuff;
}
i get an output like this
MINIDUMP_HEADER TimeDateStamp = Tue Mar 27 01:22:16 2012 (UTC + 5:30)
MINIDUMP_HEADER Flags = 21
MiniDumpNormal
MiniDumpWithDataSegs
MiniDumpWithUnloadedModules
whereas dumpchk prints out
Debug session time: Tue Mar 27 01:22:16.000 2012 (UTC + 5:30)
System Uptime: not available
Process Uptime: not available
…
Loading unloaded module list
…
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(f0f0f0f0.9e8): Access violation - code c0000005 (first/second chance not availa
ble)
----- User Mini Dump Analysis
MINIDUMP_HEADER:
Version A793 (6003)
NumberOfStreams 8
Flags 21
0001 MiniDumpWithDataSegs
0020 MiniDumpWithUnloadedModules
On 5/6/12, xxxxx@flounder.com wrote:
> No, the question isn’t stupid, it just reflects one of the major defects
> of the C language: the lack of reflection.
>
> The corect way to handle this is definitely NOT
>
> if(something == 3) printf(“ThreadListStream”);
>
> it would be correct, but tedious, to handle every case correctly, by typing
>
> if(something == ThreadListStream) printf(“ThreadListStream”)
>
> I fail to see any purpose in using the constant “3” when there is a
> perfectly good name!
>
> However, I have used a couple techniques
>
> #define PMDST(something, x) if((something) == (x)) printf(#x)
>
> then you can write
>
> PMDST(something, UnusedStream);
> else
> PMDST(something, ThreadListStream);
> else
> …
> else
> printf(“Unknown stream type %d”, something);
>
> or, I’ll sometimes do
>
> switch(something)
> {
> #define MDSTcase(x) case x: printf(#x); break
> MDSTcase(UnusedStream);
> MDSTcase(ThreadlistStream);
> …
> default:
> printf(“Unknown stream type %d”, something);
> break;
> #undef MDSTcase
> }
>
> It depends on my mood which one I might use.
> joe
>> THIS must be a STUPID c 101 QUESTION
>> still i will ask it
>>
>> dbghelp.h has this declared
>>
>> typedef enum _MINIDUMP_STREAM_TYPE {
>>
>> UnusedStream = 0,
>> ReservedStream0 = 1,
>> ReservedStream1 = 2,
>> ThreadListStream = 3,
>> ModuleListStream = 4, … s ON }
>>
>> now if i want to printf
>>
>> MiniDir = (PMINIDUMP_DIRECTORY) Buff; MiniDir->StreamType,
>>
>> say if 3 printf (“ThreadListStream”);
>>
>> should i be doing it like this ?? error prone copy paste modify by
>> hand of the enum from dbghelp.h ?? like below
>>
>>
>> PSTR
>>
>> __cdecl
>>
>> MiniStreamTypeName (
>> int StreamType
>> )
>> {
>> PSTR Ministr = {
>>
>> “UnusedStream”,
>> “ReservedStream0”,
>> “ReservedStream1”,
>> “ThreadListStream”,
>> “ModuleListStream”,
>> …
>> …
>> …
>>
>> };
>> return Ministr[StreamType];
>> }
>>
>>
>> and call it with say
>>
>> printf(
>> “%7d %08x\x20\x20\x20\x20 %-30s %08x %08x\n”,
>> i,
>> MiniDir->StreamType,
>> MiniStreamTypeName(MiniDir->StreamType),
>> MiniDir->Location.DataSize,
>> MiniDir->Location.Rva
>> );
>>
>> this seems to work though i feel this must really not be the way to go
>> about
>>
>> -====Dumping DumpHeader From Memory Dump====-
>>
>> Minidump Header Signature = 504d444d
>> MINIDUMP_VERSION = 0000a793
>> MINIDUMP_VERSION(Internal) = 00006003
>> MINIDUMP_HEADER NumberofStreams = 00000008
>> MINIDUMP_HEADER StreamDirectoryRVA = 00000020
>> MINIDUMP_HEADER CheckSum = 00000000
>> MINIDUMP_HEADER reserved = 4f70c8f0
>> MINIDUMP_HEADER TimeDateStamp = 4f70c8f0
>> MINIDUMP_HEADER Flags = 00000021
>> Stream# StreamType StreamName Size RVA
>> 0 00000003 ThreadListStream 000000c4 00000160
>> 1 00000004 ModuleListStream 00001a2c 00000224
>> 2 0000000e UnloadedModuleListStream 00000114 00001c50
>> 3 00000005 MemoryListStream 00000094 000048c4
>> 4 00000006 ExceptionStream 000000a8 000000b8
>> 5 00000007 SystemInfoStream 00000038 00000080
>> 6 00000000 UnusedStream 00000000 00000000
>> 7 00000000 UnusedStream 00000000 00000000
>> Dump Header Dumped
>>
>>
>>
>>
>>
>>
>> On 5/3/12, raj_r wrote:
>>> thanks jen for answering fast
>>> it seems i am able to get the directories and rvas with code below
>>>
>>> ftell(fp);
>>>
>>> ULONG NumberOfStreams = MiniHeader->NumberOfStreams;
>>>
>>> for (ULONG i = 0; i>>> {
>>> fread(
>>> Buff,
>>> 1,
>>> sizeof(MINIDUMP_DIRECTORY),
>>> fp
>>> );
>>> MiniDir = (PMINIDUMP_DIRECTORY) Buff;
>>> printf(
>>> “StreamType\t%08x\tSize\t%08x\tRva\t%08x\n”,
>>> MiniDir->StreamType,
>>> MiniDir->Location.DataSize,
>>> MiniDir->Location.Rva
>>> );
>>> ftell(fp);
>>> }
>>>
>>> StreamType 00000003 Size 000000c4 Rva 00000160
>>> StreamType 00000004 Size 00001a2c Rva 00000224
>>> StreamType 0000000e Size 00000114 Rva 00001c50
>>> StreamType 00000005 Size 00000094 Rva 000048c4
>>> StreamType 00000006 Size 000000a8 Rva 000000b8
>>> StreamType 00000007 Size 00000038 Rva 00000080
>>> StreamType 00000000 Size 00000000 Rva 00000000
>>> StreamType 00000000 Size 00000000 Rva 00000000
>>> Dump Header Dumped
>>>
>>>
>>> t>Dumpchk test.dmp | grep -i stream
>>> Loading dump file test.dmp
>>> NumberOfStreams 8
>>> Streams:
>>> Stream 0: type ThreadListStream (3), size 000000C4, RVA 00000160
>>> Stream 1: type ModuleListStream (4), size 00001A2C, RVA 00000224
>>> Stream 2: type UnloadedModuleListStream (14), size 00000114, RVA
>>> 00001C50
>>> Stream 3: type MemoryListStream (5), size 00000094, RVA 000048C4
>>> Stream 4: type ExceptionStream (6), size 000000A8, RVA 000000B8
>>> Stream 5: type SystemInfoStream (7), size 00000038, RVA 00000080
>>> Stream 6: type UnusedStream (0), size 00000000, RVA 00000000
>>> Stream 7: type UnusedStream (0), size 00000000, RVA 00000000
>>>
>>>
>>> so all left is to parse and the remaining bytes
>>>
>>>
>>> On 5/3/12, Jen-Lung Chiu wrote:
>>>> Yes no API support to get those data from dump headers.
>>>>
>>>> -----Original Message-----
>>>> From: xxxxx@lists.osr.com
>>>> [mailto:xxxxx@lists.osr.com] On Behalf Of raj_r
>>>> Sent: Wednesday, May 2, 2012 01:37 PM
>>>> To: Kernel Debugging Interest List
>>>> Subject: Re: [windbg] Error when reading user stream from dump file
>>>>
>>>> Thanks jen
>>>>
>>>> So I Need To do Something Like below Myself no request or interface
>>>> exist
>>>> ??
>>>>
>>>>
>>>> int__cdecl DumpDumpHeader(void) {
>>>>
>>>> HRESULT status = S_OK;
>>>>
>>>> PMINIDUMP_HEADER MiniHeader;
>>>>
>>>> FILE * fp;
>>>>
>>>> size_t result;
>>>>
>>>> if (( fp = fopen(
>>>>
>>>> “test.dmp”,
>>>>
>>>> “rb”
>>>>
>>>> ) ) == 0 ) {
>>>>
>>>> Exit (
>>>>
>>>> FALSE,
>>>>
>>>> “fopen ( %s ) Failed”,
>>>>
>>>> “test.dmp”
>>>>
>>>> );
>>>>
>>>> }
>>>>
>>>> if (( result = fread(
>>>>
>>>> Buff,
>>>>
>>>> 1,
>>>>
>>>> sizeof(MINIDUMP_HEADER),
>>>>
>>>> fp
>>>>
>>>> ) ) != sizeof(MINIDUMP_HEADER)) {
>>>>
>>>> Exit(
>>>>
>>>> FALSE,
>>>>
>>>> “fread(fp) failed\n”
>>>>
>>>> );
>>>>
>>>> }
>>>>
>>>> MiniHeader = (PMINIDUMP_HEADER)Buff;
>>>>
>>>> printf(
>>>>
>>>> “Minidump Header Signature = %08x\n”
>>>>
>>>> “MINIDUMP_VERSION = %08x\n”
>>>>
>>>> “MINIDUMP_VERSION(Internal) = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER NumberofStreams = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER StreamDirectoryRVA = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER CheckSum = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER reserved = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER TimeDateStamp = %08x\n”
>>>>
>>>> “MINIDUMP_HEADER Flags = %08x\n”,
>>>>
>>>> MiniHeader->Signature,
>>>>
>>>> LOWORD(MiniHeader->Version),
>>>>
>>>> HIWORD(MiniHeader->Version),
>>>>
>>>> MiniHeader->NumberOfStreams,
>>>>
>>>> MiniHeader->StreamDirectoryRva,
>>>>
>>>> MiniHeader->CheckSum,
>>>>
>>>> MiniHeader->Reserved,
>>>>
>>>> MiniHeader->TimeDateStamp,
>>>>
>>>> MiniHeader->Flags
>>>>
>>>> );
>>>>
>>>> fclose(fp);
>>>>
>>>> return status;
>>>>
>>>> }
>>>>
>>>> -====Dumping DumpHeader From Memory Dump====-
>>>>
>>>> Minidump Header Signature = 504d444d
>>>> MINIDUMP_VERSION = 0000a793
>>>> MINIDUMP_VERSION(Internal) = 00006003
>>>> MINIDUMP_HEADER NumberofStreams = 00000008
>>>> MINIDUMP_HEADER StreamDirectoryRVA = 00000020
>>>> MINIDUMP_HEADER CheckSum = 00000000
>>>> MINIDUMP_HEADER reserved = 4f70c8f0
>>>> MINIDUMP_HEADER TimeDateStamp = 4f70c8f0
>>>> MINIDUMP_HEADER Flags = 00000021
>>>> Dump Header Dumped
>>>>
>>>>
>>>> ----- User Mini Dump Analysis
>>>>
>>>> MINIDUMP_HEADER:
>>>> Version A793 (6003)
>>>> NumberOfStreams 8
>>>> Flags 21
>>>> 0001 MiniDumpWithDataSegs
>>>> 0020 MiniDumpWithUnloadedModules
>>>>
>>>>
>>>>
>>>>
>>>> On 5/2/12, Jen-Lung Chiu wrote:
>>>>> You could check MSDN or dbghelp.h for user-mode minidump format, then
>>>>> use binary editor to browse the dump file.
>>>>>
>>>>> The user-mode minidump starts with a MINIDUMP_HEADER structure, then
>>>>> follows a list of MINIDUMP_DIRECTORY structure (the number of
>>>>> MINIDUMP_DIRECTORY structures is MINIDUMP_HEADER::NumberOfStreams).
>>>>> The MINIDUMP_DIRECTORY block defines the type of the stream (in your
>>>>> case, MemoryListStream) as well as the RVA/size of the stream.
>>>>>
>>>>> -----Original Message-----
>>>>> From: xxxxx@lists.osr.com
>>>>> [mailto:xxxxx@lists.osr.com] On Behalf Of raj_r
>>>>> Sent: Wednesday, May 2, 2012 02:42 AM
>>>>> To: Kernel Debugging Interest List
>>>>> Subject: Re: [windbg] Error when reading user stream from dump file
>>>>>
>>>>> ok changing the ULONG64 of Debughelp.chm to DWORD of Debughelp.h it
>>>>> seems now i can dump the MemoryListStream below is code and output
>>>>> Dissections are Welcome
>>>>>
>>>>> #include <stdio.h>
>>>>>
>>>>> #include <engextcpp.hpp>
>>>>>
>>>>> #include <dbghelp.h>
>>>>>
>>>>> const ULONG MBUFFSIZE = 0x1000;
>>>>>
>>>>> IDebugClient* g_Client;
>>>>>
>>>>> IDebugControl* g_Control;
>>>>>
>>>>> IDebugAdvanced2* g_Advanced2;
>>>>>
>>>>> PVOID Buff;
>>>>>
>>>>> void
>>>>>
>>>>> Exit( in int Code,
>>>>>
>>>>> in PCSTR Format,
>>>>>
>>>>> …)
>>>>>
>>>>> {
>>>>>
>>>>> if (g_Client != NULL) {
>>>>>
>>>>> g_Client->EndSession(DEBUG_END_DISCONNECT);
>>>>>
>>>>> g_Client->Release();
>>>>>
>>>>> g_Client = NULL;
>>>>>
>>>>> }
>>>>>
>>>>> if (g_Control != NULL) {
>>>>>
>>>>> g_Control->Release();
>>>>>
>>>>> g_Control = NULL;
>>>>>
>>>>> }
>>>>>
>>>>> if (g_Advanced2 !=NULL) {
>>>>>
>>>>> g_Advanced2->Release();
>>>>>
>>>>> g_Advanced2 = NULL;
>>>>>
>>>>> }
>>>>>
>>>>> if( Buff != NULL) {
>>>>>
>>>>> free(Buff);
>>>>>
>>>>> }
>>>>>
>>>>> if (Format != NULL) {
>>>>>
>>>>> va_list Args;
>>>>>
>>>>> va_start(Args, Format);
>>>>>
>>>>> vfprintf(stderr, Format, Args);
>>>>>
>>>>> va_end(Args);
>>>>>
>>>>> }
>>>>>
>>>>> exit(Code);
>>>>>
>>>>> }
>>>>>
>>>>> int __cdecl DumpMemoryListStream(void){
>>>>>
>>>>> HRESULT status;
>>>>>
>>>>> if ( ( status = DebugCreate(
>>>>>
>>>>>__uuidof(IDebugClient),
>>>>>
>>>>> (void**)&g_Client
>>>>>
>>>>> ) ) !=S_OK) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s ( %s ) Failed %08x\n”,
>>>>>
>>>>> “DebugCreate”,
>>>>>
>>>>> “IDebugClient”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> if ( ( status = g_Client->QueryInterface(
>>>>>
>>>>> __uuidof(IDebugControl),
>>>>>
>>>>> (void**)&g_Control
>>>>>
>>>>> ) ) != S_OK ) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s ( %s ) Failed %08x\n”,
>>>>>
>>>>> “QueryInterface”,
>>>>>
>>>>> “IDebugControl”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> if ( ( status = g_Client->QueryInterface(
>>>>>
>>>>>__uuidof(IDebugAdvanced2),
>>>>>
>>>>> (void**)&g_Advanced2
>>>>>
>>>>> )) != S_OK ) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s ( %s ) Failed %08x\n”,
>>>>>
>>>>> “QueryInterface”,
>>>>>
>>>>> “IDebugAdvanced2”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> if (( status = g_Client->OpenDumpFile(
>>>>>
>>>>> “test.dmp”
>>>>>
>>>>> )) != S_OK ) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s ( %s ) Failed %08x\n”,
>>>>>
>>>>> “g_Client”,
>>>>>
>>>>> “OpenDumpFile”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> if (( status = g_Control->WaitForEvent(
>>>>>
>>>>> 0,
>>>>>
>>>>> INFINITE
>>>>>
>>>>> ) ) != S_OK ) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s ( %s ) Failed %08x\n”,
>>>>>
>>>>> “g_Control”,
>>>>>
>>>>> “WaitForEvent”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> PVOID OutBuffer;
>>>>>
>>>>> ULONG OutBufferSize;
>>>>>
>>>>> ULONG OutSize;
>>>>>
>>>>> PMINIDUMP_MEMORY_LIST mml;
>>>>>
>>>>> DEBUG_READ_USER_MINIDUMP_STREAM InBuffer;
>>>>>
>>>>> InBuffer.StreamType = MemoryListStream;
>>>>>
>>>>> InBuffer.Flags = 0;
>>>>>
>>>>> InBuffer.Offset = 0;
>>>>>
>>>>> InBuffer.Buffer = Buff;
>>>>>
>>>>> InBuffer.BufferSize = MBUFFSIZE;
>>>>>
>>>>> InBuffer.BufferUsed = 0;
>>>>>
>>>>> OutBuffer = NULL;
>>>>>
>>>>> OutBufferSize = NULL;
>>>>>
>>>>> if (( status = g_Advanced2->Request(
>>>>>
>>>>> DEBUG_REQUEST_READ_USER_MINIDUMP_STREAM,
>>>>>
>>>>> &InBuffer,
>>>>>
>>>>> sizeof(InBuffer),
>>>>>
>>>>> OutBuffer,
>>>>>
>>>>> OutBufferSize,
>>>>>
>>>>> &OutSize
>>>>>
>>>>> ) ) != S_OK ) {
>>>>>
>>>>> Exit(
>>>>>
>>>>> FALSE,
>>>>>
>>>>> “%s (\n”
>>>>>
>>>>> “\t%s,\n”
>>>>>
>>>>> “\t%s\n\t) Failed %08x\n”,
>>>>>
>>>>> “g_Advanced2->Request”,
>>>>>
>>>>> “DEBUG_REQUEST_READ_USER_MINIDUMP_STREAM”,
>>>>>
>>>>> “MemoryListStream”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> mml = (PMINIDUMP_MEMORY_LIST)Buff;
>>>>>
>>>>> printf (
>>>>>
>>>>> " Number Of Memory ranges = %x\n\n"
>>>>>
>>>>> " range# RVA Address Size\n",
>>>>>
>>>>> mml->NumberOfMemoryRanges
>>>>>
>>>>> );
>>>>>
>>>>> for (ULONG i = 0; iNumberOfMemoryRanges;i++) {
>>>>>
>>>>> printf(
>>>>>
>>>>> " %d %08x %08I64x %08x\n",
>>>>>
>>>>> i,
>>>>>
>>>>> mml->MemoryRanges[i].Memory.Rva,
>>>>>
>>>>> mml->MemoryRanges[i].StartOfMemoryRange,
>>>>>
>>>>> mml->MemoryRanges[i].Memory.DataSize
>>>>>
>>>>> );
>>>>>
>>>>> }
>>>>>
>>>>> Exit(
>>>>>
>>>>> TRUE,
>>>>>
>>>>> “%s (\n”
>>>>>
>>>>> “\t%s,\n”
>>>>>
>>>>> “\t%s\n\t) Succeeded %08x\n”,
>>>>>
>>>>> “g_Advanced2->Request”,
>>>>>
>>>>> “DEBUG_REQUEST_READ_USER_MINIDUMP_STREAM”,
>>>>>
>>>>> “MemoryListStream”,
>>>>>
>>>>> status);
>>>>>
>>>>> }
>>>>>
>>>>> int __cdecl main (void){
>>>>>
>>>>> Buff = (PVOID) malloc( MBUFFSIZE );
>>>>>
>>>>> if(Buff == 0) {
>>>>>
>>>>> printf(
>>>>>
>>>>> “malloc failed\n”
>>>>>
>>>>> );
>>>>>
>>>>> Exit ( FALSE,“malloc Failed \n”);
>>>>>
>>>>> }
>>>>>
>>>>> printf(“\n\n -====Dumping MemoryListStream From Memory
>>>>> Dump====-\n\n”);
>>>>>
>>>>> DumpMemoryListStream();
>>>>>
>>>>> }
>>>>>
>>>>> t>OpenDumpStream.exe
>>>>>
>>>>>
>>>>> -====Dumping MemoryListStream From Memory Dump====-
>>>>>
>>>>> Number Of Memory ranges = 9
>>>>>
>>>>> range# RVA Address Size
>>>>> 0 00004958 0007df4c 000020b4
>>>>> 1 00006a0c 7c90e494 00000100
>>>>> 2 00006b0c 00ccff98 00000068
>>>>> 3 00006b74 7c90e494 00000100
>>>>> 4 00006c74 00f1bcac 00004354
>>>>> 5 0000afc8 7c90e494 00000100
>>>>> 6 0000b0c8 009cfe14 000001ec
>>>>> 7 0000b2b4 7c90e494 00000100
>>>>> 8 0000b3b4 00447000 000165a8
>>>>> g_Advanced2->Request (
>>>>> DEBUG_REQUEST_READ_USER_MINIDUMP_STREAM,
>>>>> MemoryListStream
>>>>> ) Succeeded 00000000
>>>>>
>>>>> same dmp checked via dumpchk util
>>>>> Stream 3: type MemoryListStream (5), size 00000094, RVA 000048C4
>>>>> 9 memory ranges
>>>>> range# RVA Address Size
>>>>> 0 00004958 0007df4c 000020b4
>>>>> 1 00006A0C 7c90e494 00000100
>>>>> 2 00006B0C 00ccff98 00000068
>>>>> 3 00006B74 7c90e494 00000100
>>>>> 4 00006C74 00f1bcac 00004354
>>>>> 5 0000AFC8 7c90e494 00000100
>>>>> 6 0000B0C8 009cfe14 000001ec
>>>>> 7 0000B2B4 7c90e494 00000100
>>>>> 8 0000B3B4 00447000 000165a8
>>>>> Total memory: 1d004
>>>>>
>>>>> one question remains
>>>>> Stream 3: type MemoryListStream (5), size 00000094, RVA 000048C4 i can
>>>>> get the 94 from outsize 1d004 from adding up all sizes what should i
>>>>> use to get the rva 48c4 ?
>>>>>
>>>>> On 5/2/12, raj_r wrote:
>>>>>> note to self
>>>>>> when in doubt refer header file do not refer chm or web or random
>>>>>> tidbits in obscure corners of internet
>>>>>>
>>>>>> this seem to be a documentation glitch in debugger.chm
>>>>>>
>>>>>> in debughelp.h it is dword
>>>>>>
>>>>>> typedef DWORD RVA;
>>>>>> typedef ULONG64 RVA64;
>>>>>>
>>>>>> typedef struct _MINIDUMP_LOCATION_DESCRIPTOR {
>>>>>> ULONG32 DataSize;
>>>>>> RVA Rva;
>>>>>> } MINIDUMP_LOCATION_DESCRIPTOR;
>>>>>>
>>>>>> typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 {
>>>>>> ULONG64 DataSize;
>>>>>> RVA64 Rva;
>>>>>> } MINIDUMP_LOCATION_DESCRIPTOR64;
>>>>>>
>>>>>> On 5/2/12, raj_r wrote:
>>>>>>> Thanks Tim
>>>>>>>
>>>>>>> you wrote
>>>>>>> MINIDUMP_LOCATION_DESCRIPTOR. The MINIDUMP_LOCATION_DESCRIPTOR has
>>>>>>> 32-bit size and 32-bit RVA,
>>>>>>>
>>>>>>> the debughelp.chm has this
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> MINIDUMP_LOCATION_DESCRIPTOR Structure
>>>>>>>
>>>>>>> Contains information describing the location of a data stream within
>>>>>>> a minidump file.
>>>>>>>
>>>>>>>
>>>>>>> typedef struct _MINIDUMP_LOCATION_DESCRIPTOR { ULONG64 DataSize;
>>>>>>> RVA64 Rva; } MINIDUMP_LOCATION_DESCRIPTOR; Members DataSize The size
>>>>>>> of the data stream, in bytes.
>>>>>>>
>>>>>>> Rva
>>>>>>> The relative virtual address (RVA) of the data. This is the byte
>>>>>>> offset of the data stream from the beginning of the minidump file.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 5/2/12, Tim Roberts wrote:
>>>>>>>> raj_r wrote:
>>>>>>>>> not exactly related to ops question but it is regarding request of
>>>>>>>>> streamtype MemoryListStream …
>>>>>>>>> 00681438 00000009 0007df4c 00000000 000020b4
>>>>>>>>> 00681448 00004958 7c90e494 00000000 00000100
>>>>>>>>> 00681458 baadf00d baadf00d baadf00d baadf00d
>>>>>>>>>
>>>>>>>>> i understand the first dword 9 is NumberofMemoryRanges
>>>>>>>>>
>>>>>>>>> does the second QWORD7df4c point to
>>>>>>>>> MemoryRanges[0].StartofMemoryRange
>>>>>>>>> ??
>>>>>>>>> and subsequent dwords point to …Datasize and … RVA ??
>>>>>>>>
>>>>>>>> They don’t POINT to those things. They CONTAIN those things. The
>>>>>>>> MINIDUMP_MEMORY_LIST has a DWORD with the number of ranges,
>>>>>>>> followed by an array of MINIDUMP_MEMORY_DESCRIPTOR. The
>>>>>>>> MINIDUMP_MEMORY_DESCRIPTOR has a 64-bit start of range, followed by
>>>>>>>> a MINIDUMP_LOCATION_DESCRIPTOR. The MINIDUMP_LOCATION_DESCRIPTOR
>>>>>>>> has 32-bit size and 32-bit RVA,
>>>>>>>>
>>>>>>>>> these seem to described as ULONG 64 in dbghelp.chm but windbg
>>>>>>>>> doesnt seem to honor it
>>>>>>>>>
>>>>>>>>> 0:000> dt -r OpenDumpStream!_MINIDUMP_MEMORY_LIST 0x00681438
>>>>>>>>> +0x000 NumberOfMemoryRanges : 9
>>>>>>>>> +0x004 MemoryRanges : [0] _MINIDUMP_MEMORY_DESCRIPTOR
>>>>>>>>> +0x000 StartOfMemoryRange : 0x7df4c
>>>>>>>>> +0x008 Memory : MINIDUMP_LOCATION_DESCRIPTOR
>>>>>>>>> +0x000 DataSize : 0x20b4
>>>>>>>>> +0x004 Rva : 0x4958
>>>>>>>>>
>>>>>>>>> see the +4
>>>>>>>>
>>>>>>>> Those are correct. StartOfMemoryRange is 64-bit.
>>>>>>>> NumberOfMemoryRanges,
>>>>>>>> DataSize, and Rva are all 32-bit.
>>>>>>>>
>>>>>>>>> if i print it to scree with
>>>>>>>>>
>>>>>>>>> printf(
>>>>>>>>> “Number of memory range = %08x\t\n”
>>>>>>>>> “Start of Memory Range Is %I64x\t\n”
>>>>>>>>> “Data Size is %I64x\t\n”
>>>>>>>>> “Rva is %I64x\t\n”,
>>>>>>>>> mml->NumberOfMemoryRanges,
>>>>>>>>> mml->MemoryRanges[0].StartOfMemoryRange,
>>>>>>>>> mml->MemoryRanges[0].Memory.DataSize,
>>>>>>>>> mml->MemoryRanges[0].Memory.Rva
>>>>>>>>>
>>>>>>>>> );
>>>>>>>>
>>>>>>>> “Data Size” and “Rva” should both be %08x.
>>>>>>>>
>>>>>>>> –
>>>>>>>> Tim Roberts, xxxxx@probo.com
>>>>>>>> Providenza & Boekelheide, Inc.
>>>>>>>>
>>>>>>>>
>>>>>>>> —
>>>>>>>> WINDBG is sponsored by OSR
>>>>>>>>
>>>>>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>>>>>> http://www.osr.com/seminars
>>>>>>>>
>>>>>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>>>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>> —
>>>>> WINDBG is sponsored by OSR
>>>>>
>>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>>> http://www.osr.com/seminars
>>>>>
>>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>>
>>>>>
>>>>>
>>>>> —
>>>>> WINDBG is sponsored by OSR
>>>>>
>>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>>> http://www.osr.com/seminars
>>>>>
>>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>>
>>>>
>>>> —
>>>> WINDBG is sponsored by OSR
>>>>
>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>> http://www.osr.com/seminars
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>
>>>>
>>>>
>>>> —
>>>> WINDBG is sponsored by OSR
>>>>
>>>> For our schedule of WDF, WDM, debugging and other seminars visit:
>>>> http://www.osr.com/seminars
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>>
>>>
>>
>> —
>> WINDBG is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></dbghelp.h></engextcpp.hpp></stdio.h>