[re]-4-transform

IDA源码:

int __fastcall main(int argc, const char **argv, const char **envp)
{
  char input[104]; // [rsp+20h] [rbp-70h] BYREF
  int j; // [rsp+88h] [rbp-8h]
  int i; // [rsp+8Ch] [rbp-4h]

  _unknown_library_function_3(argc, argv, envp);
  outputf("Give me your code:\n");
  inputf("%s", input);
  if ( strlen(input) != 33 )
  {
    outputf("Wrong!\n");
    system("pause");
    exit(0);
  }
  for ( i = 0; i <= 32; ++i )
  {
    b40[i] = input[dw40[i]];
    b40[i] ^= LOBYTE(dw40[i]);
  }
  for ( j = 0; j <= 32; ++j )
  {
    if ( br40[j] != b40[j] )
    {
      outputf("Wrong!\n");
      system("pause");
      exit(0);
    }
  }
  outputf("Right!Good Job!\n");
  outputf("Here is your flag: %s\n", input);
  system("pause");
  return 0;
}

 修改后查看逻辑:根据输入的数组,打乱顺序赋值,再根据索引数组异或;和最终结果比较。如下exp(反过来操作就可以了)


cipher=[0x67, 0x79, 0x7B, 0x7F, 0x75, 0x2B, 0x3C, 0x52, 0x53, 0x79,
  0x57, 0x5E, 0x5D, 0x42, 0x7B, 0x2D, 0x2A, 0x66, 0x42, 0x7E,
  0x4C, 0x57, 0x79, 0x41, 0x6B, 0x7E, 0x65, 0x3C, 0x5C, 0x45,
  0x6F, 0x62, 0x4D]

index=[9,   10,   15,   23,   7,   24,   12,   6,   1,   16,   3,
       17,   32,   29,   11,   30,   27,   22,   4,   13,   19,   20,
       21,   2,   25,   5,   31,   8,   18,   26,   28,   14,   0]
input=[0]*33
x=[0]*33

for i in range(len(input)):
    x[i]=cipher[i]^index[i]
for i in range(len(x)):
    input[index[i]]=x[i]
flag = ''.join([chr(c) for c in input])
print(flag)



MRCTF{Tr4nsp0sltiON_Clph3r_1s_3z}

1-4的程序已经打包上传到资源里了

https://download.youkuaiyun.com/download/mails2008/89575003

你遇到的这个错误: ``` 'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object ``` 说明 Babel 中多个插件的 **`loose` 模式设置不一致**,这通常发生在你手动添加了某些 Babel 插件,而它们的配置(尤其是 `loose` 模式)与默认的 React Native Babel Preset 冲突。 --- ## ✅ 解决方案 你需要统一这些插件的 `loose` 模式配置,或者完全移除冲突的插件,使用默认的 React Native 预设配置。 --- ### ✅ 1. 修改 `babel.config.js`,统一配置 `loose` 模式 ```js module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ [ '@babel/plugin-transform-private-methods', { loose: true } // 与 class-properties 的 loose 一致 ], [ '@babel/plugin-transform-class-properties', { loose: true } ], [ '@babel/plugin-transform-private-property-in-object', { loose: true } ] ] }; ``` --- ### ✅ 2. 确保这些插件没有被其他依赖重复引入 有时第三方库会自带 Babel 配置或依赖旧版本的 Babel 插件,导致冲突。 你可以尝试删除 `node_modules` 和 `package-lock.json`,然后重新安装依赖: ```bash rm -rf node_modules package-lock.json npm install ``` --- ### ✅ 3. 使用 `BABEL_SHOW_CONFIG_FOR` 查看实际生效的 Babel 配置(调试用) ```bash npx cross-env BABEL_SHOW_CONFIG_FOR=D:\AwesomeProject\index.js npx react-native start ``` 这会显示当前文件使用的 Babel 配置,帮助你排查冲突。 --- ### ✅ 4. 清除缓存并重新运行 ```bash npx react-native start --reset-cache npx react-native run-android ``` --- ## ✅ 成功后效果 - ✅ 所有涉及类属性、私有方法等插件的 `loose` 模式一致 - ✅ 不再报错 `loose mode configuration must be the same` - ✅ 项目构建成功,Babel 插件协同工作正常 --- ## 🚨 注意事项 - `loose: true` 更接近 ES5 的行为,性能更好,但可能与严格模式略有差异。 - 如果你不确定是否需要这些插件,建议优先使用 `metro-react-native-babel-preset` 提供的默认配置。 - 使用 Expo 的话,建议使用官方支持的插件版本,避免手动添加 Babel 插件。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值