vitoplantamura / BugChecker

SoftICE-like kernel debugger for Windows 11
GNU Lesser General Public License v2.1
928 stars 126 forks source link

BcRelease is empty #5

Open zwclose opened 1 year ago

zwclose commented 1 year ago

Hey,

The output directory is empty, no executables there. Did you plan publish them?

Also, I have a question related to floating point operations in QuickJS. Floating point operations require some special handling in kernel mode and I didn't find anything like that in the project. Did I miss something or you just don't trigger FP code paths?

Thanks!

zwclose commented 1 year ago

Ah, "Before calling QuickJS, BugChecker saves the FPU state (on x86) and switches to an expanded stack of 128KB." -- this solves the mystery of FPU. Yet it would be nice to have drivers compiled :)

vitoplantamura commented 1 year ago

hi,

if you are interested in how BugChecker handles the FPU state in kernel mode, search for the "SaveFPUState" class in the project.

The pre-built binaries of BC are available here: https://github.com/vitoplantamura/BugChecker/releases

If you want to compile the driver yourself, please follow the instructions in the "Build Instructions" section of the main README.md file.

--Vito

zwclose commented 1 year ago

Hi,

Thanks for the answers. I have a one more question if you don't mind.

How did you link a few CRT functions like floor, ceil and those that use FILE operations to BugChecker.sys? I edit the project to make it compilable from Visual Studio to get rid of old DDK requirement and it seems to be the last obstacle that I have. By the way, I can PR it once make sure it works.

vitoplantamura commented 1 year ago

hi,

all the projects (including the main sys driver) compile and link correctly if you follow precisely the instructions in the main README.md.

If you are curious about how some CRT functions (like the ones you mention) are made available to QuickJS, take a look at the "QuickJSDeclFill.h" file. Essentially all the calls are intercepted through a series of #define; for example "fabs" is replaced with "_bc_fabs" in the QuickJS code. Then BugChecker defines the "_bc_fabs" function.

Some (essential -i.e. "essential" for the functioning of QuickJS-) functions are reimplemented (like "_bc_fabs") while some other (non-essential) functions call the "NOT_IMPLEMENTED" function defined by BugChecker, which records all the not implemented function calls and displays them to the user in the BugChecker UI (for debug purposes). Search for these function names in the source code to get a better understanding of how the whole thing works.

--Vito

On Wed, Jun 21, 2023, 16:52 zwclose @.***> wrote:

Hi,

Thanks for the answers. I have a one more question if you don't mind.

How did you link a few CRT functions like floor, ceil and those that use FILE operations to BugChecker.sys? I edit the project to make it compilable from Visual Studio to get rid of old DDK requirement and it seems to be the last obstacle that I have. By the way, I can PR it once make sure it works.

— Reply to this email directly, view it on GitHub https://github.com/vitoplantamura/BugChecker/issues/5#issuecomment-1600988773, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI2JIRENODWM5JXFQMFS6CDXMMDELANCNFSM6AAAAAAZMLUZZY . You are receiving this because you commented.Message ID: @.***>

zwclose commented 1 year ago

Cool, got it!