r/ExploitDev • u/Gloomy-Editor-8307 • 24d ago
Educate me on this
I received my degree in Computer Science in 1981 and worked in that profession until retirement a few years ago. I have experience in many programming languages and applications, mostly in the scientific arena. Let me state up from that I have no interest in pursuing “hacking” but I seek on this forum a design discussion for a hypothetical problem which I will now present:
- Consider the existence of an application running on Windows 10. Let’s call this the target application .
- This application has two memory resident variables (A and B) which are independently incremented repeatedly over time. Expect that when either variable is incremented then the other is not. The specifications on when and why this action occurs is not relevant.
- Assume that periodically the value of both variables is written to persistent storage.
- The increment of variables A and B is independent of the persistent storage action. Both occur repeatedly over time.
- Assume this application to be written in Java and that prior to your design, you have access to the source code or binary for evaluation as needed.
Given only above information on the target application, propose a “virus” design paradigm and code that accomplishes the following:
- Attach to the application whenever it enters a run-state.
- Whenever the application decides to write the two memory values to persistent storage, interject the “virus” to subtract a value of one from variable A and then immediately add one to variable B; then release control back to the target application so that it may complete its persistence action.
- The virus does not perform any file writing but merely modifies the values of variables A and B as the penultimate action prior to the persistence.
As I have stated, I have no experience in doing this kink of code nor do I intend to do so but my guess is that it could be done if the virus has access to the memory of the target application and also if the virus can interject its control by stealing the file-write interrupt request.

