[General Topics] melontini:
No major updates, but Ghidra seems to do a slighty better decompile job.

longlong FUN_000101f8(longlong *param_1)
{
longlong lVar1;
char cVar2;
longlong *plVar3;
longlong lVar4;
char *pcVar5;
char in_w2;
undefined uVar6;
longlong *plVar7;
undefined in_w3;
undefined in_w4;
undefined in_w5;
undefined in_w6;
undefined in_w7;
longlong lVar8;
undefined8 *puVar9;
longlong lVar10;
longlong lVar11;
longlong lVar12;
undefined8 *puVar13;
longlong lVar14;
longlong *plVar15;
longlong *plVar16;
longlong lVar17;
undefined4 in_stack_ffffffffffffff80;
undefined4 uVar18;
undefined4 in_stack_ffffffffffffff84;

plVar3 = FUN_00032f78();
lVar17 = *plVar3;
*plVar3 = lVar17 + -0x470;
lVar1 = DAT_0005e528;
*(longlong *)(lVar17 + -8) = DAT_0005e528;
if (DAT_00063378 == 0) {
in_w2 = 'x';
lVar8 = (**(code **)(DAT_00063310 + 0x140))(&DAT_0005de44,0);
if (lVar8 != 0) {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
FUN_000356d4(0x80000000,
(byte *)"RSA: Failed to LocateProtocol gEfiQcomASN1X509ProtocolGuid %r\n",
(char)lVar8,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
}
goto LAB_000107d4;
}
}
lVar8 = -0x7ffffffffffffffe;
lVar4 = FUN_000475fc();
lVar11 = DAT_00063378;
if (lVar4 == 0) {
lVar8 = -0x7ffffffffffffff7;
goto LAB_000107d4;
}
lVar12 = *param_1;
lVar14 = param_1[1];
*(undefined8 *)(lVar17 + -0x58) = 0;
*(undefined8 *)(lVar17 + -0x50) = 0;
lVar10 = lVar8;
if ((lVar11 != 0) && (lVar10 = -0x7ffffffffffffffe, lVar12 != 0)) {
in_w2 = (char)lVar17 + -0x58;
lVar10 = (**(code **)(DAT_00063310 + 0x140))(&DAT_0005de24,0);
if (lVar10 == 0) {
in_w2 = (char)lVar17 + -0x50;
lVar10 = (***(code ***)(lVar17 + -0x58))(*(code ***)(lVar17 + -0x58),&DAT_0005de34);
if (lVar10 == 0) {
if (*(longlong *)(lVar17 + -0x50) == 0x20) {
lVar10 = (**(code **)(*(longlong *)(lVar17 + -0x58) + 0x10))
(*(longlong *)(lVar17 + -0x58),&DAT_0005de34);
if (lVar10 == 0) {
in_w2 = (char)lVar14;
lVar10 = (**(code **)(*(longlong *)(lVar17 + -0x58) + 0x18))
(*(longlong *)(lVar17 + -0x58),lVar12);
if (lVar10 == 0) {
lVar10 = (**(code **)(*(longlong *)(lVar17 + -0x58) + 0x20))
(*(longlong *)(lVar17 + -0x58),lVar17 + -0x48);
if (lVar10 == 0) {
in_w2 = (char)*(undefined8 *)(lVar17 + -0x50);
(**(code **)(DAT_00063310 + 0x160))(lVar4,lVar17 + -0x48);
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "GetDataHash: HashFinal unsuccessful! Status: %r\n";
goto LAB_00010378;
}
}
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "GetDataHash: HashUpdate unsuccessful!Status: %r\n";
goto LAB_00010378;
}
}
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "GetDataHash: HashInit unsuccessful! Status: %r\n";
goto LAB_00010378;
}
}
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 == '\0') || (cVar2 = FUN_00035b70(-0x80000000), cVar2 == '\0')) {
lVar10 = 0x50;
}
else {
in_w2 = ' ';
in_w3 = (undefined)*(undefined8 *)(lVar17 + -0x50);
FUN_000356d4(0x80000000,
(byte *)"GetDataHash: Invalid size! HashSize: %d, DigestSize: %d\n",0x20,
in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
lVar10 = 0x50;
}
}
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "GetDataHash: GetHashSize unsuccessful! Status: %r\n";
goto LAB_00010378;
}
}
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "GetDataHash: LocateProtocol unsuccessful!Status: %r\n";
LAB_00010378:
lVar11 = lVar10;
FUN_000356d4(0x80000000,(byte *)pcVar5,(char)lVar10,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
in_w2 = (char)lVar11;
}
}
}
if (lVar10 == 0) {
uVar18 = *(undefined4 *)(param_1 + 3);
puVar13 = (undefined8 *)(lVar17 + -0x460);
lVar11 = param_1[2];
FUN_00045ce8((longlong)puVar13,0,0x48);
plVar15 = (longlong *)(lVar17 + -0x468);
uVar6 = 0;
*plVar15 = 0;
FUN_0000cae4(puVar13,0x48,0);
if (lVar11 == 0) {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
FUN_000356d4(0x80000000,(byte *)"VerifyHashWithRSASignature:Invalid pointer\n",uVar6,in_w3,
in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
}
}
else {
lVar8 = FUN_000475fc();
plVar16 = (longlong *)(lVar17 + -0x448);
*plVar16 = lVar8;
if (lVar8 == 0) {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "VerifyHashWithRSASignature: mem allocation err for Key.N\n";
LAB_0001053c:
FUN_000356d4(0x80000000,(byte *)pcVar5,uVar6,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
}
LAB_00010544:
lVar8 = 0x50;
lVar11 = *plVar16;
}
else {
lVar8 = FUN_000475fc();
*(longlong *)(lVar17 + -0x458) = lVar8;
if (lVar8 == 0) {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "VerifyHashWithRSASignature: mem allocation err for Key.e\n";
goto LAB_0001053c;
}
goto LAB_00010544;
}
plVar7 = plVar15;
lVar8 = (**(code **)(DAT_00063310 + 0x140))(&DAT_0005de54,0);
uVar6 = SUB81(plVar7,0);
if (lVar8 == 0) {
uVar6 = (undefined)*(undefined4 *)(param_1 + 6);
puVar9 = (undefined8 *)(lVar17 + -0x210);
lVar8 = (**(code **)(*plVar15 + 8))(*plVar15,param_1[4]);
in_w3 = SUB81(puVar9,0);
if (lVar8 == 0) {
uVar6 = (undefined)*(undefined4 *)(param_1 + 9);
puVar9 = (undefined8 *)(lVar17 + -0x418);
lVar8 = (**(code **)(*plVar15 + 8))(*plVar15,param_1[7]);
in_w3 = SUB81(puVar9,0);
if (lVar8 == 0) {
FUN_00045c34(*(undefined8 **)(lVar17 + -0x448),(undefined8 *)(lVar17 + -0x210),0x208);
puVar9 = *(undefined8 **)(lVar17 + -0x458);
FUN_00045c34(puVar9,(undefined8 *)(lVar17 + -0x418),0x208);
*(undefined4 *)(puVar9 + 0x41) = 0;
uVar6 = 1;
*(undefined4 *)puVar13 = 0;
in_w3 = 0;
in_w4 = 3;
in_w6 = 0x20;
lVar8 = (**(code **)(*plVar15 + 0x10))(*plVar15,puVar13);
in_w7 = (undefined)lVar11;
in_w5 = (undefined)lVar4;
cVar2 = FUN_00035b48();
if (lVar8 == 0) {
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(0x400000), cVar2 != '\0')) {
uVar6 = 0;
FUN_000356d4(0x400000,(byte *)
"VerifyHashWithRSASignature: SecRSAVerifySig success! Status: %r\n"
,0,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,uVar18));
}
lVar8 = 0;
lVar11 = *plVar16;
in_stack_ffffffffffffff80 = uVar18;
goto joined_r0x00010778;
}
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
pcVar5 = "VerifyHashWithRSASignature: SecRSAVerifySig failed! Status: %r\n";
goto LAB_00010768;
}
}
else {
cVar2 = FUN_00035b48();
uVar18 = in_stack_ffffffffffffff80;
if ((cVar2 != '\0') &&
(cVar2 = FUN_00035b70(-0x80000000), uVar18 = in_stack_ffffffffffffff80,
cVar2 != '\0')) {
pcVar5 =
"VerifyHashWithRSASignature: SecRSABigIntReadBin for Modulus failed! Status: %r\n";
LAB_00010768:
lVar11 = lVar8;
FUN_000356d4(0x80000000,(byte *)pcVar5,(char)lVar8,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,uVar18));
uVar6 = (undefined)lVar11;
}
}
goto LAB_00010774;
}
cVar2 = FUN_00035b48();
if (cVar2 != '\0') {
cVar2 = FUN_00035b70(-0x80000000);
uVar18 = in_stack_ffffffffffffff80;
if (cVar2 != '\0') {
pcVar5 =
"VerifyHashWithRSASignature: SecRSABigIntReadBin for Modulus failed!Status: %r\n";
goto LAB_00010768;
}
goto LAB_00010774;
}
lVar11 = *plVar16;
}
else {
cVar2 = FUN_00035b48();
uVar18 = in_stack_ffffffffffffff80;
if ((cVar2 != '\0') &&
(cVar2 = FUN_00035b70(-0x80000000), uVar18 = in_stack_ffffffffffffff80, cVar2 != '\0'))
{
pcVar5 = "VerifyHashWithRSASignature: LocateProtocol failed, Status: %r\n";
goto LAB_00010768;
}
LAB_00010774:
lVar11 = *plVar16;
in_stack_ffffffffffffff80 = uVar18;
}
}
joined_r0x00010778:
if (lVar11 != 0) {
FUN_00047620();
}
if (*(longlong *)(lVar17 + -0x458) != 0) {
FUN_00047620();
}
}
if (lVar8 == 0) {
lVar8 = 0;
}
else {
cVar2 = FUN_00035b48();
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
FUN_000356d4(0x80000000,(byte *)"Failed to verify hash\n",uVar6,in_w3,in_w4,in_w5,in_w6,
in_w7,CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
}
}
}
else {
cVar2 = FUN_00035b48();
lVar8 = lVar10;
if ((cVar2 != '\0') && (cVar2 = FUN_00035b70(-0x80000000), cVar2 != '\0')) {
FUN_000356d4(0x80000000,(byte *)"Failed to get hash\n",in_w2,in_w3,in_w4,in_w5,in_w6,in_w7,
CONCAT44(in_stack_ffffffffffffff84,in_stack_ffffffffffffff80));
}
}
FUN_00047620();
LAB_000107d4:
if (lVar1 != *(longlong *)(lVar17 + -8)) {
// WARNING: Subroutine does not return
FUN_000181c4();
}
*plVar3 = lVar17;
return lVar8;
}