skwudi
BiuBiu_Guang
2019-03-25 09:37

C语言转JAVA(我不会C语言)急用

5
  • java
  • c语言
int __fastcall Java_com_yxcorp_gifshow_util_CPU_getClock(int *a1, int a2, int a3, int a4, int a5)
{
  int v5; // r5
  int v6; // r6
  _DWORD *v7; // r0
  int v8; // r3
  _DWORD *v9; // r4
  int *v10; // r3
  int v11; // r1
  int v12; // r7
  int v13; // r0
  int v14; // r5
  unsigned int v15; // r5
  unsigned int v16; // r2
  int v17; // r1
  int v18; // r0
  unsigned int v19; // r9
  unsigned int v20; // lr
  int v21; // lr
  int v22; // r5
  unsigned int v23; // r2
  int v24; // ST0C_4
  unsigned int v25; // r2
  unsigned int v26; // r7
  bool v27; // zf
  signed int v28; // r6
  signed int v29; // r8
  int v30; // r2
  int v31; // r3
  char *v32; // r8
  char *v33; // r7
  int v34; // t1
  char *v35; // r0
  _DWORD *v37; // r0
  _DWORD *v38; // r3
  _DWORD *v39; // r1
  int v40; // r0
  int *v41; // r3
  int v42; // r0
  int v43; // r4
  int v44; // r7
  int v45; // r5
  unsigned int v46; // r5
  unsigned int v47; // r1
  int v48; // r0
  int v49; // r4
  unsigned int v50; // r9
  unsigned int v51; // lr
  int v52; // lr
  int v53; // r5
  unsigned int v54; // r1
  int v55; // ST0C_4
  unsigned int v56; // r1
  unsigned int v57; // r7
  int v58; // r6
  signed int v59; // [sp+4h] [bp-F4h]
  signed int v60; // [sp+4h] [bp-F4h]
  int v61; // [sp+8h] [bp-F0h]
  int v62; // [sp+8h] [bp-F0h]
  char *s; // [sp+10h] [bp-E8h]
  char *sa; // [sp+10h] [bp-E8h]
  int v65; // [sp+18h] [bp-E0h]
  int *v66; // [sp+18h] [bp-E0h]
  int *v67; // [sp+1Ch] [bp-DCh]
  char *v68; // [sp+20h] [bp-D8h]
  int v69; // [sp+24h] [bp-D4h]
  void *ptr; // [sp+28h] [bp-D0h]
  _DWORD *ptra; // [sp+28h] [bp-D0h]
  char *v72; // [sp+30h] [bp-C8h]
  int v73; // [sp+34h] [bp-C4h]
  char v74[4]; // [sp+40h] [bp-B8h]
  int v75; // [sp+44h] [bp-B4h]
  int v76; // [sp+48h] [bp-B0h]
  int v77; // [sp+4Ch] [bp-ACh]
  int v78; // [sp+50h] [bp-A8h]
  int v79; // [sp+54h] [bp-A4h]
  int v80; // [sp+58h] [bp-A0h]
  int v81; // [sp+5Ch] [bp-9Ch]
  char v82; // [sp+60h] [bp-98h]
  char v83; // [sp+64h] [bp-94h]
  char v84; // [sp+BBh] [bp-3Dh]
  char v85; // [sp+CBh] [bp-2Dh]

  v69 = a4;
  v67 = a1;
  v73 = a3;
  if ( !a4 )
    return 0;
  if ( cpu_inited )
  {
    v5 = cpu_cnt;
    if ( !cpu_cnt )
      goto LABEL_4;
    return 0;
  }
  v37 = malloc(0x20u);
  ptra = v37;
  v38 = v37;
  v39 = v37;
  v40 = 0;
  *v38 = 0;
  v38 += 2;
  v39[1] = 0;
  *v38 = 0;
  ++v38;
  *v38 = 0;
  ++v38;
  *v38 = 0;
  ++v38;
  *v38 = 0;
  ++v38;
  *v38 = 0;
  v38[1] = 0;
  do
  {
    *((_BYTE *)v39 + v40) = byte_5EF0[v40];
    ++v40;
  }
  while ( v40 != 32 );
  v72 = (char *)malloc(0x20u);
  sa = v72;
  v66 = (int *)&cpu_type_names;
  do
  {
    v41 = &KeyIndex;
    v42 = v66[1];
    v43 = v66[2];
    v44 = v66[3];
    v62 = *v66;
    v60 = 8;
    do
    {
      v45 = v41[55];
      v41 -= 7;
      v46 = ptra[v45] + v62;
      v47 = ptra[v41[61]] + v44;
      v48 = v42 ^ __ROR4__(
                    H[(unsigned __int8)v46] | (H[v46 >> 24] << 24) | (H[(unsigned __int16)v46 >> 8] << 8) | (H[(v46 >> 16) & 0xFF] << 16),
                    27);
      v49 = v43 ^ __ROR4__(
                    H[(unsigned __int8)v47] | (H[v47 >> 24] << 24) | (H[(unsigned __int16)v47 >> 8] << 8) | (H[(v47 >> 16) & 0xFF] << 16),
                    11);
      v50 = v48 + ptra[v41[60]];
      v51 = ptra[v41[59]] + v48 + v49;
      v52 = v60 ^ __ROR4__(
                    H[(unsigned __int8)v51] | (H[v51 >> 24] << 24) | (H[(unsigned __int16)v51 >> 8] << 8) | (H[(v51 >> 16) & 0xFF] << 16),
                    11);
      v53 = v49 - v52;
      v54 = ptra[v41[58]] + v49 - v52;
      v55 = v52 + v48;
      v43 = v44
          + __ROR4__(
              H[(unsigned __int8)v54] | (H[v54 >> 24] << 24) | (H[(unsigned __int16)v54 >> 8] << 8) | (H[(v54 >> 16) & 0xFF] << 16),
              19);
      v56 = ptra[v41[56]] + v43;
      v42 = v62
          - __ROR4__(
              H[(unsigned __int8)v50] | (H[v50 >> 24] << 24) | (H[(unsigned __int16)v50 >> 8] << 8) | (H[(v50 >> 16) & 0xFF] << 16),
              19);
      v57 = ptra[v41[57]] + v42;
      v62 = v53 ^ __ROR4__(
                    H[(unsigned __int8)v56] | (H[v56 >> 24] << 24) | (H[(unsigned __int16)v56 >> 8] << 8) | (H[(v56 >> 16) & 0xFF] << 16),
                    27);
      v27 = v60-- == 1;
      v44 = v55 ^ __ROR4__(
                    H[(unsigned __int8)v57] | (H[v57 >> 24] << 24) | (H[(unsigned __int16)v57 >> 8] << 8) | (H[(v57 >> 16) & 0xFF] << 16),
                    11);
    }
    while ( !v27 );
    v58 = (int)(sa + 16);
    *(_DWORD *)(v58 - 16) = v43;
    *(_DWORD *)(v58 - 12) = v62;
    *(_DWORD *)(v58 - 8) = v44;
    *(_DWORD *)(v58 - 4) = v42;
    v66 += 4;
    sa += 16;
  }
  while ( (char *)v58 != v72 + 32 );
  free(ptra);
  v5 = checkCpuProperty(v67, v73, v72, a5);
  cpu_cnt = v5;
  free(v72);
  cpu_inited = 1;
  if ( v5 )
    return 0;
LABEL_4:
  v6 = *v67;
  v65 = *v67;
  v68 = (char *)(*(int (__fastcall **)(int *, int, int))(*v67 + 736))(v67, v69, v5);
  ptr = (void *)(*(int (__fastcall **)(int *, int))(v6 + 684))(v67, v69);
  v7 = malloc(0x20u);
  v8 = v5;
  v9 = v7;
  *v7 = v5;
  v7[1] = v5;
  v7[2] = v5;
  v7[3] = v5;
  v7[4] = v5;
  v7[5] = v5;
  v7[6] = v5;
  v7[7] = v5;
  do
  {
    *((_BYTE *)v7 + v8) = byte_5EF0[v8];
    ++v8;
  }
  while ( v8 != 32 );
  v59 = 8;
  s = (char *)malloc(0x10u);
  v10 = &KeyIndex;
  v11 = 1587387239;
  v12 = -921724529;
  v61 = 968266410;
  v13 = 1161383454;
  do
  {
    v14 = v10[55];
    v10 -= 7;
    v15 = v9[v14] + v61;
    v16 = v9[v10[61]] + v12;
    v17 = v11 ^ __ROR4__(
                  H[(unsigned __int8)v15] | (H[v15 >> 24] << 24) | (H[(unsigned __int16)v15 >> 8] << 8) | (H[(v15 >> 16) & 0xFF] << 16),
                  27);
    v18 = v13 ^ __ROR4__(
                  H[(unsigned __int8)v16] | (H[v16 >> 24] << 24) | (H[(unsigned __int16)v16 >> 8] << 8) | (H[(v16 >> 16) & 0xFF] << 16),
                  11);
    v19 = v17 + v9[v10[60]];
    v20 = v9[v10[59]] + v17 + v18;
    v21 = v59 ^ __ROR4__(
                  H[(unsigned __int8)v20] | (H[v20 >> 24] << 24) | (H[(unsigned __int16)v20 >> 8] << 8) | (H[(v20 >> 16) & 0xFF] << 16),
                  11);
    v22 = v18 - v21;
    v23 = v9[v10[58]] + v18 - v21;
    v24 = v21 + v17;
    v13 = v12
        + __ROR4__(
            H[(unsigned __int8)v23] | (H[v23 >> 24] << 24) | (H[(unsigned __int16)v23 >> 8] << 8) | (H[(v23 >> 16) & 0xFF] << 16),
            19);
    v25 = v9[v10[56]] + v13;
    v11 = v61
        - __ROR4__(
            H[(unsigned __int8)v19] | (H[v19 >> 24] << 24) | (H[(unsigned __int16)v19 >> 8] << 8) | (H[(v19 >> 16) & 0xFF] << 16),
            19);
    v26 = v9[v10[57]] + v11;
    v61 = v22 ^ __ROR4__(
                  H[(unsigned __int8)v25] | (H[v25 >> 24] << 24) | (H[(unsigned __int16)v25 >> 8] << 8) | (H[(v25 >> 16) & 0xFF] << 16),
                  27);
    v27 = v59-- == 1;
    v12 = v24 ^ __ROR4__(
                  H[(unsigned __int8)v26] | (H[v26 >> 24] << 24) | (H[(unsigned __int16)v26 >> 8] << 8) | (H[(v26 >> 16) & 0xFF] << 16),
                  11);
  }
  while ( !v27 );
  *((_DWORD *)s + 3) = v11;
  *((_DWORD *)s + 1) = v61;
  *(_DWORD *)s = v13;
  *((_DWORD *)s + 2) = v12;
  free(v9);
  *(_DWORD *)v74 = v59;
  v75 = v59;
  v76 = v59;
  v77 = v59;
  v78 = v59;
  v79 = v59;
  v80 = v59;
  v81 = v59;
  v82 = v59;
  v28 = strlen(s);
  cpu_clock_start(&v83);
  cpu_clock_x((unsigned __int8 *)&v83, v68, (unsigned int)ptr);
  if ( v28 > 0 )
  {
    v29 = v59;
    do
    {
      v30 = (unsigned __int8)s[v29];
      v31 = (unsigned __int8)s[v29 + 1];
      v29 += 2;
      sprintf(v74, "%c%c", v30, v31);
      cpu_clock_x((unsigned __int8 *)&v83, v74, 2u);
    }
    while ( v28 > v29 );
  }
  cpu_clock_release(&v83);
  v32 = &v84;
  v33 = v74;
  do
  {
    v34 = (unsigned __int8)(v32++)[1];
    v35 = v33;
    v33 += 2;
    sprintf(v35, "%02x", v34);
  }
  while ( v32 != &v85 );
  (*(void (__fastcall **)(int *, int, char *, signed int))(v65 + 768))(v67, v69, v68, 2);
  free(s);
  return (*(int (__fastcall **)(int *, char *))(v65 + 668))(v67, v74);
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐