googleprojectzero / TinyInst

A lightweight dynamic instrumentation library
Apache License 2.0
1.18k stars 119 forks source link

When `-callconv` equals `fastcall`, is code in `Windows/debugger.cpp` corrent? #79

Closed singleghost2 closed 6 months ago

singleghost2 commented 6 months ago

In TinyInst/Windows/debugger.cpp, Why isn't the case of 3 parameters handled in fastcall? The third argument isn't saved.

  case CALLCONV_FASTCALL:
    if (num_args > 0) arguments[0] = lcContext.Rcx;
    if (num_args > 1) arguments[1] = lcContext.Rdx;
    if (num_args > 3) {
      ReadStack((void*)(sp + child_ptr_size), arguments + 2, num_args - 2);
    }
    break;
ifratric commented 6 months ago

Thanks for reporting! It should be fixed now.