Closed arkup closed 4 years ago
@arkup, try to set a0 register for your code.
To do this, just select code (menu Select -> Instructions) and press Ctrl-R. For test you can use any value, but to correct disassembly you should find a0 assignment in startup code.
PS
// assume a0 = 0x0
void FUN_00000000(uint *param_1)
{
uint uVar1;
uVar1 = uRamffff8184;
param_1[2] = uRamffff8184 >> 6 & 7;
*(ushort *)((int)param_1 + 6) = (ushort)!(bool)((byte)(uVar1 >> 2) & 1 & (byte)(uVar1 >> 2) & 1);
*(ushort *)(param_1 + 1) = (ushort)(uVar1 >> 3) & 1;
*param_1 = uVar1 >> 4 & 3;
param_1[3] = uRamffff8188 & 0xfffffffc;
param_1[4] = (uRamffff8134 >> 0xf & 1) << 2 | (uint)((int)uRamffff8134 < 0);
uVar1 = (uRamffff8138 >> 0x1f) << 1 | (uRamffff8138 >> 0xf & 1) << 3;
param_1[4] = param_1[4] & ~uVar1 | uVar1;
return;
}
I didn't write any Java with the initial PR. I think duplicating the code from MIPS and gp
for example may do the similar auto-analysis things for a0
/a1
/a8
/a9
.
Ghidra/Processors/MIPS/src/main/java/ghidra/app/plugin/core/analysis/MipsAddressAnalyzer.java
@esaulenka great! thanks a lot for the info
Describe the bug Tricore decompile is great but sometimes I get "Unknown Error". I don't know what is the issue, perhaps unsupported instruction in SLEIGH language e.g.
To Reproduce Steps to reproduce the behavior:
echo GQ8EaDcPYyNZQggAB/8CIflCBgA3D+EhNw9i8vlCBABsQBkPCGiPP8DxbEMZAjRINwLh9wYviwIg9WxEGQ84SI8fHiA3D+H3BhIGP6byAiNJQlAIAJA= | base64 -d > tricore_func.bin
Expected behavior Decompiled function.
Environment (please complete the following information):