Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:10:26+00:00 2026-06-06T03:10:26+00:00

For a test ‘crash’ I need a small piece of Delphi code to see

  • 0

For a test ‘crash’ I need a small piece of Delphi code to see how the operating system logs the DEP violation in the event log.

I have found many sources around activating DEP but not about how to ‘trigger’ a DEP violation.

Do you have an example?


Related question: https://serverfault.com/questions/130716/if-dep-has-stopped-an-app-is-there-a-possibility-to-see-this-events-in-a-log

Shows how a DEP vialotion should look like in the log

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:10:29+00:00Added an answer on June 6, 2026 at 3:10 am

    This code gets the job done:

    procedure DoJump(Address: Pointer);
    asm
      JMP    Address
    end;
    
    const
      X: Byte=$C3;//RET op code
    
    procedure TriggerDEP;
    begin
      DoJump(@X);
    end;
    

    In the generated executable, the location where X is stored is treated as data. As an alternative you could try executing code located on the stack:

    procedure DoJump(Address: Pointer);
    asm
      JMP    Address
    end;
    
    procedure TriggerDEP;
    var
      X: Byte;
    begin
      X := $C3;
      DoJump(@X);
    end;
    

    Both of these raise access violation exceptions when DEP is active.

    If you need to make sure that DEP is active, for example from a 32 bit process where it is optional, call this function:

    procedure EnableDEP;
    const
      PROCESS_DEP_ENABLE: DWORD=$00000001;
    var
      SetProcessDEPPolicy: function(dwFlags: DWORD): BOOL; stdcall;
    begin
      SetProcessDEPPolicy := GetProcAddress(GetModuleHandle(kernel32), 'SetProcessDEPPolicy');
      if Assigned(SetProcessDEPPolicy) then begin
        SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TEST SITE Look here to see code in action I have two arrays which
To test an in app purchase on the iphone, do I need to upload
-------test code(test.html)------------ <!DOCTYPE html> <html> <head> <style> *{padding:0px;margin:0px;} </style> </head> <body style=background-color:orange;> <b onmousemove=tip(this);>A</b>
Test string: the%20matrix%20 How can I delete the last three chars? Using this code
Test.xml: <?xml version=1.0 encoding=UTF-8?> <node>line1 line2 line3</node> CF code: <cfset xmlfile = ExpandPath(test.xml)> <cffile
Test the following code: #include <stdio.h> #include <stdlib.h> main() { const char *yytext=0; const
test.php code: $path = 'audio.mp3'; header(Content-type: audio/mpeg); header('Content-Transfer-Encoding: binary'); header('Content-Disposition: inline; filename='.$path.''); header(Content-length: .filesize($path));
Test if the image I am about to grab using code is visible to
test.php code: $fileloc = 'audio.mp3'; header('Content-type: audio/mpeg'); header(Content-disposition: inline; filename=$filename); header('Content-Length:'.filesize($fileloc)); readfile($fileloc); html code:
Test in some json code, like [{a:1},{a:2},{a:3},{b:2}] , I want use json decode, get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.