TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hacking java bytecode

93 pointsby onderkalaciabout 10 years ago

7 comments

userbinatorabout 10 years ago
<i>contestants are required to turn in their source, rather than compiled code</i><p>If there&#x27;s nothing about the language in which the source must be written in but only that it compiles to JVM bytecode that meets the requirements, I&#x27;d be very tempted to write most or almost all of it in bytecode... java.lang.ClassLoader is allowed and it provides some useful methods for that purpose. ;-)<p><i>At each block’s exit, a checkpoint is injected with the block’s total cost. During live execution, these checkpoints increment the AI’s internal total bytecode counter. If at any checkpoint the running tally exceeds GameConstants.BYTECODE_LIMIT, the AI’s execution is halted and execution of the next robot’s AI begins.</i><p>That sounds to me like it might be possible to squeeze in some more extra instructions at the end.
评论 #9548502 未加载
评论 #9547238 未加载
评论 #9544762 未加载
kitdabout 10 years ago
I&#x27;ve been writing Java for 15 years and I never knew about breaking out of arbitrary labelled blocks!
评论 #9545835 未加载
评论 #9545267 未加载
xvilkaabout 10 years ago
I think it is worth to mention that you can inspect Java bytecode [1][2] with radare2 tool (use the git version [3])<p>[1] <a href="http:&#x2F;&#x2F;dso.thecoverofnight.com&#x2F;posts&#x2F;2014&#x2F;04&#x2F;radare-java-intro&#x2F;" rel="nofollow">http:&#x2F;&#x2F;dso.thecoverofnight.com&#x2F;posts&#x2F;2014&#x2F;04&#x2F;radare-java-int...</a><p>[2] <a href="http:&#x2F;&#x2F;radare.org&#x2F;get&#x2F;radare_java.pdf" rel="nofollow">http:&#x2F;&#x2F;radare.org&#x2F;get&#x2F;radare_java.pdf</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;radare&#x2F;radare2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;radare&#x2F;radare2</a>
th3iedkidabout 10 years ago
very interesting !<p>&gt;&gt;There are some who may scoff at bytecode optimization, reasoning that it’s a worthless skill for modern computer science, especially those working in high-level languages. Understanding what the compiler emits however is a skill still very much alive and well in embedded programming, FPGA programming, and other performance-oriented disciplines.<p>A few more use-cases are with building instrumentation modules, profilers besides byte-code analytic for automated-binary-audits,obfuscation amongst others.
trunabout 10 years ago
Cory&#x27;s link to the instrumentation source doesn&#x27;t seem to exist anymore, but here&#x27;s the latest public version... <a href="https:&#x2F;&#x2F;github.com&#x2F;battlecode&#x2F;battlecode-server&#x2F;tree&#x2F;master&#x2F;src&#x2F;main&#x2F;battlecode&#x2F;engine&#x2F;instrumenter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;battlecode&#x2F;battlecode-server&#x2F;tree&#x2F;master&#x2F;...</a><p>Most of the interesting bits happen in RoboMethodTree.
评论 #9544902 未加载
sz4kertoabout 10 years ago
I remember the good old days when I wrote a postcompiler for .Net, and I realized that I can jump back from a catch clause to the try block :)
评论 #9544886 未加载
j_sabout 10 years ago
Dexer, a .NET-based tool to work with Android Dalvik bytecode in a manner similar to Mono.Cecil:<p><a href="http:&#x2F;&#x2F;sebastien.lebreton.free.fr&#x2F;blog&#x2F;index.php?&#x2F;categories&#x2F;4-Dexer" rel="nofollow">http:&#x2F;&#x2F;sebastien.lebreton.free.fr&#x2F;blog&#x2F;index.php?&#x2F;categories...</a><p>The IKVM.NET blog covers a lot of low-level details as the author implements &#x27;JVM on .NET CLR&#x27;:<p><a href="http:&#x2F;&#x2F;weblog.ikvm.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;weblog.ikvm.net&#x2F;</a>