GetReturnAddress call does not preserve 16-byte stack alignment for Linux
维护者通常 1 天内回复
@Kenzzer 已经在做这个了。
开始于 2026年1月14日。
评估
这个 Issue 还没有评估数据。
描述
Description
Not so long ago, I delved into the DynamicHooks/DHook library in order to understand its inner workings. After thoroughly examining the library, I decided to create my own version that would be compatible with both x64 and x32 and would include the ability to work with Virtual Hook.
As I was working on this project, I encountered a small issue on 32bit. While it may not be a serious problem, I noticed that calling GetReturnAddress does not preserve 16-byte stack alignment for Linux, when HookHandler call took this into account.
Problematic Code
// Get the original return address
void* (__cdecl CHook::*GetReturnAddress)(void*) = &CHook::GetReturnAddress;
masm.push(esp);
masm.push(intptr_t(this));
masm.call(ExternalAddress((void *&)GetReturnAddress));
masm.addl(esp, 8);
->
// Get the original return address
void* (__cdecl CHook::*GetReturnAddress)(void*) = &CHook::GetReturnAddress;
masm.movl(eax, esp);
masm.subl(esp, 4);
masm.push(eax);
masm.push(intptr_t(this));
masm.call(ExternalAddress((void *&)GetReturnAddress));
masm.addl(esp, 12);
- 主要语言
- C++
- 星标
- 1.2k
- 派生
- 476
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
alliedmodders/sourcemod 的其他 Issue
-
[Bug]: RoundToNearest truncates in plugins compiled with spcomp 1.13可能已有人在做 @fmu1337 今天认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 62/100
alliedmodders/sourcemod#2627 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
alliedmodders/sourcemod#2615 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 72/100
alliedmodders/sourcemod#2613 · 1 条评论 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 72/100
alliedmodders/sourcemod#2571 · 4 条评论 ·
维护者通常 1 天内回复
-
Feature Request
难度 1/5 1 小时以内 新手友好度 64/100
alliedmodders/sourcemod#2555 · 3 个 reaction ·
维护者通常 1 天内回复
查看 alliedmodders/sourcemod 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
raspberrypi/rpi-imager#1804 ·
-
difficulty: easy docs good first issue help wanted
难度 2/5 1-3 小时 新手友好度 74/100
Ryan-Millard/Img2Num#842 ·
维护者通常 12 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/calculator#2532 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
-
bug difficulty:easy prio:normal
难度 2/5 1-3 小时 新手友好度 62/100
NatronGitHub/openfx-misc#411 ·
维护者通常 1 天内回复