Category Archives: C++

Custom prolog and epilog for a function in C++

Traditionally, the compiler is responsible for creating the prolog and epilog of a function. However, custom prolog and epilog code can be written if a function has been declared with the naked attribute. The snippet below demonstrates a naked function with custom prolog and epilog code. __declspec(naked) void foo(){ // Prolog __asm { push ebp [...]

Also posted in Assembler | Tagged , , , , , , , , , , , , , , | Leave a comment

Hooking with the Microsoft Detours library in C++

The DLL Injection example described how to inject a DLL into an existing process. The snippets below demonstrate a combination of hooking and DLL injection in C++ with the Microsoft Detours library. Quote: In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, [...]

Posted in C++ | Tagged , , , , , , , , , , , , , , , , | 5 Comments

(C++) Gaussian Elimination

Numerical Methods application for solving system of equation using Gaussian Elimination based on this Wikipedia article: http://en.wikipedia.org/wiki/Gaussian_elimination

Posted in C++ | Tagged , , , , , , , , | Leave a comment

Basic client/server communication in C++ using the RakNet networking engine

Quote: RakNet is a cross-platform C++ and C# game networking engine. It is designed to be a high performance, easy to integrate, and complete solution for games and other applications. The snippets below demonstrate basic client/server communication using the RakNet library.

Posted in C++ | Tagged , , , , , , , , , , , | Leave a comment

DLL injection in C++

DLL injection in Windows can be used to inject a DLL into a process and to take over/extend functionality. For example, the distribution platform Steam uses DLL injection for the game overlay.

Posted in C++ | Tagged , , , , , , , , , , , , , | 5 Comments

(C++) Nasdaq IPOs Scrape

This is a C++ program that scrapes IPO data from Nasdaq.com using libcurl for downloading the data and htmlcxx for parsing the html code.

Posted in C++ | Tagged , , , , , , | Leave a comment

(C++) linked_list class (both the header file and the template file)

This is a linked list that can be used like an array where instead of using [] after the reference you just used .get() (and some other methods) but now you don’t have to worry about sizing. For example, with an array you would do: cout

Posted in C++ | Tagged , , , , , , | Leave a comment

(C++) [CISP 430] Heapsort

  The Heapsort algorithm implemented in C++

Posted in C++ | Tagged , , , , , , | Leave a comment

(C++) [CISP 430] Binary Search Tree

Binary Search Tree (BST) implementation in C++

Posted in C++ | Tagged , , , , , , , | Leave a comment

(C++) Qt drag and drop files or directories

You have to implement 2 protected virtual methods in your widget you want to accept file or directory drops: – void dragEnterEvent(QDragEnterEvent *event) – void dropEvent(QDropEvent *event) And also you have to call setAcceptDrops(true); on this widget before it could accept drops.

Posted in C++ | Tagged , , , , , , , | Leave a comment