如何拦截每一个试图使用API​​函数在C#中? [英] How to intercept each trying to use API function in C#?

查看:190
本文介绍了如何拦截每一个试图使用API​​函数在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要采取截屏挡住计算机上的任何屏幕捕捉软件。因为所有的人都在标准的API函数的工作,我想我可以监控并阻止他们。
我需要使用C#。
我所发现的是如何监视和阻止它们在一定程序(屏幕捕捉程序)。他们正在寻找程序中的功能,那么他们改变它放在我的函数地址地址。
,而我怎么能做到这一点,如果我没有任何某些程序?我需要阻止任何它试图采取截图。

i need to block any screen capture software on the computer from taking screen shots. Since all of them are work on standard API-functions, i think i could monitor and block them. I need to use C#. All i have found is how to monitor and block them in a certain program (screen capture program). They are looking for a function in the program, then they change it address on mine function address. But how can i do it, if i haven't any certain programs? I need to block anyone which tries to take a screenshot.

推荐答案

这是不可能的,以防止从截图被采取。这场战斗已经丢失,因为DWM(桌面窗口管理器)中。它比Win32和设备上下文较低的水平。

It is not possible to prevent screenshots from being taken. The battle is already lost because of the DWM (Desktop Window Manager). It's lower level than Win32 and device contexts.

如果你想保护的文字在你的程序中,有很多更简单的方法来提取它比做截图和OCR。的TextOut和/或挂钩的Direct2D和可访问的API。

If you want to protect the text in your program, there are a lot easier ways to extract it than doing screenshots and OCR. TextOut and/or Direct2D hooking and accessibility APIs.

如果有一个在你的程序很多IP。那就不要让所有可用的屏幕上。请确保它是繁琐抓取的GUI文本,且难以自动化。 。不要在程序的内存中加载整个文本

If there's a lot of IP in your program. Then don't make it all available onscreen. Make sure it's tedious to crawl the GUI for text, and hard to automate it. And don't load whole texts in memory of the program.

可能的解决方案
1.为防止文本的复制。绘制文本为图像。
2.为防止辅助技术,如屏幕阅读器 - 在你的控制覆盖的WndProc,处理并忽略窗口消息WM_GETOBJECT。
3.要使它更难,如果他们尝试使用OCR。绘制文本后面图形。人类可读的,但更难的一台机器来解释它。

Possible solutions: 1. To prevent copying of text. Draw the text as an image. 2. To prevent accessibility technologies, like screen readers - override WndProc in your control, handle and ignore the window message WM_GETOBJECT. 3. To make it harder if they try to use OCR. Draw graphics behind the text. Human readable, but much harder for a machine to interpret it.

这些方法都不是侵入性的用户。

Neither of these methods are invasive for the user.

**一个非常侵入性的建议**:
如果你对阻止任何人窃取你的内容很严重的。

** A very invasive suggestion **: If you are really serious about preventing anyone from "stealing" your content.


  1. 实施鼠标和键盘钩子。筛选出典型的复制快捷方式。离开你的应用程序的界限防止鼠标。

  2. 允许您的应用程序只有在OS中运行知名的进程和服务运行。
    。如果任何进程启动,你不承认,黑掉的应用程序,并通知用户有关它,并要求用户将其关闭。而OFC确保有人不只是欺骗一个众所周知的过程。

  3. 监视剪贴板如你所说你自己。

您可以OFC软化一些建议根据您的应用程序的上下文。

You can ofc soften some of these suggestions based on the context of your application.

这篇关于如何拦截每一个试图使用API​​函数在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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