From: Viktor Prutyanov <viktor@daynix.com>
To: annie.li@oracle.com, akihiko.odaki@daynix.com, kkostiuk@redhat.com
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, yan@daynix.com,
viktor@daynix.com, viktor.prutyanov@phystech.edu
Subject: [PATCH 5/5] elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining
Date: Thu, 14 Sep 2023 01:46:57 +0300 [thread overview]
Message-ID: <20230913224657.11606-6-viktor@daynix.com> (raw)
In-Reply-To: <20230913224657.11606-1-viktor@daynix.com>
PDB for Windows 11 kernel has slightly different structure compared to
previous versions. Since elf2dmp don't use the other fields, copy only
'segments' field from PDB_STREAM_INDEXES.
Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
---
contrib/elf2dmp/pdb.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c
index adcfa7e154..2ef873b13e 100644
--- a/contrib/elf2dmp/pdb.c
+++ b/contrib/elf2dmp/pdb.c
@@ -188,15 +188,11 @@ static int pdb_init_symbols(struct pdb_reader *r)
r->symbols = symbols;
- if (symbols->stream_index_size != sizeof(PDB_STREAM_INDEXES)) {
- err = 1;
- goto out_symbols;
- }
-
- memcpy(sidx, (const char *)symbols + sizeof(PDB_SYMBOLS) +
+ sidx->segments = *(uint16_t *)((const char *)symbols + sizeof(PDB_SYMBOLS) +
symbols->module_size + symbols->offset_size +
symbols->hash_size + symbols->srcmodule_size +
- symbols->pdbimport_size + symbols->unknown2_size, sizeof(*sidx));
+ symbols->pdbimport_size + symbols->unknown2_size +
+ offsetof(PDB_STREAM_INDEXES, segments));
/* Read global symbol table */
r->modimage = pdb_ds_read_file(r, symbols->gsym_file);
--
2.21.0
next prev parent reply other threads:[~2023-09-13 22:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 22:46 [PATCH 0/5] elf2dmp: improve Win2022, Win11 and large dumps Viktor Prutyanov
2023-09-13 22:46 ` [PATCH 1/5] elf2dmp: replace PE export name check with PDB name check Viktor Prutyanov
2023-09-13 22:46 ` [PATCH 2/5] elf2dmp: introduce physical block alignment Viktor Prutyanov
2023-09-13 22:46 ` [PATCH 3/5] elf2dmp: introduce merging of physical memory runs Viktor Prutyanov
2023-09-14 7:45 ` Akihiko Odaki
2023-09-13 22:46 ` [PATCH 4/5] elf2dmp: use Linux mmap with MAP_NORESERVE when possible Viktor Prutyanov
2023-09-14 7:42 ` Akihiko Odaki
2023-09-15 16:55 ` Viktor Prutyanov
2023-09-13 22:46 ` Viktor Prutyanov [this message]
2023-09-14 7:53 ` [PATCH 5/5] elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230913224657.11606-6-viktor@daynix.com \
--to=viktor@daynix.com \
--cc=akihiko.odaki@daynix.com \
--cc=annie.li@oracle.com \
--cc=kkostiuk@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=viktor.prutyanov@phystech.edu \
--cc=yan@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).