BugKu Notes - 0 and 1 story wp (matlab can be used to solve the problem)

The story of BugKu-0 and 1 (matlab can be used to solve the problem)

This question only gives a txt, which is a sequence of 0 and 1.
insert image description here

Note that the 0 and 1 given by the title must be reversed with the script, otherwise the black and white will be reversed in the end. The following python script is also to implement this script.

Text content for everyone to use:

0000000001110010000000000
0000000000011110100000000
0000000001110001000000000
0000000010111100000000000
0000000010101010000000000
0000000001100010100000000
0000000010101010100000000
0000000001000001100000000
1100011101110110100011000
0001000010110010010010100
0100111101000011101110011
0011110100101011001001001
1000001001100001001101000
1111000111111011100101000
1011011111001101111110111
1000110110010010101101100
1000111100111111111110111
0000000010110001100010100
0000000010010100101010001
0000000010101010100011001
0000000000100111111110010
0000000000011001011110111
0000000001001100100100001
0000000011000011011011001
0000000011010000101110101

Before doing this question, I also found a lot of WP, such as

method one:

Use python script to convert 0 and 1 to black and white respectively, but I really can't get the correct QR code, maybe I am too naive.

Method Two:

Fill it with an excel sheet, 0 and 1 represent black and white respectively, and then get a QR code image, it's too troublesome, and I didn't realize it! ! !

Method three (implemented with Matlab):

First, in matlab 0 is black and 1 is white. Let's first convert the sequence of 0 and 1 given by the title to a sequence of 0 and 9. Here I use python to turn it.

str='''0 0 0 0 0 0 0 0 0 9 9 9 0 0 9 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 0 9 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 9 9 9 0 0 0 9 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 9 0 9 9 9 9 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 9 0 9 0 9 0 9 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 9 9 0 0 0 9 0 9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 9 0 9 0 9 0 9 0 9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 9 9 0 0 0 0 0 0 0 0
9 9 0 0 0 9 9 9 0 9 9 9 0 9 9 0 9 0 0 0 9 9 0 0 0
0 0 0 9 0 0 0 0 9 0 9 9 0 0 9 0 0 9 0 0 9 0 9 0 0
0 9 0 0 9 9 9 9 0 9 0 0 0 0 9 9 9 0 9 9 9 0 0 9 9
0 0 9 9 9 9 0 9 0 0 9 0 9 0 9 9 0 0 9 0 0 9 0 0 9
9 0 0 0 0 0 9 0 0 9 9 0 0 0 0 9 0 0 9 9 0 9 0 0 0
9 9 9 9 0 0 0 9 9 9 9 9 9 0 9 9 9 0 0 9 0 9 0 0 0
9 0 9 9 0 9 9 9 9 9 0 0 9 9 0 9 9 9 9 9 9 0 9 9 9
9 0 0 0 9 9 0 9 9 0 0 9 0 0 9 0 9 0 9 9 0 9 9 0 0
9 0 0 0 9 9 9 9 0 0 9 9 9 9 9 9 9 9 9 9 9 0 9 9 9
0 0 0 0 0 0 0 0 9 0 9 9 0 0 0 9 9 0 0 0 9 0 9 0 0
0 0 0 0 0 0 0 0 9 0 0 9 0 9 0 0 9 0 9 0 9 0 0 0 9
0 0 0 0 0 0 0 0 9 0 9 0 9 0 9 0 9 0 0 0 9 9 0 0 9
0 0 0 0 0 0 0 0 0 0 9 0 0 9 9 9 9 9 9 9 9 0 0 9 0
0 0 0 0 0 0 0 0 0 0 0 9 9 0 0 9 0 9 9 9 9 0 9 9 9
0 0 0 0 0 0 0 0 0 9 0 0 9 9 0 0 9 0 0 9 0 0 0 0 9
0 0 0 0 0 0 0 0 9 9 0 0 0 0 9 9 0 9 9 0 9 9 0 0 9
0 0 0 0 0 0 0 0 9 9 0 9 0 0 0 0 9 0 9 9 9 0 9 0 9'''#0为黑色  9为白色
str1=str.replace("0",'1')
print(str1)
print('\n')
str2=str1.replace("9",'0')
print(str2)

Next, manually add three locators (upper left, lower left, upper right) to the converted string obtained, and then use Matlab to process it.

I = [0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0
     0 1 1 1 1 1 0 1 1 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1 0 0 1 1 0 1 0 0 0 0 1 0 0 0 
     0 1 0 0 0 1 0 1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0
     0 1 1 1 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 1 0 0 1 1 0
     0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0];  % 测试数据模拟图像
[m,n] = size(I);
subplot(121),imshow(I,[]),title('原图');

insert image description here
Get the QR code.
Just scan it!
insert image description here

flag{QR_c0de_1s_1nterest1n9}

Why did you think of using matlab? Because I just finished matlab. Haha
I'm Ganggang classmate, a novice who is new to Internet security. ☜(ˆ▽ˆ)
(crazy hintlike! focus on! Forward! ! ! like! focus on! Forward! ! !

 * 您的支持是罡罡同学前进的最大动力!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324322386&siteId=291194637