rizinorg/rz-ghidra

Fix SystemZ failure

XVilka opened this issue · 2 comments

[XX] /home/travis/build/rizinorg/rz-ghidra/test/db/extras/asm_ghidra x86_16
rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Qc 'pdga
pdi 18
' rizin-testbins/mz/unzip.exe
-- stdout
--- expected
+++ actual
@@ -1,19 +1,0 @@
-0x000156a0   entry0:
-0x000156a0 MOV bp,ax
-0x000156a2 MOV ax,es
-0x000156a4 ADD ax,0x10
-0x000156a7 PUSH cs
-0x000156a8 POP ds
-0x000156a9 MOV [0x4],ax
-0x000156ac ADD ax,word ptr [0xc]
-0x000156b0 MOV es,ax
-0x000156b2 MOV cx,word ptr [0x6]
-0x000156b6 MOV di,cx
-0x000156b8 DEC di
-0x000156b9 MOV si,di
-0x000156bb STD
-0x000156bc MOVSB.REP es:di,si
-0x000156be PUSH ax
-0x000156bf MOV ax,0x34
-0x000156c2 PUSH ax
-0x000156c3 RETF
-- stderr
Warning: File is not MZ
terminate called after throwing an instance of 'LowlevelError'
-- exit status: -1

[XX] /home/travis/build/rizinorg/rz-ghidra/test/db/extras/ghidra x86_16
rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Qc 'pdgss
s 0x1c98
af
pdg
' rizin-testbins/mz/unzip.exe
-- stdout
--- expected
+++ actual
@@ -1,54 +1,0 @@
-x86:LE:16:Real Mode:
-
-// WARNING: Variable defined which should be unmapped: var_8h
-// WARNING: Variable defined which should be unmapped: var_4h
-// WARNING: Unknown calling convention yet parameter storage is locked
-// WARNING: [rz-ghidra] Matching calling convention fastcall of function fcn.00001c98 failed, args may be inaccurate.
-
-undefined4 fcn.00001c98(int16_t arg_8h, int16_t arg_6h, int16_t arg_eh)
-{
-    int16_t *piVar1;
-    undefined2 unaff_CS;
-    undefined2 unaff_DS;
-    undefined2 in_stack_00000006;
-    int16_t in_stack_00000008;
-    undefined4 uStack0008;
-    int16_t in_stack_0000000c;
-    int16_t var_8h;
-    int16_t var_6h;
-    int16_t var_4h;
-    int16_t var_2h;
-    char cStack4;
-    
-    var_6h = 0x13da;
-    do {
-        func_0x0000ec24(unaff_CS, var_6h, unaff_DS, 0x401e);
-        func_0x0000ec24(0xdee, arg_8h, in_stack_00000006, 0x401e);
-        func_0x0000e59a(0xdee, 0x401e);
-        var_2h = 0;
-        do {
-            cStack4 = func_0x0000eb82(0xdee);
-            if (cStack4 == '\r') {
-                cStack4 = '\n';
-            }
-            if (var_2h < in_stack_0000000c) {
-                *(char *)(in_stack_00000008 + var_2h) = cStack4;
-                var_2h = var_2h + 1;
-            }
-        } while (cStack4 != '\n');
-        piVar1 = (int16_t *)0x4022;
-        *piVar1 = *piVar1 + -1;
-        if (*piVar1 < 0) {
-            func_0x0000e4ae(0xdee, 10, 0x401e);
-        } else {
-            *(undefined *)*(undefined4 *)0x401e = 10;
-            piVar1 = (int16_t *)0x401e;
-            *piVar1 = *piVar1 + 1;
-        }
-        unaff_CS = 0xdee;
-        func_0x0000e59a(0xdee, 0x401e);
-        var_6h = 0x13db;
-    } while (*(char *)(in_stack_00000008 + var_2h + -1) != '\n');
-    *(undefined *)(in_stack_00000008 + var_2h + -1) = 0;
-    return uStack0008;
-}
-- stderr
Warning: File is not MZ
Could not match asm.arch sysz to sleigh arch.
Ghidra Decompiler Error: Could not match asm.arch sysz to sleigh arch.

Sounds like endian issue