Comments (25)
@ysc3839 哇,这个是你啊,太巧了。
from fontmod.
相关讨论: https://www.v2ex.com/t/405515
from fontmod.
#include <stdio.h>
#include <unistd.h>
#include <dlfcn.h>
int FT_New_Face(void *library, const char* filepathname, signed long face_index, void *aface)
{
static int (*orig_FT_New_Face)(void *, const char*, signed long, void *) = NULL;
if (!orig_FT_New_Face)
orig_FT_New_Face = dlsym(RTLD_NEXT, "FT_New_Face");
//puts("FT_New_Face Test!");
return orig_FT_New_Face(library, "/path/to/test/font.ttc", face_index, aface);
}
gcc hooktest.c -o hooktest.so -fPIC -shared -ldl -D_GNU_SOURCE
export LD_PRELOAD=`pwd`/hooktest.so
telegram-desktop
在 Lubuntu 17.10 x64 下测试成功。
from fontmod.
@ysc3839 我在Linuxmint18.3(基于ubuntu的操作系统)上试了一下没有成功,请问我还可以做哪些尝试?
from fontmod.
@daya-prac 说说的你步骤?你不会没改代码吧?代码里要写字体文件路径的。
from fontmod.
@ysc3839 配置了字体路径的
from fontmod.
@daya-prac 把 puts 那一行取消注释,然后看看有没有输出信息。
from fontmod.
@ysc3839 取消注释重新编译了一下,没有任何输出
from fontmod.
@daya-prac 那说明没有调用这个函数,具体什么情况我就说不清了……
from fontmod.
@ysc3839 好的,谢谢了
from fontmod.
@ysc3839 对了“filepathname”这里是要替换成Telegram的文件路径吗
from fontmod.
@daya-prac 不需要
from fontmod.
@ysc3839 hooktest.c的源文件需要跟Telegram的二进制文件放在同一文件夹下面之后再编译吗
from fontmod.
@daya-prac 不需要,随便放哪都行
from fontmod.
感谢 hook成功。
Archlinux telegram-desktop 1.2.8
from fontmod.
xUbuntu 18.04 LTS HOOK失败 我尝试GDB调试 会触发FT_New_Face函数断点 ,但是没有任何输出 字体也修改失败。
from fontmod.
@BackTrackCRoot 有可能程序并没有使用 FreeType?
from fontmod.
@ysc3839 我感觉应该是了 Linux的字体方面API我不是太熟 不知道还有其他函数么 还望指点一下 谢谢!
from fontmod.
@BackTrackCRoot 我也不太熟
from fontmod.
@ysc3839 哦哦 谢谢 那我再研究研究
from fontmod.
@ysc3839 您好,我在18.04LTS不慎没有更改字体路径,导致现在QT显示异常,请问如何恢复正常呢?感谢!
from fontmod.
@chewnglow 重启系统无效吗?
from fontmod.
@ysc3839 重启之后QT就变得比较模糊了,后来直接删除了hooktest.c和hooktest.so,现在的情况是因为错误hook变得奇怪的字体渲染正常了,但是重启之后的字体模糊仍存在,另外还存在显示不正确的情况,如shell和部分窗口有异常白线、系统监视器刷新时会有白线等。
from fontmod.
@chewnglow 如果你使用的是 export LD_PRELOAD
那重启后应该会完全恢复。
from fontmod.
ubuntu 22.04.1 LTS
Telegram Desktop 4.2
HOOK成功,感谢
from fontmod.
Related Issues (20)
- Change Hook HOT 1
- 2.1 版 FontMod64.dll 不能加载 只有 32 位能加载 HOT 1
- [Question] How to use the overridings ? HOT 7
- [Feature Request] Support GDI+ HOT 9
- 请问FontMod64.dll和FontMod32.dll,Win10 64位专业版用哪个?还是两个一起用? HOT 5
- TG Desktop 2.8.5 Beta 不允许 DLL 注入了 HOT 6
- Telegram 2.8.8 stable breaks everything HOT 1
- Telegram 2.8.8 似乎不再载入 `winmm.dll` HOT 2
- Telegram 2.8.5+ don't allow any .dll-s near Telegram.exe HOT 5
- 用在最新telegram上不起作用 HOT 5
- 无法修改字体大小,不会自动生成配置文件FontMod.yaml HOT 1
- Workaround: Telegram Desktop HOT 9
- MyGetStockObject 方法遗漏了 DEFAULT_GUI_FONT
- Linux Arch HOT 1
- 無法替換為特定字型
- fonts won't apply on FontMod v3 HOT 5
- font can not be changed in newest telegram version(x64 v4.6.1) HOT 6
- 英文系统,telegram修复不管用呀
- [Request] Enable GitHub Discussions for sharing experiences and working examples HOT 1
- Fontmod 3.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontmod.