mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.8K
active users

#windbg

0 posts0 participants0 posts today
Look at this gem I just found:

Using WinDbg Over KDNet on QEMU-KVM

https://www.osr.com/blog/2021/10/05/using-windbg-over-kdnet-on-qemu-kvm/

"The enlightenments that are enabled by default include setting the hypervisor ID to the same ID that’s reported by Microsoft Hyper-V (which is “Microsoft Hv”). [...] when the KDNet transport initializes, it checks the hypervisor ID, and if it discovers it is running under Microsoft Hyper-V [...] it attempts to open a debugger connection using an undocumented protocol over a synthetic hypervisor-owned debug device that Hyper-V provides."

I'll give this a shot tomorrow on Proxmox and I'll drink something strong if modifying the hypervisor ID actually solves my issues! :D

#windbg #reverseengineering #proxmox #kvm
OSR · Using WinDbg Over KDNet on QEMU-KVMWe spent several months working on a very intensive (and very interesting) project that required a writing a driver that was specifically intended to run on a Windows system running under QEMU-KVM …

Here’s a neat project: ttd2mdmp by Airbus CERT. It lets you create a minidump from arbitrary points in a #Windbg Time Travel Debugging (TTD) trace. 

I think this is a clever way to start exploring TTD integrations while waiting for a supported API. For example, trying out existing PE carving tools against TTD sessions. 

github.com/airbus-cert/ttd2mdm

#debugging #malwareanalysis

GitHubGitHub - airbus-cert/ttd2mdmp: Extract data of TTD trace file to a minidumpExtract data of TTD trace file to a minidump. Contribute to airbus-cert/ttd2mdmp development by creating an account on GitHub.
Continued thread

Here's a live kernel dump of a Windows system with the win32kbase_rs module loaded, opened in WinDbg. We can use the !poolused command to get an idea of memory allocations made with this new RstG pool tag.

We can see that there have been a few allocations with the RstG pool tag, totaling 368 bytes.

Note that Microsoft describes this pool tag as "GDITAG_RUST_GLOBALS". If you've got a recent enough version of WinDbg / Debugging Tools for Windows, you can find this pool tag description in amd64\triage\pooltag.txt in your debugger install location.

Here's the new Rust-related pool tag descriptions in pooltag.txt:

Rust - win32kbase_rs.sys - GDITAG_RUST
RstG - win32kbase.sys - GDITAG_RUST_GLOBALS

You can find out more about the Rust pool tag in my other thread, which looks more specifically at the Rust code: infosec.exchange/@cxiao/110366

I've been using #windbg for years (and years and years and years...), but today I decided to try #IDA Pro's "remote debugger" feature for a lark.

Either it'll be an awful experience, or I'll save years of my life copying/pasting memory addresses between VMs - we'll see!

Continued thread

7/

I generally build one of these #windbg scripts for every library I work with. My debugger instance often has 20+ of these loaded. It's such a massive productivity boost for me.

You can even go so far as to set up means by which certain scripts can automatically load when they detect certain modules loaded (e.g.: load this script if you see dwarf.dll in the module list).

Play with it... I guarantee it'll make you more productive too :)

Continued thread

6/

But the real magic happens with that "getPreferredRuntimeTypedObject" method.

When #windbg displays something (or binds a name in 'dx'), it tries to find the "runtime type" of an object (usually via v-tables or RTTI).

Scripts, however, can hook into this with a "getPreferredRuntimeTypedObject" method.

Here, this method literally just says "the runtime type of any Dwarf_Die_s" is the type "Dwarf_Die_s" **WITHIN** dwarf.dll.

Now, I get a *LOT* better experience in locals/watch magically!

Continued thread

5/

So instead I have a #windbg #JavaScript script that I've written specifically for helping me with libdwarf. I can add things to it as I'm going along live in the script editing window of WinDbg preview.

Let's take a look at one small piece of this:

A few things are familiar from the #AdventOfCode examples:

1) I associate this class with Dwarf_Die_s (typeSignatureExtension)

2) I add some properties (die_offset and tag). The implementations of those aren't important right now...

Continued thread

2/

#windbg uses a lot of libraries. Some are internal. Some are #oss.

To demonstrate this in a way you can follow, I'll talk about one of the OSS ones (so you can go build from source if you so desire).

For parsing DWARF information, we (currently) use libdwarf:

prevanders.net/dwarf.html

Since I'm often looking at Linux/Mac/etc... and the debugger, I often need to debug the debugger (including understanding what's going on in those libraries). Let's take an example...

www.prevanders.netDWARF PageDWARF Page

1/

The last few days, I've been doing a goofy solve #AdventOfCode problems using the #windbg #debugger and it's scripting and expression evaluation capabilities.

Why do I do this...? Because understanding and using some of the concepts used there can make you *massively* more productive with the debugger.

So today, I'm going to take a break and walk through a *CONCRETE* example.

Continued thread

7/

And now, it's a simple matter of projection to the "getPriority" method we just added.

Any method in a #windbg #JavaScript script can just be called via the @$scriptContents alias. It's literally the amalgamation of the namespaces of all executed scripts.

At the end, it's a simple .Sum() and we have the answer!

I'll note that there are *LOTS* of things which can be extended in #windbg with techniques like this:

- Processes
- Threads
- Modules
- Stack Frames
- Target Types
etc...

1/

Continuing on that whole #AdventOfCode using the #windbg #debugger theme: day 3!

If you were following along: day 1 entirely used a #JavaScript script and day 2 entirely used the expression evaluator without any scripting.

Today's answer (day 3) will mix both in some interesting ways!

The first thing to note here is that the scripting in #windbg allows you not only to just call functions but to extend the debugger and its types (internal and target). We'll do both here...

Continued thread

7/

So let's use this and get our answer to #AdventOfCode day 2 solely from the #windbg 'dx' EE:

Each array index of the @$guide variable is a "round" so we'll project that using .Select to the @$scoreGame method we created earlier...

Once we have the results from each individual round, we can simply .Sum() them to get the final answer.

And there it is: entirely from the expression evaluator with no "scripting" involved!