Hooking Cocoa API? [英] Hooking Cocoa API?

查看:136
本文介绍了Hooking Cocoa API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图Hook Cocoa API。

I am trying to Hook Cocoa API.

我知道cocoa提供了一个用于挂钩的公共api,因此可以挂钩系统函数并检索上下文的当前字体设置等信息。

I know cocoa provides a public api for hooking, so it’s possible to hook the system function and retrieve information like the current font settings of the context.

我也试图从可可中抽取api。

I am also trying to hook that draw api from cocoa.

有人可以告诉我如何实现。或者一些涉及挂钩Cocoa API的引用?

Can somebody point me to details on how it can be achieved. Or some references which talks about hooking of Cocoa APIs?

由Hooking,我的意思是一种控制特定代码执行的基本技术,它提供了一个简单的

By Hooking , I mean "A fundamental technique of getting control over a particular piece of code execution. It provides an straightforward mechanism that can easily alter the operating system's behavior as well as 3rd party products, without having their source code available."

我的要求是,如果有任何应用程序/系统正在绘图,那么可以轻松修改操作系统的行为以及第三方产品东西,那么我想要那些绘图说明应该先来找我。然后我不能存储这些命令,稍后进行一些处理。

My requirement is, if any application/system is drawing something, then I want those draw instructions should first come to me. Then I cant to store those commands, for some processing later.

推荐答案

您正在寻找的术语类似于系统范围的代码注入,Cocoa不提供任何API事情。您需要查看类似 mach_star SIMBL 。但是老实说,这是其中的一个,如果你要问,这可能是一个有点先进为你。修改其他进程的代码是一个巨大的PITA,甚至更难以做到,即使与mach_star提供的帮助一样。如果您想了解有多难,请参阅 Unsanity的网站。这是在OS X上开创代码注入的公司,他们的整个产品线都是基于它的 - 他们的许多程序仍然不兼容OS X 10.6。

The term you are looking for is something like "systemwide code injection," and Cocoa does not provide an API for any such thing. You'd need to take a look at something like mach_star or SIMBL. But honestly, this is one of those things where, if you have to ask, it's probably a little advanced for you. Modifying other processes' code is a gigantic PITA and even harder to do right, even with as much help as mach_star offers. If you want to see just how hard, take a look at Unsanity's site. That's the company that pioneered code injection on OS X, and their entire product line is based around it — and many of their programs are still not compatible with OS X 10.6.

这篇关于Hooking Cocoa API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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