Seasons.NET

ちょっとした技術ブログです

コールスタックをプログラムから取得しよう!!(経過報告)

今作っている、コールスタック取得プログラムの経過報告です。
下のようなプログラムを実行すると、APIフックにて埋め込まれたpenter側で
以下の画面の情報を出力します。

関数名も取得できてますし、いい感じです。

// GetCallStack.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#pragma comment(lib,"penter.lib");
#include "../penter/penter.h"

class Hoge
{
public:
    void funcOK( int value )
    {
    }
    static void callstatic( void )
    {
    }
};

void func( void )
{
    Hoge h;
    h.funcOK(100);
    Hoge::callstatic();
}


int _tmain(int argc, _TCHAR* argv[])
{
    func();
    return 0;
}