PWNing 2017 CTF - Simple Keygen Reverse Engineering task

Today I'm gonna show you a solution of a task from pwning2017 CTF created by p4 team. I think this challenge is much simpler than the earlier one so I hope that you will understand it quickly. Here is a content ( https://pwning2017.p4.team/task/simple_keygen ):