Loading icon indicating copy to clipboard operation
Loading copied to clipboard

Show consumed traffic amount?

Open delebedev opened this issue 9 years ago • 7 comments

It would be really lovely to see amount of traffic for each app, or is it out of scope for Loading?

delebedev avatar May 06 '15 16:05 delebedev

Right now it's definitely outside the scope of the project, but at some point I agree it would be nice to have that information in there somewhere.

BonzaiThePenguin avatar May 06 '15 18:05 BonzaiThePenguin

+1

ricardopereira avatar May 07 '15 09:05 ricardopereira

:+1:

matiassingers avatar May 08 '15 09:05 matiassingers

:)

BonzaiThePenguin avatar May 08 '15 12:05 BonzaiThePenguin

I'm looking to implement similar functionality in a different project. Can you point me to resources regarding NetworkStatistics, reverse engineering advice, etc? Thanks in advance!

dbkaplun avatar Jun 28 '15 16:06 dbkaplun

NetworkStatistics is completely undocumented, but I used Hopper Disassembler and a ton of trial and error to find the right framework and function calls that I needed. Hopper can give you the function definition to a point, but it will say things like int when it's actually a Core Foundation class. For return types of int I think I called CFStringRef CFCopyDescription(CFTypeRef cf ) on them, at which point it would either crash (which tells me it's not a Core Foundation object) or it'd return something like "CFDictionary" which is even more helpful. I'd then use Hopper to find things that looked like constant declarations (_kNStatSrcKeyRxPackets), then I'd pass all of them in as keys into the dictionary to see what values they returned, if any.

BonzaiThePenguin avatar Jul 03 '15 13:07 BonzaiThePenguin

Inspecting the disassembled code for each function usually gives hints for what the parameters are supposed to be, like NStatManagerCreate has a line that copies a block so one of the arguments is probably a block, it uses dispatch queues so another argument is probably a queue, it uses the Core Foundation allocator so it probably needs a kCFAllocatorDefault argument, and so on.

For reverse-engineering data formats, you usually just use the app that generates the data to make known changes, then inspect the data in a hex editor and see what changed. If you change the rating for a song in iTunes from one star to two stars and one of the bytes in the file changes from 51 to 102, the rating is probably stored in that byte as rating * 51.

BonzaiThePenguin avatar Jul 03 '15 14:07 BonzaiThePenguin