File multimc-get-upstream-mssecret of Package multimc

#!/bin/bash
set -e

WD=$(mktemp -d)
pushd "${WD}" >/dev/null
curl -L "https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz" 2>/dev/null | tar -xzf - MultiMC/bin/MultiMC
pushd ${WD}/MultiMC/bin/ >/dev/null
client_id_asm=$(objdump -j '.text' --no-show-raw-insn -C --disassemble='Secrets::getMSAClientID(unsigned char)' MultiMC)
client_id="$(grep -oP '[a-z0-9]{2}(?=,%r[89]d)' <<< ${client_id_asm} | tac | tr -d '\n')$(grep -oP '(push.+0x)\K[a-z0-9]{2}' <<< ${client_id_asm} | tac | tr -d '\n')"
client_id="${client_id:0:8}-${client_id:8:4}-${client_id:12:4}-${client_id:16:4}-${client_id:20}"

echo "$client_id"
popd >/dev/null
popd >/dev/null
/bin/rm -r ${WD}
openSUSE Build Service is sponsored by