Intellectual activity belongs to the object of not granting patent right.
You can search the website of the Patent Office for how to write an application claim for previously applied software.
To apply for a patent, you can write your own application documents or entrust an agency to handle it.
Submit your own suggestions. Unless you are an expert, you should read the review guide at least three times.
Writing by yourself requires preparation.
Application form/application
Abstract attached drawings
Claim document
Manual drawing
Just mail it to the patent office.
If you entrust an agent, you only need to provide technical disclosure and power of attorney, and you don't have to worry about anything else. The intermediary will do it for you. This institution is full of legal experts and technical experts.
You can contact me directly if you need anything.