move the bytes to see the truth!
code: https://github.com/MetaTrustLabs/ctf/tree/master/bytesMove
you need to crack this file and find the flag.
tips: This is a sui bytecode
To disassemble the moveBytes.mv file in the MetaTrust CTF, we used the sui client command-line interface. The sui move disassemble command allowed us to view the assembly code for the Move bytecode.
|
|
If you’re interested in viewing the assembly code for the moveBytes.mv file, you can check out the code at the following link: https://gist.github.com/ashirleyshe/04a5ed08727a5b06fcda2fc545ed56b8
The file contains several functions, including compute, byte_to_u64, slice, and solve. The byte_to_u64 and slice functions are not particularly important.
Check the value of the constants:
|
|
The solve
function is the entry point for the program and accepts a vector as its argument, which represents the flag. The function checks the format of the input, computes a value using the compute function, and then asserts that the input is equal to the ciphertext value.
|
|
A loop, check i < 32
.
|
|
An inner loop, check j < 8
.
|
|
The compute function takes the i/4th element of the vector as its first argument and the 2290631716 as its second argument.
|
|
|
|
I construct the script like this:
|
|
Finally, you’ll find it is a LFSR.
|
|
To crack the flag, I wrote a Python script:
|
|