Skip to content

Instantly share code, notes, and snippets.

@KiFilterFiberContext
Created May 2, 2020 01:09
Show Gist options
  • Save KiFilterFiberContext/a115da4146a4e4557a12d142a2e1059d to your computer and use it in GitHub Desktop.
Save KiFilterFiberContext/a115da4146a4e4557a12d142a2e1059d to your computer and use it in GitHub Desktop.
bsod mod
use crate::*;
use winapi::shared::{
ntdef::{NTSTATUS, ULONG, PUNICODE_STRING, PVOID, PULONG, BOOLEAN, PBOOLEAN, TRUE, FALSE},
ntstatus::STATUS_ASSERTION_FAILURE
};
#[link(name = "ntdll")]
extern "stdcall" {
fn RtlAdjustPrivilege(
privilage: ULONG,
enable_priv: BOOLEAN,
is_thr_priv: BOOLEAN,
prev_value: PBOOLEAN
) -> NTSTATUS;
fn NtRaiseHardError(
error_status: NTSTATUS,
param_len: ULONG,
USPM: PUNICODE_STRING,
params: PVOID,
resp_option: ULONG,
resp: PULONG
) -> NTSTATUS;
}
pub fn title_hook(p_this: *mut c_void) -> *const c_char {
cstr!("BSOD Mod by Blaze")
}
pub fn reset_hook(p_this: *mut play_layer::PlayLayer) {
unsafe {
let mut bl: BOOLEAN = mem::zeroed();
RtlAdjustPrivilege(19, TRUE, FALSE, &mut bl as *mut _);
let mut res: ULONG = mem::zeroed();
NtRaiseHardError(STATUS_ASSERTION_FAILURE, 0, null_mut(), null_mut(), 6, &mut res as *mut _);
ResetHook.call(p_this) // pretty much obsolete call
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment