M
M
Markzzz2020-12-26 18:55:58
assembler
Markzzz, 2020-12-26 18:55:58

Task assembler with CTF?

The code is given in assembler, one function is missing in it - the Fibonacci numbers. To get the flag, you need to write it, I absolutely do not know the assembler, but I found many Fibonacci implementations on the Internet. I unfortunately do not have Linux and there is no way to run the code, please help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Filipp42, 2020-12-26
@Filipp42

Please tell me, where should I attach the function for calculating Fibonacci numbers and where did you get the code example?

1
15432, 2020-12-26
@15432

I unfortunately do not have Linux and there is no way to run the code
So rewrite in Python, there is also a very obvious code:
def fibonacci(n):
    if n==0:
        return 0
    elif n==1:
        return 1
    else:
        return fibonacci(n-1)+fibonacci(n-2)
flag = [0x43, 0x6e, 0x74, 0x70, 0x70, 0x60, 0x73, 0x4b, 0x7c, 0x40, 0x68, 0x3f, 0xa1, 0xab, 0x26, 0x24, 0xb2, 0x7f, 0x65]
for i in range(19):
    flag[i] ^= fibonacci(i) & 0xFF
result = "".join(chr(x) for x in flag)
print(result)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question