huzpsb / JavaObfuscatorTest

A list of Java obfuscators, obfuscated samples and benchmarks.
53 stars 7 forks source link

Counter test inconsistencies #6

Open terminalsin opened 1 year ago

terminalsin commented 1 year ago

Issue The counter test is not accurate.

Reasoning Most higher end obfuscators add transient or cached fields. This is inconsistent with the test's logic. Instead, the test should check if the cached reflection fields are transient or synthetic to ensure these don't get added to serialization logic and so forth. Furthermore, the order of fields should be checked as any change in order will cause breaking changes in reflections. Order should be maintained.

huzpsb commented 1 year ago

Thank you for pointing that out! Well, this test is made because I am a Minecraft dev. When making a packet-interpreting plugin, say a packet-based anti-cheat, there can be classes to be serialized while having no flags. It's should be noted that while this repo is intended to work as a general bench, you may add configs to the obfuscator when making a demo for the provided jar. As for the orders, you do have a good point. I will fix that in a further version.

terminalsin commented 1 year ago

Thank you for pointing that out! Well, this test is made because I am a Minecraft dev. When making a packet-interpreting plugin, say a packet-based anti-cheat, there can be classes to be serialized while having no flags. It's should be noted that while this repo is intended to work as a general bench, you may add configs to the obfuscator when making a demo for the provided jar. As for the orders, you do have a good point. I will fix that in a further version.

Oh yeah I've done anticheats. I know what you mean. The transient and synthetic flags should be sufficient. For example, GSON skips any transient field, making it compatible with 99% of serialization libs.

huzpsb commented 1 year ago

Kinda beyond my knowledge D: Would appreciate if you make a PR for this