floomm / ghidrion

2 stars 0 forks source link

Implementing diff view #39

Closed riesentoaster closed 1 year ago

riesentoaster commented 1 year ago

Screenshot

image

Abridged YAML

states:
  entry:
    addr: '0x004006a4'
    mems:
      '0x0': ['0x0']
      '0x1': ['0x1']
      '0x2': ['0x0', '$$']
      '0x3': ['0x1', '$$']
      '0x4': ['0x0']
      '0x5': ['0x1']
      '0x6': ['0x0', '$$']
      '0x7': ['0x1', '$$']
    regs:
      'a': ['0xa']
  leave:
    addr: '0x0040075c'
    mems:
      '0x0': ['0x0']
      '0x1': ['0x0']
      '0x2': ['0x0', '$$']
      '0x3': ['0x0', '$$']
      '0x4': ['0x0', '$$']
      '0x5': ['0x0', '$$']
      '0x6': ['0x0']
      '0x7': ['0x0']
      '0x8': ['0x0']
      '0x9': ['0x0', '$$']
    regs:
      'a': ['0xa']

Color meanings

Further ToDos

floomm commented 1 year ago

Closes #38 as well.

riesentoaster commented 1 year ago

Testing related to #38 (only excerpts of the yaml file in examples):

Hooks

Empty function

hooks:
  libc:
    memcmp:

Broken, should either throw custom error or just ignore it since no data is there and it's not like we'd lose anything.

Empty library

hooks:
  libc:

Broken, should either throw custom error or just ignore it since no data is there and it's not like we'd lose anything.

No libraries

hooks:

Broken, should either throw custom error or just ignore it since no data is there and it's not like we'd lose anything.

No hooks

Throws a custom error. One could also argue that this isn't necessarily required, one might have a trace without hooks.

Info

No info entry

Works correctly (nothing added, no errors).

Empty info entry

info:

Works correctly (nothing added, no errors).

Incomplete info entry

info: { arch: armv7 }

Works correctly (nothing added, no errors) (well or at least it doesn't throw and we don't claim to do syntax checking).

Instructions

Incomplete entry

instructions:
  - ['0x004006a4']

Works correctly, throws custom error

No entries

instructions:

Broken, throws random error. Should throw custom error (since a trace without any instructions makes no sense) or ignore it (in case a user wants no coloring but just the diff view).

No key

Throws custom error, is fine (except we might want to ignore it with the same reasoning as above, but I'm fine with either).

State

Nothing (no states entry)

Is ignored, fine by me.

No entry or leave state

Is ignored, fine by me.

No addr

Is ignored, fine by me.

No mems/regs

Is ignored, fine by me

Empty mems/regs (keyword present but no entries):

Broken, throws random exception. Should either throw custom exception or be ignored.

Broken entries

Throws custom exception, works.

riesentoaster commented 1 year ago

Also, something else: The file picker for the importing should not be the save as dialog. And while you're at it: If no file is chosen, don't show an error message, just ignore it.

image
riesentoaster commented 1 year ago

Three more bug:

Good job otherwise!