upgpkg: discord 0.0.59-2: update krisp patcher
* Fix segfault after patching Krisp binary
This commit is contained in:
parent
a97b03ba86
commit
6dccde8455
3 changed files with 8 additions and 6 deletions
4
.SRCINFO
4
.SRCINFO
|
@ -1,7 +1,7 @@
|
|||
pkgbase = discord_arch_electron
|
||||
pkgdesc = Discord using system provided electron for increased security and performance
|
||||
pkgver = 0.0.59
|
||||
pkgrel = 1
|
||||
pkgrel = 2
|
||||
url = https://discord.com
|
||||
install = discord_arch_electron.install
|
||||
arch = any
|
||||
|
@ -23,6 +23,6 @@ pkgbase = discord_arch_electron
|
|||
source = krisp-patcher.py
|
||||
sha512sums = 43a911d03d62f9d73e8058771b59d148500fc48a0cf51be90899f4927979034d73326086084d342b4885ebe74560b4b99598d8514be9a51f00a9dd2010c74132
|
||||
sha512sums = e11a60419c6ee5944aefc1ac16a5b496518fae626627d37a5bf636975bd21b1d9b6118ec3f44e7f4283befe5fa14737ad28dc38d975967789247ac0e66c352f3
|
||||
sha512sums = 3c1021592fa856f3561072c76b5ee0b5a34a53bc230336e6d36827efb4866c9d801ef7abb24650d3a7210c61dd57f35e2812ae89226fc157cc8d9ffce032155f
|
||||
sha512sums = ac1212b09c3c1e7af3f93294d799765a0547f20a8373bea0ecb1a3e2bcb165488eb1412141c4e577d53ae87122646b12b9339b0a3f8e6817c3865fbb3f642938
|
||||
|
||||
pkgname = discord_arch_electron
|
||||
|
|
4
PKGBUILD
4
PKGBUILD
|
@ -10,7 +10,7 @@ _pkgname=discord
|
|||
_electron=electron
|
||||
pkgname=${_pkgname}_arch_electron
|
||||
pkgver=0.0.59
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Discord using system provided ${_electron} for increased security and performance"
|
||||
arch=('any')
|
||||
provides=("${_pkgname}")
|
||||
|
@ -31,7 +31,7 @@ source=("https://dl.discordapp.net/apps/linux/${pkgver}/${_pkgname}-${pkgver}.ta
|
|||
'krisp-patcher.py') # original: https://github.com/sersorrel/sys/blob/main/hm/discord/krisp-patcher.py
|
||||
sha512sums=('43a911d03d62f9d73e8058771b59d148500fc48a0cf51be90899f4927979034d73326086084d342b4885ebe74560b4b99598d8514be9a51f00a9dd2010c74132'
|
||||
'e11a60419c6ee5944aefc1ac16a5b496518fae626627d37a5bf636975bd21b1d9b6118ec3f44e7f4283befe5fa14737ad28dc38d975967789247ac0e66c352f3'
|
||||
'3c1021592fa856f3561072c76b5ee0b5a34a53bc230336e6d36827efb4866c9d801ef7abb24650d3a7210c61dd57f35e2812ae89226fc157cc8d9ffce032155f')
|
||||
'ac1212b09c3c1e7af3f93294d799765a0547f20a8373bea0ecb1a3e2bcb165488eb1412141c4e577d53ae87122646b12b9339b0a3f8e6817c3865fbb3f642938')
|
||||
|
||||
prepare() {
|
||||
# prepare launcher script
|
||||
|
|
|
@ -41,9 +41,10 @@ found_issigned_by_discord_test = False
|
|||
found_issigned_by_discord_je = False
|
||||
found_already_patched = False
|
||||
je_location = None
|
||||
je_size = 0
|
||||
|
||||
# We are looking for a call to IsSignedByDiscord, followed by a test, followed by a je.
|
||||
# Then we patch the je into a two byte nop.
|
||||
# Then we replace the je with nops.
|
||||
|
||||
md = Cs(CS_ARCH_X86, CS_MODE_64)
|
||||
md.detail = True
|
||||
|
@ -61,6 +62,7 @@ for i in md.disasm(krisp_initialize, krisp_initialize_address):
|
|||
if found_issigned_by_discord_test:
|
||||
found_issigned_by_discord_je = True
|
||||
je_location = i.address
|
||||
je_size = len(i.bytes)
|
||||
break
|
||||
|
||||
if i.id == X86_INS_NOP:
|
||||
|
@ -74,7 +76,7 @@ if je_location:
|
|||
shutil.copyfile(executable, executable + ".orig")
|
||||
f = open(executable, 'rb+')
|
||||
f.seek(je_location - address_to_file)
|
||||
f.write(b'\x66\x90') # Two byte NOP
|
||||
f.write(b'\x90' * je_size) # je can be larger than 2 bytes given a large enough displacement :(
|
||||
f.close()
|
||||
else:
|
||||
if found_already_patched:
|
||||
|
|
Loading…
Reference in a new issue