Skip to content

Instantly share code, notes, and snippets.

@dbeinder
Created July 24, 2020 20:35
Show Gist options
  • Save dbeinder/6c4dac8df91fb4b1b1537bafa8136065 to your computer and use it in GitHub Desktop.
Save dbeinder/6c4dac8df91fb4b1b1537bafa8136065 to your computer and use it in GitHub Desktop.
xunlong fixes a driver...
void __fastcall sun8i_ths_get_temp(int a1)
{
int v1;
int v2;
int *v3;
int *v4;
int v5;
int (__fastcall *v6)(_DWORD);
int v7;
int v8;
int v9;
v1 = _gnu_mcount_nc(a1);
v2 = *(_DWORD *)v1;
v4 = v3;
v8 = 0;
v5 = v1;
regmap_read(*(_DWORD *)(v2 + 8), *(_DWORD *)(*(_DWORD *)v2 + 20) + 4 * *(_DWORD *)(v1 + 8), &v8);
if ( v8 )
{
v6 = *(int (__fastcall **)(_DWORD))(*(_DWORD *)v2 + 36);
if ( v6 )
v7 = v6(*(_DWORD *)(v5 + 8));
else
v7 = *(_DWORD *)(*(_DWORD *)v2 + 12) * v8 / -10 + *(_DWORD *)(*(_DWORD *)v2 + 8);
*v4 = v7;
*v4 = v7 + *(_DWORD *)(*(_DWORD *)v2 + 16) + 30000;
}
JUMPOUT(__CS__, v9);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment