使用VirtualAlloCex内部64位进程的内存分配。

发布于 2025-01-28 07:40:54 字数 430 浏览 1 评论 0原文

我试图使用WIN32 API VirtualAlloCex在64位进程中远程分配WOW64进程中的内存。如果我让操作系统通过将lpaddress 设置为null来确定在WOW64进程中分配内存的何处,那么API是否会认为它在WOW64进程中分配内存或将会分配内存API将过程视为正常的64位过程,并可能在32位地址范围之外分配内存?换句话说:将返回的指针施加到dword而不会丢失数据是否安全?

我特别担心,因为我注意到某些dll之类的wow64base.dll位于WOW64进程中的32位地址范围之外。

如果存在VirtualAlloCex的可能性将返回一个指针到32位范围以上的位置,是否有一种方法可以强制执行它仅在32位范围内分配?

I'm trying to allocate memory inside a WOW64 process remotely from a 64 bit process using the Win32 API VirtualAllocEx. If I let the OS determine where to allocate the memory inside the WOW64 process by setting lpAddress to NULL, will the API consider that it is allocating memory inside a WOW64 process or will the API treat the process like a normal 64 bit process and potentially allocate the memory outside the 32 bit address range? In other words: Is it safe to cast the returned pointer to a DWORD without losing data?

I'm especially worried because I noticed that some dlls like wow64base.dll are located outside the 32 bit address range in the WOW64 process.

If the possibility exists that VirtualAllocEx will return a pointer to a location beyond the 32 bit range, is there a way to enforce that it will only allocate within the 32 bit range?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文