(C) NtDelayExecution by Kyle Cucci (d4rksystem)

Created the Saturday 17 August 2024. Updated 4 weeks, 2 days ago.

Description:

The following code snippet demonstrates two methods for introducing delays in a Windows environment. The first method uses NtDelayExecution, while the second employs the Beep function.

Code

            int main() {
    
    bool alertable = 0; // Thread alertable state. 0 = thread cannot cannot break on call to NtAlertThread.
    int duration = 60000; // Duration of the delay in milliseconds

    NtDelayExecution(alertable, duration)
    return 0;
}

// ---

int main() {
    
    int frequency = 0; // Frequency of the beep in hertz (this will likely be "0" if the malware doesn't actually want to invoke the beep sound!)
    int duration = 60000; // Duration of the beep in milliseconds

    Beep(frequency, duration)
    return 0;
}