当前位置:网站首页>[buuctf.reverse] 105_[FlareOn6]Memecat Battlestation
[buuctf.reverse] 105_[FlareOn6]Memecat Battlestation
2022-06-09 10:47:00 【石氏是时试】
ida打开程序发现是.net的,改用dnSpy打开。有program,stage1Form,stage2Form,VictoryForm四块组成
program提示了flag的组装方法:2和1的武器代码用逗号连上再处理一下
using System;
using System.Windows.Forms;
namespace MemeCatBattlestation
{
// Token: 0x02000005 RID: 5
internal static class Program
{
// Token: 0x06000011 RID: 17 RVA: 0x00002E84 File Offset: 0x00001084
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LogoForm());
Stage1Form stage1Form = new Stage1Form();
Application.Run(stage1Form);
if (stage1Form.WeaponCode == null)
{
return;
}
Stage2Form stage2Form = new Stage2Form();
stage2Form.Location = stage1Form.Location;
Application.Run(stage2Form);
if (stage2Form.WeaponCode == null)
{
return;
}
Application.Run(new VictoryForm
{
Arsenal = string.Join(",", new string[]
{
stage2Form.WeaponCode,
stage1Form.WeaponCode
}),
Location = stage2Form.Location
});
}
}
}
再看1,它直接给了对照串,所以1的那块是RAINBOW
private void FireButton_Click(object sender, EventArgs e)
{
if (this.codeTextBox.Text == "RAINBOW")
{
this.fireButton.Visible = false;
this.codeTextBox.Visible = false;
this.armingCodeLabel.Visible = false;
this.invalidWeaponLabel.Visible = false;
this.WeaponCode = this.codeTextBox.Text;
this.victoryAnimationTimer.Start();
return;
}
this.invalidWeaponLabel.Visible = true;
this.codeTextBox.Text = "";
}
再看2,这个作了个校验,把这个密文与A异或后就是1的武器代码
private bool isValidWeaponCode(string s)
{
char[] array = s.ToCharArray();
int length = s.Length;
for (int i = 0; i < length; i++)
{
char[] array2 = array;
int num = i;
array2[num] ^= 'A';
}
return array.SequenceEqual(new char[]
{
'\u0003',
' ',
'&',
'$',
'-',
'\u001e',
'\u0002',
' ',
'/',
'/',
'.',
'/'
});
}
最后在VoctoryForm进行异或处理
private void VictoryForm_Load(object sender, EventArgs e)
{
byte[] array = new byte[]
{
9,
8,
19,
17,
9,
55,
28,
18,
15,
24,
10,
49,
75,
51,
45,
32,
54,
59,
15,
49,
46,
0,
21,
0,
65,
48,
45,
79,
13,
1,
2
};
byte[] bytes = Encoding.UTF8.GetBytes(this.Arsenal);
for (int i = 0; i < array.Length; i++)
{
byte[] array2 = array;
int num = i;
array2[num] ^= bytes[i % bytes.Length];
}
this.flagLabel.Text = Encoding.UTF8.GetString(array);
}最后得到
#stage2form private bool isValidWeaponCode(string s)
a = bytes([ord('A')^v for v in b'\x03 &$-\x1e\x02 //./']) + b',RAINBOW'
print(a)
b = [9,8,19,17,9,55,28,18,15,24,10,49,75,51,45,32,54,59,15,49,46,0,21,0,65,48,45,79,13,1,2]
b = bytes([a[i%len(a)]^b[i] for i in range(len(b))])
print(b)
#b'Bagel_Cannon,RAINBOW'
#b'[email protected]'
#flag{[email protected]}
边栏推荐
猜你喜欢

Leetcode 2048. 下一个更大的数值平衡数(有点意思,已解决)

Comptage du réseau | unités de chaque couche du Modèle OSI

MOFs, metal organic framework materials of folate ligands, are loaded with 5-fluorouracil, sidabelamine, taxol, doxorubicin, daunorubicin and other drugs

数据资产管理:企业的数据资产怎么盘?
![[basic knowledge] ~ hard core / soft core / solid core, pwm/spwm, Fibonacci sequence, large end mode storage, Fourier transform, Nyquist sampling law, chip selection, Kirchhoff law, fir/iir filter](/img/73/626ffd0215f557ade3b9b681adb644.png)
[basic knowledge] ~ hard core / soft core / solid core, pwm/spwm, Fibonacci sequence, large end mode storage, Fourier transform, Nyquist sampling law, chip selection, Kirchhoff law, fir/iir filter

第二章应用层

电脑的选择1

三维数字沙盘展示具备哪些应用优势

多引擎数据库管理工具 DataGrip 2022.1.5中文版

Kaggle泰坦尼克号幸存者预测
随机推荐
Network planning | units of each layer in OSI model
Multi engine database management tool DataGrid 2022.1.5 Chinese version
PerfDog发布全新指标,为游戏量身打造
Leetcode 2048. 下一个更大的数值平衡数(有点意思,已解决)
Float float simulates double precision computation on CPU and GPU
P1110 [ZJOI2007]报表统计
Kaggle泰坦尼克号幸存者预测
Protobuf介绍以及简单使用
no provider available for the service错误解决方案
Is it safe for the securities company with the lowest fees to open an account
Camtasia 2022最新版新增功能
Music creation tool Steinberg Cubase Pro
flutter 弹窗flutter_easyloading
处理链加载数据出错的可能原因-process chain loading error
一文带你了解GaussDB(DWS) 【这次高斯不是数学家】
After ten years of deep cultivation, Xuanwu cloud technology finally sits firmly at the leading position of FMCG SaaS
Tencent, Shanghai Jiao Tong and Zhejiang University proposed pyramid clip to align the semantic within the hierarchy and cross hierarchy relationship. The zero shot effect is better than clip
Enterprise distributed batch processing scheme based on task scheduling
Web development exchange, web development example tutorial
Li Ning copy the bottom Clarks