Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/modules/HelloWorld/HelloWorld.cpp

Source at commit 1146 created 12 years 11 months ago.
By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing).
1/*
2 * Copyright (c) 2009 Evan Lojewski. All rights reserved.
3 *
4 */
5#include <cstdlib>
6#include <iostream>
7#include <modules>
8
9extern "C"
10{
11 void HelloWorld_start();
12}
13
14
15using namespace std;
16
17class HW {
18private:
19int id;
20public:
21virtual void setId( int id );
22virtual void printHello( void );
23};
24
25void helloWorld(void* binary, void* arg2, void* arg3, void* arg4)
26{
27HW* obj = new HW;
28HW* obj2 = new HW;
29obj->setId(1);
30obj->printHello();
31delete obj;
32
33obj2->setId(2);
34obj2->printHello();
35delete obj2;
36
37printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary);
38getchar();
39}
40
41void HelloWorld_start()
42{
43//printf("Hooking 'ExecKernel'\n");
44register_hook_callback("ExecKernel", &helloWorld);
45register_hook_callback("Kernel Start", &helloWorld);
46}
47
48void HW::printHello()
49{
50//cout << "[" << id << "] HelloWorld from a c++ function\n";
51printf("[%d] HelloWorld from a c++ function\n", id);
52}
53
54void HW::setId(int id)
55{
56this->id = id;
57}
58

Archive Download this file

Revision: 1146