-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"// WARNING: Could not recover jumptable at 0x08000a94. Too many branches" #236
Comments
Ghidra 10.0 output: void drawBox(int param_1)
{
int iVar1;
undefined4 uVar2;
char *pcVar3;
undefined4 uVar4;
int *piVar5;
undefined4 uVar6;
char **ppcVar7;
undefined4 *puVar8;
undefined4 uVar9;
undefined4 uVar10;
int local_10;
stackCursor(gStk,*(undefined4 *)(param_1 + 0x10));
while (*(uint *)(gStk + 0xc) < *(uint *)(gStk + 8)) {
piVar5 = *(int **)(gStk + 0xc);
*(int **)(gStk + 0xc) = piVar5 + 2;
iVar1 = *piVar5;
switch(iVar1) {
case 0:
case 1:
case 2:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 0x13:
case 0x15:
puVar8 = *(undefined4 **)(gStk + 0xc);
*(undefined4 **)(gStk + 0xc) = puVar8 + 2;
uVar6 = *puVar8;
puVar8 = *(undefined4 **)(gStk + 0xc);
*(undefined4 **)(gStk + 0xc) = puVar8 + 2;
uVar2 = *puVar8;
switch(iVar1) {
case 3:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 4:
break;
case 5:
case 6:
uVar4 = stackNextText(gStk);
iVar1 = ncell;
ncell = ncell + 1;
puVar8 = (undefined4 *)uArray_dbg(cells,iVar1,"graphascii.c",0xcf);
uVar9 = *(undefined4 *)(gActive + 0x34);
uVar10 = __aeabi_i2f(*(undefined4 *)(gActive + 0x3c));
uVar10 = __aeabi_fdiv(uVar10,uVar9);
__aeabi_fdiv(uVar6,uVar10);
uVar6 = __aeabi_f2iz();
*puVar8 = uVar6;
uVar10 = *(undefined4 *)(gActive + 0x38);
uVar6 = __aeabi_i2f(*(undefined4 *)(gActive + 0x40));
uVar6 = __aeabi_fdiv(uVar6,uVar10);
uVar2 = __aeabi_fdiv(uVar2,uVar6);
puVar8[1] = uVar2;
puVar8[2] = uVar4;
break;
case 7:
puVar8 = *(undefined4 **)(gStk + 0xc);
*(undefined4 **)(gStk + 0xc) = puVar8 + 2;
iVar1 = ncell;
uVar4 = *puVar8;
ncell = ncell + 1;
puVar8 = (undefined4 *)uArray_dbg(cells,iVar1,"graphascii.c",0xd6);
uVar9 = *(undefined4 *)(gActive + 0x34);
uVar10 = __aeabi_i2f(*(undefined4 *)(gActive + 0x3c));
uVar10 = __aeabi_fdiv(uVar10,uVar9);
__aeabi_fdiv(uVar6,uVar10);
uVar6 = __aeabi_f2iz();
*puVar8 = uVar6;
uVar10 = *(undefined4 *)(gActive + 0x38);
uVar6 = __aeabi_i2f(*(undefined4 *)(gActive + 0x40));
uVar6 = __aeabi_fdiv(uVar6,uVar10);
uVar2 = __aeabi_fdiv(uVar2,uVar6);
puVar8[1] = uVar2;
puVar8[2] = uVar4;
break;
case 8:
ppcVar7 = *(char ***)(gStk + 0xc);
*(char ***)(gStk + 0xc) = ppcVar7 + 2;
iVar1 = ncell;
pcVar3 = *(char **)*ppcVar7;
if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
ncell = ncell + 1;
puVar8 = (undefined4 *)uArray_dbg(cells,iVar1,"graphascii.c",0xde);
uVar10 = *(undefined4 *)(gActive + 0x34);
uVar4 = __aeabi_i2f(*(undefined4 *)(gActive + 0x3c));
uVar4 = __aeabi_fdiv(uVar4,uVar10);
__aeabi_fdiv(uVar6,uVar4);
uVar6 = __aeabi_f2iz();
*puVar8 = uVar6;
uVar4 = *(undefined4 *)(gActive + 0x38);
uVar6 = __aeabi_i2f(*(undefined4 *)(gActive + 0x40));
uVar6 = __aeabi_fdiv(uVar6,uVar4);
uVar2 = __aeabi_fdiv(uVar2,uVar6);
puVar8[1] = uVar2;
puVar8[2] = pcVar3;
}
break;
case 0x13:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 0x15:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
}
break;
case 9:
case 10:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 0xb:
case 0xc:
case 0xe:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 0xd:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
break;
case 0xf:
puVar8 = *(undefined4 **)(gStk + 0xc);
*(undefined4 **)(gStk + 0xc) = puVar8 + 2;
iVar1 = gBoxGet(*puVar8);
drawBox(iVar1);
break;
case 0x10:
return;
case 0x11:
case 0x12:
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
if (iVar1 == 0x11) {
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
}
break;
case 0x14:
case 0x18:
piVar5 = *(int **)(gStk + 0xc);
*(int **)(gStk + 0xc) = piVar5 + 2;
local_10 = *piVar5;
if (2 < local_10) {
while (local_10 != 0) {
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
*(int *)(gStk + 0xc) = *(int *)(gStk + 0xc) + 8;
local_10 = local_10 + -1;
}
}
break;
default:
messout("Invalid action %d received in drawASCIIBox",iVar1);
}
}
return;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On ARM Clang-compiled file with
-O0
optimization there is a serious problem with switch table detection:Also for some reason the function name wasn't taken from the DWARF information.
This is the sourcecodereports:
Attached the binaries compiled with various options, this particular one is taken from
clang-arm-O0
file.graphascii.zip
The text was updated successfully, but these errors were encountered: