为什么 PackageInfoTable 和 TPackageTypeInfo 之间的 UnitCount 不同?

发布于 2024-09-13 19:34:30 字数 192 浏览 0 评论 0 原文

如果您在 System._StartExe 中放置断点并检查传入的 InitTable,您会注意到 InitTable.UnitCount 大于 InitTable.TypeInfo。单位计数。不幸的是,这些记录都没有得到很好的记录。有谁知道这两个数字代表什么以及为什么它们不同?我假设 InitTable.UnitCount 是应用程序中的单元总数。但另一件事是什么?

If you put a breakpoint in System._StartExe and examine the InitTable that gets passed in, you'll notice that InitTable.UnitCount is greater than InitTable.TypeInfo.UnitCount. Unfortunately, neither of these records are documented very well. Does anyone know what these two numbers represent and why they're different? I assume InitTable.UnitCount is the total number of units in the application. But what's the other one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烈酒灼喉 2024-09-20 19:34:30

我相信
- PackageInfoTable.UnitCount 对存储在 UnitInfo 数组中的单位进行计数,其中每个记录保存包的单位部分的初始化和终止代码指针。
- PackageInfoTable.TypeInfo.UnitCount 以及 ...UnitNames 引用包含存储在 TypeTable 中的一些 TypeInfo 的单元(真实类型信息或单位边界标记)。

一个单元可以包含一些 Init/Finit 代码,但没有 TypeInfo 可以相互收集,因此存在差异...

仅供参考,请查看 procedure ChangeFinalizationsOrder。 free.fr/pro/freeware/memcheck/" rel="nofollow noreferrer">MemCheck.pas 查看他们如何破解 InitTable(截至 D2006)...

I believe that
- PackageInfoTable.UnitCount counts the units stored in the UnitInfo array, where each record holds the initalization and finalization code pointers for the units parts of the package.
- PackageInfoTable.TypeInfo.UnitCount along with ...UnitNames references the Units containing some TypeInfo stored in the TypeTable (real Type Info or unit boundary marker).

A unit can contain some Init/Finit code but no TypeInfo to gather and reciprocally, hence the difference...

FYI, look at procedure ChangeFinalizationsOrder in MemCheck.pas to see how they hack the InitTable (up to D2006)...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文