拦截与越来越优化版本的Windows API调用 [英] Intercepting API calls related to getting Windows Verion

查看:129
本文介绍了拦截与越来越优化版本的Windows API调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经打家园1,和它运行,你需要运行它的Windows NT 4兼容模式。

I've been playing Homeworld 1, and for it to run you need to run it Windows NT 4 Compatibility mode.

Windows 8中没有这种出于某种原因,这是很烦人的。

Windows 8 does not have this for some reason, which is quite annoying.

我发现家园做一个API调用来获取Windows版本,它似乎停止工作,除非它是以为它在Windows NT上运行(使用调试器,我可以看到它呼吁GetVersion和GetVersionEx)。

Using Microsoft Application Compatibility Toolkit I discovered that Homeworld does an API call to get the version of Windows, and it seems to stop working unless it is thinking it's running on Windows NT (Using a debugger I can see that it calls for GetVersion and GetVersionEx).

http://technet.microsoft.com /en-us/library/cc749574(v=ws.10).aspx

使用上述与微软Applocation COMPAT工具包修复了这个错误,但我玩这个游戏有很多不同的计算机,其中一些不能用上述方法。

Using the above with Microsoft Applocation Compat Toolkit fixes this error, but I play this game on a lot of different computers, some which can not use the above method.

有没有办法为我做一些包装,拦截API调用,并与上面的链接结构返回它们使程序认为这是在NT上运行?我已经看到了很多你的文件夹中放置,它可以拦截某些调用的DLL,虽然我不知道他们是如何工作的,我以为他们是用C,C ++。

Is there any way for me to make some sort of wrapper that intercepts the API calls and returns them with the above links struct so that the program think it is running on NT? I've seen a lot of DLLs that you place in a folder and it can intercept certain calls, though I'm not sure how they work, I assume they are written in C, C++.

我真的知道的唯一的语言是C#,我以为不能做我想做的,所以如果有人能指出我在正确的方向,帮助,给我提示,在这个或我指向哪里我能得到更多的帮助,那简直太好了!

The only language I really know any of is C#, which I assume can't do what I want, so if anyone is able to point me in the right direction, help, give me tips on this or point me to where I could get more help that'd be great!

感谢您的时间!

推荐答案

您可以使用API​​挂钩库,这里是一个的为著名easyhook库教程

You could use api hooking library, here is a tutorial for the famous easyhook library.

钩住GetVersionEx API为您的应用程序,并返回你想要的东西。

Hook the GetVersionEx api for you application and return what you want.

这篇关于拦截与越来越优化版本的Windows API调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆