Code Monkey home page Code Monkey logo

inline-hooks-on-windows's Introduction

simple-inline-hooks

Inline hooks on some winsock's library funcions. It was tested on Windows 7 x86.

Injector - the program which creates target process(SimpleWS) then loads to it apropriate dll (hook.dll).

SimpleWS - very basic (base functionality, no error checking) tcp server, which creates socket, bind it on 3490 port, and then listens for connection. Affter the client is connected it sends to it 'Hello World' message, and waits in loop for any data.

Hook - the dll that consists of functions which are the hooks on winsock's functions.

Hooks are created on following functions:

  • socket,
  • accept,
  • listen,
  • bind,
  • send,
  • recv,

Hooking scheme (dll responsibility):

1 - create trampoline, which is simple jump into-our controlled function. The function must have apropriate address so example trampoline may be defined as:

mov eax, 0xDEADC0DE ; when loading library, this address will be replaced with &tramp_func
jmp eax 

2 - in trampoline do what you need. For example process arguments for hooked function, or prepare env that the return address will be controlled by you. If you want to jump into hooked function (e.g. original socket()) do not forget about executing instructions that was overrided.

3 - return to calle.

All programs including dll are in very basic for, so if any error occurs, you must debug it by yourself :)

Enjoy :)

inline-hooks-on-windows's People

Stargazers

 avatar Patryk B avatar caiyesd avatar

Watchers

James Cloos avatar Patryk B 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.