nstarke / bootfuzz

A MBR Fuzzer
MIT License
28 stars 2 forks source link

Bug: Pushing and popping in the wrong order #1

Closed sa3mlk closed 6 months ago

sa3mlk commented 6 months ago

In the function read_keyboard, the registers are popped in the reverse order of how they were pushed, is that intentional?

Here is how the corrected function should look with the right push and pop order for preserving the register values correctly:

read_keyboard:
    push bx
    push cx
    push dx
    push si
    push di
    mov ah, 0x0
    int 0x16
    pop di
    pop si
    pop dx
    pop cx
    pop bx
    ret
nstarke commented 6 months ago

Thanks for the report! I have pushed a fix. Let me know if you see anything else!