_BYTE *__fastcall sub_3AA5F0(_BYTE *result, unsigned __int8 *a2) { int v2; // w8 _BYTE *v3; // x8 unsigned __int8 *v4; // x9 int v5; // t1 v2 = *a2; *result = v2; if ( v2 ) { v3 = result + 1; v4 = a2 + 1; do { v5 = *v4++; *v3++ = v5; } while ( v5 ); } return result; } 转Python写法
时间: 2023-03-14 20:13:54 浏览: 160
def sub_3AA5F0(result, a2):
v2 = a2[0]
result[0] = v2
if v2 != 0:
i = 1
while a2[i] != 0:
result[i] = a2[i]
i += 1
return result
相关问题
对下面的C语言伪代码函数进行分析 推测关于该函数的使用环境和预期目的详细的函数功能等信息 并为这个函数取一个新的名字 ) _BYTE *__fastcall sub_74918(int a1, int a2, int a3, int a4) { int v6; // r2 void *v7; // r0 void *v8; // r1 void *v9; // r3 int v10; // r10 char *v11; // r0 int v12; // r8 unsigned int v13; // r5 int i; // r1 unsigned int j; // r2 _BYTE *result; // r0 int v17; // r4 int v18; // r9 int k; // r6 char *v20; // r1 unsigned __int8 v22; // [sp+9h] [bp-27h] unsigned __int8 v23; // [sp+Ah] [bp-26h] unsigned __int8 v24; // [sp+Bh] [bp-25h] char v25; // [sp+Ch] [bp-24h] char v26; // [sp+Dh] [bp-23h] char v27; // [sp+Eh] [bp-22h] char v28; // [sp+Fh] [bp-21h] if ( a3 ) { v6 = 56; v7 = off_D7060; v8 = off_D7064; v9 = &unk_EA328; } else { v7 = off_D7068; v8 = off_D706C; v9 = &unk_EA329; v6 = 131; } v10 = ((int (__fastcall *)(void *, void *, int, void *, int))loc_74AC4)(v7, v8, v6, v9, a4); v11 = (char *)malloc(1u); if ( !v11 ) return 0; v12 = 0; LABEL_6: v13 = 0; while ( a2 != v13 ) { *(&v22 + v13) = *(_BYTE *)(a1 + v13); if ( ++v13 == 3 ) { v25 = v22 >> 2; v28 = v24 & 0x3F; v26 = (v23 >> 4) | (16 * (v22 & 3)); v27 = (v24 >> 6) | (4 * (v23 & 0xF)); v11 = (char *)realloc(v11, v12 + 4); a2 -= 3; a1 += 3; for ( i = 0; i != 4; ++i ) v11[v12 + i] = *(_BYTE *)(v10 + (unsigned __int8)*(&v25 + i)); v12 += 4; goto LABEL_6; } } if ( v13 ) { for ( j = v13; j <= 2; ++j ) *(&v22 + j) = 0; v25 = v22 >> 2; v28 = v24 & 0x3F; v26 = (v23 >> 4) | (16 * (v22 & 3)); v17 = 0; v27 = (v24 >> 6) | (4 * (v23 & 0xF)); while ( v13 + 1 != v17 ) { v11 = (char *)realloc(v11, v12 + v17 + 1); v11[v12 + v17] = *(_BYTE *)(v10 + (unsigned __int8)*(&v25 + v17)); ++v17; } v18 = v12 + v17; for ( k = 0; v13 + k <= 2; ++k ) { v11 = (char *)realloc(v11, v18 + k + 1); v20 = &v11[k]; v20[v12 + v17] = 61; } v12 = v18 + k; } result = realloc(v11, v12 + 1); result[v12] = 0; return result; }
off_D7068; v10 = a3; do { v11 = *(char **)(v7 + 4 * (a1 & 0xF) + 4 * (v6 & 0xF)); v12 = *(_BYTE *)(v7 + 4 * (a1 & 0xF) + 4 * (v6 & 0xF)); v13 = (unsigned __int8)v11[a2 & 0xF]; for ( i = 0; i < v10; ++i ) { j = (unsigned __int8)v11[a2 & 0xF]; if ( v13 > j ) v13 = j; ++v11; } v17 = 0; v18 = 0; for ( k = 0; k < v12; ++k ) { v20 = *(char **)(v8 + 4 * (a1 & 0xF) + 4 * (v6 & 0xF)); if ( (unsigned __int8)v20[a2 & 0xF] == v13 ) ++v17; ++v18; ++v20; } v22 = 0; *(_BYTE *)(v9 + 4 * (a1 & 0xF) + 4 * (v6 & 0xF)) = v17; v23 = 0; v24 = 0; v25 = 0; v26 = 0; v27 = 0; v28 = 0; result = (_BYTE *)sub_749E8(a1, v6, &v22); v6 += 8; v10 -= 8; } while ( v10 > 0 ); } else { result = 0; } return result; }这个函数可以用来计算特定条件下字符串数组中的最小值。我可以将其命名为calculateMinimumValueOfStringArray()。
int __fastcall sub_BB28(const char *a1, _DWORD *a2, int a3, const char *a4)
这是一段使用了 __fastcall 调用约定的函数,它的功能可能与字符串相关。下面是每个参数的解释:
- a1:指向字符串的指针,可能是输入参数。
- a2:指向 _DWORD 类型的指针,可能是输出参数。
- a3:整数类型的参数,可能是输入参数。
- a4:指向字符串的指针,可能是输入参数。
该函数的返回值类型未知,因为代码片段中没有提供该信息。
阅读全文