Author image

Code Injection


Code injection is a technique where you can insert code into a process and then reroute its execution to traverse through your injected custom code segment.

Working from a debugger eg. OllyDbg, we can search for “code caves”, ie. sequences of nop (or "DB 00" in Olly) instructions that are large enough to "fit" our custom code.

Alternatively we can also allocate more memory in the target process to store the code. This is what we will do in this case.

One of the best ways to inject code is via dlls, because they are meant to be loaded by multiple processes at runtime.

Compulsory ingredients:

  1. injector process - DLLInjector project - the process that will "inject" the code,
  2. the process to inject - ProcessToInject project - the...

Author image

DLL & Linking Tutorial


A DLL (.dll) or dynamic link library (or shared library for *nix connoisseurs - .so for Linux and .dylib for MAC) is a library containing code and data that can be used by multiple programs at the same time. Dlls reduce the size of the executable and the memory usage of the operating system in general, since all applications just need to refer to a single place in memory to use a function in the library (instead of each application having its own copy of it).

Dlls help with separating concerns and reasoning about your code. It also serves for separate compilation, if we change the dll then we need to compile only the dll; the application code remains unaffected and unaware of the change (in this context it resembles the PIMPL idiom). It's worth noting that dll's are a little slower compared to static libraries (which are included in the executable/process), but that speed...

Author image

English Greek Dictionary C++ Program - Serialization


C++ console implementation of an English - Greek Dictionary.

Depends on Boost serialization module which is included.

There is no Gui - everything is done in the console, for the time being.

Incomplete. There's a bug currently I've yet to correct.

The tricky aspect of this program is proper support of UTF-8 and Unicode, which is a pain beyond imagination in Windows. Despite that, I've managed to succeed (check this SO post -made by me- for this issue ), but I'm also victim of another obscure serialization error which I haven't had much time to dedicate in fixing it.

This is what it looks like. I provide a demo with some sample words.

Author image

Function Reference


My implementation of a functionRef/functionView variant. Why? I desperately wanted to know just how std::function<> works. So I scoured the tutorials, books what have you, in order to find more information and ended up creating a sort of lightweight variant of it.

The skills you need to have under your belt before attempting this tutorial are:

  1. Type erasure.
  2. callable objects
  3. std::invoke
  4. higher order functions
  5. lambda calculus - just a smattering knowledge

Based on std::function, functionRef is a non-owning wrapper for an arbitrary callable object.

Implementation notes:

  • A primary template is used to match the complete type of a callable, say void( int, int ) or int. The primary template remains an empty struct.
  • We want to differentiate the function type...

Author image

The Game of Life


Here we've designed and implemented Conway's Game of Life, game algorithm; invented by John Conway in 1970. The rules of this 0-player game (a video game playing without user input) are:

  1. Any live cell with fewer than two live neighbors dies, as if by under-population.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

The motivation for this project was to become familiar with parallel computing primarily on the CPU, but also on the GPU which utilizes the stream processing paradigm.

Usage

There are 6 different implementations:

  1. Serial
  2. Serial with OpenMP
  3. MPI
  4. MPI with OpenMP (aka Hybrid)
  5. NVidia CUDA...

Author image

Process Hacking (COD4) Tutorial


Generic Windows process hacking application. This time the victim being Call of Duty 4 (the original - 2007).

What do we mean by hacking? Hacking is gaining access to a system in a manner that was not intended by its developer.

Here we do something really very simple and easy. We will change some on screen visual values in our program.

A. We find the process' HANDLE. There are 2 ways to do this.

I. By getting the window Handle (HWND)

  1. HWND windowHandle = FindWindowW( nullptr, processName ) to get the window handle
  2. GetWindowThreadProcessId( windowHandle, &pid ) to get the pid
  3. and finally OpenProcess( PROCESS_ALL_ACCESS, false, *pid ); to get the process Handle

This is the method I use in this example.

II. By taking a...

Author image

Hooking Tutorial


Here you will learn about this ancient miracle cure called Hooking. Our ancestors used hooking to catch fish! No just kidding, lets get to it.. But before we dive in, I'll provide a little introduction to the Portable Executable (PE). Don't skip it; its understanding is crucial to get to the meat and potatoes of this tutorial.

The Portable Executable (PE) format is a file format for executables, object code, DLLs, FON Font files, and others used in 32-bit and 64-bit versions of Windows operating systems. It is a data structure format that encapsulates information regarding dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data.

The Extensible Firmware Interface (EFI) specification states that PE is the standard executable format in EFI environments. On NT family of operating systems, the PE format is used for EXE, DLL, SYS (device...

Author image

Install Python Packages script


Merely a handy run-and-forget script that installs all python packages specified in a text file “packages.txt”. I've used it countless times. Press a button and let the console ASCII text flow.

You will more than likely need to run the script (or Visual Studio if you're using that to run it) with administrator privileges, or you'll be denied permission.

Requirements:

  • Python 3.x version installed (only tested with 3.5 and 3.6.6)
  • Latest pip version for the specified python version installed

I've used Windows Visual Studio IDE with Python tools and Python 3.6.6 interpreter.

Github

Github repository link.

Author image

Mail Spam Filter


A mail spam filtering solution implemented in Matlab.

PDF is in Greek only. If I get enough requests I may be persuaded to translate it in English.

Github

Github repository link.

Author image

Math Handbook


A handbook for logic, set theory, algebra, geometry, video game math concepts, graph theory, Calculus, discrete math, probability, statistics, number theory, numerical analysis, vector algebra, physics, chemistry and more goodies I've worked on and off throughout my educational years.

I compiled this several years ago and it's been left dormant among the circuits of my computer..

I provide the source files, which you can open yourself with TexMaker.

The built pdf file is called “Math Handbook.pdf”.

As a disclaimer, this compilation could be of use to some, to others it could be another pile jumbled up notes.

I release it in the hope that it might prove useful to at least one person.

I used Windows LATEX with TexMaker.

Github

Github repository link.

1 2 3 4 5 6