Skip to content

Instantly share code, notes, and snippets.

@afogal
Created September 22, 2016 01:45
Show Gist options
  • Save afogal/5ec200f46856b1b776a9a91601c00b87 to your computer and use it in GitHub Desktop.
Save afogal/5ec200f46856b1b776a9a91601c00b87 to your computer and use it in GitHub Desktop.
How to fix the really really round telegram bubbles

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
 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

@MrMetric
Copy link

MrMetric commented Nov 7, 2016

Thanks for not giving me any credit…

telegramdesktop/tdesktop#2235 (comment)

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