- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 IDA Pro 6.3 对 Win32 .dll 进行静态分析,并且正在使用 Hex-Rays 反编译器和 IDA 反汇编器。我想了解这条线的作用。
v4 = (*(int (__thiscall **)(int, int))(*(_DWORD *)dword_10087418 + 4))(dword_10087418, v11);
最佳答案
这很可能是 C++,而不是普通的 C。这正是 Visual C++ 生成的虚拟方法调用的样子。我会说:
dword_10087418
是一个指向对象的指针。它是全局变量或静态变量,而不是局部变量。 SomeClass::Instance->func(arg)
. mov ecx, esi ; pretend that esi contains a pointer
; to the object whose method is being called
; also known as "this"
; __thiscall functions expect to find this pointer in ecx
; and all later arguments on the stack
mov edx, [ecx] ; get the vtable address
push edi ; set up some integer-sized argument
call [edx + 4] ; call the second function in the vtable
(*(int (__thiscall **)(int, int))(*(_DWORD *)dword_10087418 + 4))(dword_10087418, v11)
^-----------------------^
dereference pointer to get the address of the vtable
(it's the first piece of data in the object)
^-----------------------------^
add 4 bytes to get address of the second function
^------------------------------------------------------------------------------------^
cast that pointer to a particular function pointer and call it
(cast is invisible in assembler code, so it's just a call)
this
,编译器也必须通过它。这是一个在 C++ 中看不到的细节,但是
this
被视为函数的附加参数 - 因此您会看到两个参数,但该函数只接受一个参数(MSVC 的
thiscall
约定要求
this
指针传入
ecx
)。 IDA 不会费心隐藏那个指针,因为那会让人感到困惑。
ms_rtti
为 IDA 编写脚本并运行它以查找 DLL 中的虚方法表,然后搜索对
dword_10087418
的其他引用。查看写入了哪些值 - 您应该能够确定哪个 vtable 与该对象相关联,然后确定正在调用哪个函数。
关于decompiling - 反编译的 __thiscall 表达式是指向函数的指针吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16576824/
我正在将 VC++6.0 项目转换为 Visual Studio 2008(到 2014 年)。我遇到了上述错误。 这是我的代码片段: BEGIN_MESSAGE_MAP(CImportProject
阅读 calling conventions 时有一个目的很明确的 thiscall 约定。 我知道 thiscall 定义了一个属于类的函数,因为这些函数需要一个对象作为非静态函数的第一个隐藏参数。
我正在使用 IDA Pro 6.3 对 Win32 .dll 进行静态分析,并且正在使用 Hex-Rays 反编译器和 IDA 反汇编器。我想了解这条线的作用。 v4 = (*(int (__this
我正在使用 boost::function 将函数传递给 Button 构造函数,以便它保存该函数。每当它被激活时调用它。 typedef boost::function Action; 在我的 Ti
我正在对一个旧的 C++ 代码进行逆向工程,我发现了一些我无法理解如何从普通的 C++ 代码中完成的东西。来自 DLL 的函数签名是一个可以恢复为 public: void __thiscall My
我收到链接器错误,我似乎无法找到根本原因,已检查是否包含 .cpp 文件并阅读其他论坛。 错误是: 1>------ Build started: Project: Penguin_RPG, Conf
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
我四处寻找试图解决这个错误的帖子,但在每种情况下我都已经按照他们的建议去做了。 我的编译输出: main.obj:-1: error: LNK2019: unresolved external sym
假设您需要在 x86 Windows 上 Hook /绕过一个 __thiscall 类型的函数,为了做到这一点,您需要将 void* 传递给 shim 函数。是的,这在技术上是对 C++ 的“可怕滥
因此,我创建了一个基本的 VC++ 程序,并创建了一个带有 1 个方法(除了构造函数和析构函数)的模板类。我收到以下错误: >main.obj : error LNK2019: unresolved
非常感谢任何帮助,我的前额被擦伤了。 我们有一个大的开源 DICOM库 ( dcmtk ) 我们用作静态库。它是非托管的 C++,我们从托管的 C++ DLL 链接到它。包裹它。它使用 CMake 来
我在 Bjarne“C++...”中实现了 String 类。我想要内联 read() 和其他访问器函数,所以我将它们标记为内联。没关系,但是定义对主文件中对类 String 的引用进行读取的哈希函数
我正在尝试 Hook 一个具有签名的未记录的函数: (void(__thiscall*)(int arg1, int arg2))0x6142E0; 我看过弯路示例“成员”,它解释了: By defa
我有一个类 template class LinkedListItem { public: LinkedListItem(T
假设我有这段代码是使用 HexRays 生成的。但是 __thiscall 似乎不能在 VC++ 6.0 中使用。 使用了非标准扩展:“__thiscall”关键字保留供将来使用 我如何在 VC++
我一直收到这个错误,它不允许我编译。谁能帮帮我? 这是用户名密码验证器.cpp #include "UsernamePasswordValidator.h" #include #include #
我正在使用 Visual Studio 2008。仅当使用 MFC CString(与 std::wstring 相比)构建包含静态链接库的项目时,我才收到链接器错误。 所以这是可行的: //head
我完全迷失了这一点。 编译的时候报错: Error 7 error LNK1120: 6 unresolved externals Error 4 error LNK2001: unresolved
当我调用 main() 函数时出现错误: 错误 2 error LNK2019: 函数“public: __thiscall Img::Img( int,int)"(??0?$Img@H@@QAE@H
好吧,我尝试通过网络寻找解决方案,但找不到任何解决我的问题的方法。 我正在为类编写作业,要求我们使用模板进行二叉树搜索。我已经在之前的类(class)中构建了一个整数二叉搜索树,所以这基本上是同一个程
我是一名优秀的程序员,十分优秀!