Giter Club home page Giter Club logo

hooks-made-easy's Introduction

Delphi Hooks-Made-Easy

A re-release of updated code originally written some 20 years ago.

Basics

Keep in mind that in some cases both a 32 and 64 bit version of a DLL are required.

DLL code

Projects will compile in Delphi XE2 and up. XE2 was chosen since it will compile for both 32 and 64 bit with a small binary footprint.

Test Code and Manifests

A manifest file is supplied for Delphi Berlin which includes 'uiAccess'. Newer IDEs have this option built in. Debugging is best done with a manifest that does not include 'uiAccess'. 'LinkManifests.cmd' will generate symbolic links to the supplied manifest.

Code Signing

As of Windows 10.1903.18362.295 a Sandbox VM allowed debug testing without code signing.

Deployment

Best to change the DLL name, change the Mapfile Filename and follow these steps:

  • uiAccess="true"
  • Code MUST be digitally signed
  • Your application MUST reside in a trusted location (e.g.; Program Files)

Without this hooking a 'uiAccess' app will fail and possibly lock your App.

HooksMadeEasy.Journal

Recording and playback of a Journal hook. The code can reside inside an EXE or DLL and works for both 32/64 bit without an additional version. However the way I read this is that its best to use a DLL since non native bitness apps will end up loaded your code via a thunking mechanism.

HooksMadeEasy.GetMsg

Hooks all messages posted via PostMessage, best is to refine what you need to watch and let the rest flow through. The current demo simply posts a message back to the original App when a System Menu is clicked.

HooksMadeEasy.Keyboard

Hooks all GetMessage or PeekMessage functions when there is a keyboard message (WM_KEYUP or WM_KEYDOWN) to be processed. The current demo simply posts a message back to the original App when ALT+Numkey_1 is used.

Inject API

Injects the DLL into a process using its PID, where a DDetours call essentially redirects an API.
This method could use a Hook process specific to a single process to lessen the load on the system.
Easiest Way to Test:

  • Run two instances (same bitness)
  • Copy the PID from the first to the second instances
  • Attach to the first from the second instances
  • Try to terminate the first instance

Requires: Delphi Detours Library

See Also

hooks-made-easy's People

Contributors

fschetterer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.