From 466fbec4e6333d5ba55b919600025ce68dcf5ab3 Mon Sep 17 00:00:00 2001 From: Amanda Rousseau Date: Tue, 21 Nov 2017 13:19:52 -0800 Subject: [PATCH] adding detail --- flareon4/challenge3.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flareon4/challenge3.md b/flareon4/challenge3.md index 68db562..144c4a3 100644 --- a/flareon4/challenge3.md +++ b/flareon4/challenge3.md @@ -27,6 +27,15 @@ The hint here is the value tested against 0xFB5E. There is a function that proce The first loop preps the answer array. ![alt text](https://securedorg.github.io/flareon4/images/ch3_loop.png "first loop") +In python it looks like this: +``` +answer = stored_bytes[:] +for i in range(size): + x = char ^ answer[i] + x = (x + 0x22) & 0xff + answer[i] = x +``` + ## Main algorithm ## The 4011E6 will then take the answer array in reverse and do some bit shifting while chaining addition based on 2 bytes because of the usage of ax and cx. This value will eventually equal to 0xFB5E. ![alt text](https://securedorg.github.io/flareon4/images/ch3_aglo.png "algorithm")