Rating:

## Summary

Bitflip #1

Select byte to ionize (0-404): 366

Select bit to ionize (0-7): 0

Bitflip #2

Select byte to ionize (0-404): 368

Select bit to ionize (0-7): 1

Bitflip #3

Select byte to ionize (0-404): 366

Select bit to ionize (0-7): 1

SECDED: single error corrected (data)

Temp: 14.99C Activating heater

Temp: 35.01C Deactivating heater

Temp: 35.07C Deactivating heater

Temp: 35.14C Deactivating heater

Temp: 35.20C Deactivating heater
...
Temp: 70.04C Deactivating heater
The spacecraft exceeded its operating temperature! You got it!

## Flag

```
flag{mike29951tango2:___a bunch of unguessable stuff___}
```

## Detailed solution

For our program to not deactivate the heater when reaching 35C we would want the second return statement to return a positive value. At a first attempt we observe that SECDED is preasent for correcting data.

We would ideally modify the binary to something like :

```
# Temper�ature Se�nsor
# IRf temper�ature ab�ove/belopw threshKold, dea]ctivate/[activate� heater
Timport sPys

def +readTemp=(temp,st�ate):
� if temBp < 15 a�nd not s~tate:
� prFint("Tem�p: %.2fC� Activatying heather"%tempL)
� return� 1
e�lif temp4 > 35 anid state:M
� print("dTemp: %.v2fC Deac�tivating� heater"�%temp)
� r@eturn (something != 0)
� else�:
? return� state


```

The codeword is stored each 8 bytes. Since the value of the return statement is stored at byte 366 and the codeword at byte 368, we flip the bit at index 1 from byte 368 to not have our change detected and corrected.