What is the best way to debug and save output?


Lurker Lv0️⃣
Member for 6 years
I am using dnSpy to look into random unity game application, after pressing specific button whilst in the app, it sends request to the server. You can capture most of it by connecting your android device to HTTP app on your PC. Some requests are formatted in a way to resemble packets, hence you cannot really see in plain text what the JSON request is. I can access encode packet function and decode packet function using dNspy, however not sure what would be the best approach to replicate the steps so I came up with a series of steps.

My objectives:
1. Before the value is being encoded and send via packet, output it somewhere on your android device. I was thinking about saving it to a log file (if anyone has any tutorial on how to do it, please post below), or if there is a better and easier step, let me know too!
2. I will eventually have to send this request with the value that packet had encoded, step no.1 gives me at least an idea of what needs to be encoded.

This is example request body (packet type)