Hex-Rays decompiles array to int

拈花ヽ惹草 提交于 2019-12-12 02:59:31

问题


I decompiled one dll using Hex-Ray but it decompiled array type input argument of dll to int. Any idea how to handle this ??

double dzSell(int a1, double a2, int a3, int a4, int a5)

int a1 is array type in dll


回答1:


here is the example how Hex-Rays decompile pointers

/* The computational routine */
extern "C" __declspec(dllexport) void myfun2 (double x, double *y, double *z, int n)
{
    int i;
    /* multiply each element y by x */
    for (i=0; i<n; i++) {
        z[i] = x * y[i];
    }
}


/*
int __cdecl myfun2(double a1, int a2, int a3, int a4)
{
  int result; // eax@3
  int i; // [sp+0h] [bp-4h]@1

  for ( i = 0; i < a4; ++i )
  {
    *(double *)(a3 + 8 * i) = a1 * *(double *)(a2 + 8 * i);
    result = i + 1;
  }
  return result;
}
*/

so clearly pointer variables are converted to int, it means that casting double * -> int must be done as a2 and a3 are used to access the array. For proper casting i used (uintptr_t)buffer



来源:https://stackoverflow.com/questions/35026068/hex-rays-decompiles-array-to-int

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!