Giter Club home page Giter Club logo

Comments (25)

livc avatar livc commented on May 23, 2024 2

@ysc3839 哇,这个是你啊,太巧了。

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

相关讨论: https://www.v2ex.com/t/405515

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024
#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.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 我在Linuxmint18.3(基于ubuntu的操作系统)上试了一下没有成功,请问我还可以做哪些尝试?

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@daya-prac 说说的你步骤?你不会没改代码吧?代码里要写字体文件路径的。

from fontmod.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 配置了字体路径的

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@daya-prac 把 puts 那一行取消注释,然后看看有没有输出信息。

from fontmod.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 取消注释重新编译了一下,没有任何输出

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@daya-prac 那说明没有调用这个函数,具体什么情况我就说不清了……

from fontmod.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 好的,谢谢了

from fontmod.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 对了“filepathname”这里是要替换成Telegram的文件路径吗

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@daya-prac 不需要

from fontmod.

daya-prac avatar daya-prac commented on May 23, 2024

@ysc3839 hooktest.c的源文件需要跟Telegram的二进制文件放在同一文件夹下面之后再编译吗

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@daya-prac 不需要,随便放哪都行

from fontmod.

ssfdust avatar ssfdust commented on May 23, 2024

感谢 hook成功。
Archlinux telegram-desktop 1.2.8

from fontmod.

BackTrackCRoot avatar BackTrackCRoot commented on May 23, 2024

xUbuntu 18.04 LTS HOOK失败 我尝试GDB调试 会触发FT_New_Face函数断点 ,但是没有任何输出 字体也修改失败。
photo_2018-04-28_20-26-33

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@BackTrackCRoot 有可能程序并没有使用 FreeType?

from fontmod.

BackTrackCRoot avatar BackTrackCRoot commented on May 23, 2024

@ysc3839 我感觉应该是了 Linux的字体方面API我不是太熟 不知道还有其他函数么 还望指点一下 谢谢!

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@BackTrackCRoot 我也不太熟

from fontmod.

BackTrackCRoot avatar BackTrackCRoot commented on May 23, 2024

@ysc3839 哦哦 谢谢 那我再研究研究

from fontmod.

chewnglow avatar chewnglow commented on May 23, 2024

@ysc3839 您好,我在18.04LTS不慎没有更改字体路径,导致现在QT显示异常,请问如何恢复正常呢?感谢!

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@chewnglow 重启系统无效吗?

from fontmod.

chewnglow avatar chewnglow commented on May 23, 2024

@ysc3839 重启之后QT就变得比较模糊了,后来直接删除了hooktest.c和hooktest.so,现在的情况是因为错误hook变得奇怪的字体渲染正常了,但是重启之后的字体模糊仍存在,另外还存在显示不正确的情况,如shell和部分窗口有异常白线、系统监视器刷新时会有白线等。
Screenshot_20190408_183009
Screenshot_20190408_183749

from fontmod.

ysc3839 avatar ysc3839 commented on May 23, 2024

@chewnglow 如果你使用的是 export LD_PRELOAD 那重启后应该会完全恢复。

from fontmod.

subB1ss avatar subB1ss commented on May 23, 2024

ubuntu 22.04.1 LTS
Telegram Desktop 4.2
HOOK成功,感谢

from fontmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.