Chameleon

Chameleon Svn Source Tree

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

Source at commit 970 created 13 years 23 days ago.
By macman, ati.c, removed duplicate default "ATI Radeon HD 5400 Series", added Gigabyte "AMD Radeon HD 6850" OC device ID and added additional AMD 6000 cards with their default settings. Removed some blank lines.
1/*
2 * Copyright (c) 2009 Evan Lojewski. All rights reserved.
3 *
4 */
5#include <cstdlib>
6#include <iostream>
7#include <modules>
8
9using namespace std;
10
11class HW {
12private:
13int id;
14public:
15virtual void setId( int id );
16virtual void printHello( void );
17};
18
19void helloWorld(void* binary, void* arg2, void* arg3, void* arg4)
20{
21HW* obj = new HW;
22HW* obj2 = new HW;
23obj->setId(1);
24obj->printHello();
25delete obj;
26
27obj2->setId(2);
28obj2->printHello();
29delete obj2;
30
31printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary);
32getchar();
33
34//
35
36}
37
38void HelloWorld_start()
39{
40//printf("Hooking 'ExecKernel'\n");
41register_hook_callback("ExecKernel", &helloWorld);
42register_hook_callback("Kernel Start", &helloWorld);
43
44}
45
46void HW::printHello()
47{
48//cout << "[" << id << "] HelloWorld from a c++ function\n";
49printf("[%d] HelloWorld from a c++ function\n", id);
50}
51
52void HW::setId(int id)
53{
54this->id = id;
55}
56

Archive Download this file

Revision: 970