Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Here is a bash/GDB script to fix it (tested on GNU/Linux only):
  2.  
  3. ```
  4. #!/bin/bash
  5.  
  6. gdb /usr/bin/telegram-desktop << EOF
  7. tbreak _ZN3App9initMediaEv
  8. commands
  9. set {char}_ZN3App9msgRadiusEv=0xB8
  10. set {int}(_ZN3App9msgRadiusEv+1)=3
  11. set {char}(_ZN3App9msgRadiusEv+5)=0xC3
  12.  
  13. set {char}_Z25replaceStringWithEntitiesRK13QLatin1String5QCharR7QStringP5QListI12EntityInTextEb = 0xC3
  14.  
  15. set {char}(_ZNK5Image10pixCircledEii+0) = 0x89
  16. set {char}(_ZNK5Image10pixCircledEii+1) = 0xD1
  17. set {char}(_ZNK5Image10pixCircledEii+2) = 0x89
  18. set {char}(_ZNK5Image10pixCircledEii+3) = 0xF2
  19. set {char}(_ZNK5Image10pixCircledEii+4) = 0xBE
  20. set {int}(_ZNK5Image10pixCircledEii+5) = 0x02
  21. set {char}(_ZNK5Image10pixCircledEii+9) = 0xE9
  22. set {int}(_ZNK5Image10pixCircledEii+10) = (_ZNK5Image10pixRoundedE16ImageRoundRadiusii) - (_ZNK5Image10pixCircledEii + 14)
  23. end
  24. run
  25. detach
  26. quit
  27. EOF
  28. ```
  29.  
  30. Just run it instead of the usual Telegram binary and you're set.
  31.  
  32. This replaces the start of `App::msgRadius` with
  33.  
  34. mov $0x3, %eax
  35. retq
  36.  
  37. In C++, that is `return 3`;
  38.  
  39. Explanation: `0xB8` means `mov` a number to `%eax`, `3` is the border radius, and `0xC3` is `retq`.
  40. The first instruction in `replaceStringWithEntities` gets replacemed by a `retq`, bypassing it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement