Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I have a function (64 bit machine) which has 3 bytes of 3E
in the middle, this prevent me from using uf
to disassemble the function , windbg can partially disassemble the function , but stopped at the beginning of the 3 bytes of 3E and report the error of Flow analysis was incomplete, some code may be missing
.
I have consulted the x86 reference manual , found that 3E
is an instruction prefix.
Any suggestion? Many thanks!
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Internals & Software Drivers | 19-23 June 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Comments
I can't speak to whether or not a bunch of 3Es is valid, but uf is pretty simple and doesn't handle a lot of things. What does u decode the instructions as?
-scott
OSR
no.
u
command does not work. I can set a break point at the first3E
and continue with at
command, windbg will skip the remaining 23E
s and stop at the instruction right after the last 23E
s.What's the output of u?
-scott
OSR
3E is the "branch usually taken" prefix. The behavior of multiple prefixes of a single type is undefined; the various processors handle that case differently, so it's never supposed to be done. Oddly, the 3E prefix is in the same type as the segment overrides, so you can't have a 3E plus a segment override.
How did you get this? The compilers shouldn't produce that kind of code.
And, as a side note, it isn't windbg that is skipping the remaining prefixes. Windbg just tells the CPU "go execute one instruction and interrupt". It's up to the CPU to decide where the next instruction is.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
u 00007ff7`909b6acf l4
it is in fact a function in Excel
I'm going to guess that's a hook for code to be patched in at runtime. You don't use a "branch usually taken" prefix with an
lea
instruction.Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
So, to answer the original question: The WinDbg disassembler doesn't understand that sequence and uf stops when it gets to something it doesn't understand.
-scott
OSR
yes. this is not the problem of windbg. I'm curious why this function behaves like this.