首页
社区
课程
招聘
General Injecting Dll by Kb Hook In Console
发表于: 2014-5-24 01:06 3250

General Injecting Dll by Kb Hook In Console

2014-5-24 01:06
3250
I'am a novice.
My Code. in VS2012
--------------------------
int main()
{
  Sleep(100);
  CHooks Chooks(L"xGameNamex", L"xDLLNamex");
  Sleep(2000);

  for (;;)
  {
    int input; 
    input = getchar(); // or std::cin
    if (input == 0x31)
      Chooks.SetHookKb();
    else if (input == 0x32)
      Chooks.UnHookKb();
  }
  return 0;
}
--------------------------
Two questions
each one I will pay 20 KB
1, Once I try to use Windows SEH, (__try) when compile, 
the compiler will produce error. 
then, I use C++ exception handle(try), the work is ok.
In the above console circumstance,
with C++ obejct, why can't use Windows SEH? For straight answer or reference.
2,  For ture, I inject to a game.
While I am typing 1 to sethook, the console is halt, unworked and can't close.
I try to create a new project which is WinProject, and AllocConsole, type 1
It will work without error, again, why? for real answer.
--------------------------
Thanks

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (6)
雪    币: 2664
活跃值: (3401)
能力值: ( LV13,RANK:1760 )
在线值:
发帖
回帖
粉丝
2
Are you a foreigner?
2014-5-24 01:07
0
雪    币: 52
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
看到有些前辈,
也用些简单的英语发帖
跟着学习撒
2014-5-24 01:09
0
雪    币: 1443
活跃值: (96)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
第一个问题,SEH是C语言实现的,根本不知道C++析构函数是什么东西,所以如果发生了异常,unwind的时候并不会调用CHooks的析构函数,就可能会泄漏资源,VC编译器会报错说当需要unwinding的栈里有需要析构的对象时不能使用SEH。换用C++的try-catch就可以了。
第二个问题应该是取决于你的Chooks的实现吧,我猜不出来。
2014-5-24 01:35
0
雪    币: 608
活跃值: (643)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
5
吐血,本来想拿英语给你回复的,结果一看三楼,还是算了吧。
2014-5-24 06:15
0
雪    币: 52
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Thank you.

I will accept your word, Do you feel happy?
2014-5-24 19:04
0
雪    币: 1559
活跃值: (1785)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
wbs
7
老外都发贴了 论坛知名度还可以
2014-5-24 19:15
0
游客
登录 | 注册 方可回帖
返回
//