Skip to content

Instantly share code, notes, and snippets.

@vijfhoek
Forked from afogal/fix_telegram_bubbles.md
Last active November 7, 2016 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vijfhoek/a24b453f001549bb14562de5078ae1bc to your computer and use it in GitHub Desktop.
Save vijfhoek/a24b453f001549bb14562de5078ae1bc to your computer and use it in GitHub Desktop.
How to fix the really really round telegram bubbles and << >> -- stuff

Here is a GDB script to fix it (tested on GNU/Linux only):

 tbreak _ZN3App9initMediaEv
 commands
     set {char}_ZN3App9msgRadiusEv=0xB8
     set {int}(_ZN3App9msgRadiusEv+1)=3
     set {char}(_ZN3App9msgRadiusEv+5)=0xC3
     set {char}_Z25replaceStringWithEntitiesRK13QLatin1String5QCharR7QStringP5QListI12EntityInTextEb = 0xC3
 end
 run
 detach
 quit

Run it like this, assuming it is saved to msgRadius.gdb and Telegram is /usr/bin/telegram-desktop:

$ gdb -x msgRadius.gdb /usr/bin/telegram-desktop

This replaces the start of App::msgRadius with

mov $0x3, %eax
retq

In C++, that is return 3;

Explanation: 0xB8 means mov a number to %eax, 3 is the border radius, and 0xC3 is retq. The first instruction in replaceStringWithEntities gets replacemed by a retq, bypassing it.

@MrMetric
Copy link

MrMetric commented Nov 7, 2016

I'd like to note that this is forked (uncredited) from something I made: telegramdesktop/tdesktop#2235 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment