Chameleon

Chameleon Svn Source Tree

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

Source at commit 1166 created 13 years 10 days ago.
By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged.
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: 1166