bengxu8952
bengxu8952
2017-03-08 14:04

SO库通过IDA反汇编,求大神解释

  • 算法
  • 汇编
  • 加密

SO库通过IDA反汇编如下代码,求大神告知这是何等算法,只是单纯的des加密么

 int __fastcall Java_com_yukang_yyjk_util_DesUtil_makeskey(_DWORD *a1)
{
  int v1; // r2@1
  _DWORD *v2; // r4@1
  char *s; // ST08_4@1
  char *v4; // ST10_4@1
  char *v5; // ST14_4@1
  size_t v6; // r7@1
  size_t n; // ST0C_4@1
  size_t v8; // ST18_4@1
  void *v9; // r5@1
  char *v10; // r3@1
  int v11; // r6@3
  int result; // r0@3
  int v13; // [sp+30h] [bp-38h]@1
  int v14; // [sp+34h] [bp-34h]@1
  int v15; // [sp+38h] [bp-30h]@1
  char v16; // [sp+3Ch] [bp-2Ch]@1
  int v17; // [sp+4Ch] [bp-1Ch]@1

  v1 = *a1;
  v17 = _stack_chk_guard;
  v2 = a1;
  s = (char *)(*(int (**)(void))(v1 + 676))();
  v4 = (char *)(*(int (__fastcall **)(_DWORD *))(*v2 + 676))(v2);
  v5 = (char *)(*(int (__fastcall **)(_DWORD *))(*v2 + 676))(v2);
  v14 = 1580348513;
  v13 = 1715758187;
  v15 = 4203302;
  v6 = j_j_strlen(s);
  n = j_j_strlen(v4);
  v8 = j_j_strlen(v5);
  j_j_memset(&v16, 0, 0x10u);
  v9 = j_j_malloc(v6 + n + v8 + 24);
  j_j_memcpy(v9, s, v6);
  j_j_memcpy((char *)v9 + v6, v4, n);
  j_j_memcpy((char *)v9 + v6 + n, v5, v8);
  j_j_memcpy((char *)v9 + v6 + n + v8, "98765432abcdefgh11223344", 0x18u);
  v10 = (char *)v9;
  do
  {
    *v10 ^= v10[8] ^ v10[16];
    ++v10;
  }
  while ( v10 != (char *)v9 + 8 );
  desenc_ecb(v9, 8, &v13, &v16);
  (*(void (__fastcall **)(_DWORD *))(*v2 + 680))(v2);
  (*(void (__fastcall **)(_DWORD *))(*v2 + 680))(v2);
  (*(void (__fastcall **)(_DWORD))(*v2 + 680))(v2);
  v11 = (*(int (__fastcall **)(_DWORD *, signed int))(*v2 + 704))(v2, 8);
  (*(void (__fastcall **)(_DWORD *, int, _DWORD, signed int))(*v2 + 832))(v2, v11, 0, 8);
  j_j_free(v9);
  result = v11;
  if ( v17 != _stack_chk_guard )
    j_j___stack_chk_fail(v11);
  return result;
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答