问题
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