TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hacking java bytecode

93 点作者 onderkalaci大约 10 年前

7 条评论

userbinator大约 10 年前
<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 未加载
kitd大约 10 年前
I&#x27;ve been writing Java for 15 years and I never knew about breaking out of arbitrary labelled blocks!
评论 #9545835 未加载
评论 #9545267 未加载
xvilka大约 10 年前
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>
th3iedkid大约 10 年前
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.
trun大约 10 年前
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 未加载
sz4kerto大约 10 年前
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_s大约 10 年前
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>