Re: Endianness of Java Virtual Machine



On 31 Oct 2007 06:39:54 GMT, Andreas Leitgeb
<avl@xxxxxxxxxxxxxxxxxxxxxxxx> wrote, quoted or indirectly quoted
someone who said :

Now comes the tricky part:
in the bytecode there exist instructions to convert the
intvalue to a byte/short-value, and you'd have to modify
the class file(*) to do some noop's instead of these
converting instructions. after that you run the code
again, and see if the result has changed.

Just want to clarify here. A careless reader might get the erroneous
idea the compiler generates different byte code depending on whether
the target were big on little endian. Definitely not so. The same byte
code is used on all platforms. The byte code does the same logical
thing on all platforms. It is just the JVM has different amounts of
work to implement each byte code on different platforms. Your trick
exploits this.

--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages

  • Re: Using the carry flag in standard C
    ... There are many platforms that do not do that, ... Quotient and remainder available in two instructions. ... Quotient and remainder available in a single instruction. ...
    (comp.std.c)
  • Re: [Full-disclosure] Metasploit Framework v3.1 Released
    ... shots, video demonstrations, documentation and installation ... instructions for many platforms, can be found online at ...
    (Full-Disclosure)
  • Re: Questions about Bytecode
    ... and I am still a bit confused about compiling to bytecode. ... usually a serialized version of the in-memory representation. ... Typically, in a bytecode format, the VM instructions will have ... compiler) typically distinguishes them from instructions by processing ...
    (comp.compilers)
  • Re: Help me!! Why java is so popular
    ... which I tried translating into C, and was somewhat shocked to find a (on one ... Conditional branch instructions executed on CPUs with "dumb" ... Whether /any/ bytecode survives until runtime is implementation dependent. ... IBM's "Jikes research JVM" (a very impressive bit of work, ...
    (comp.lang.java.programmer)
  • Re: Instrumentation + BCEL | ASM
    ... Dont exacly remember how try - catch works in bytecode, ... > but i remember api is quite simple. ... A good exercise would be to pack it unmodified, I know, but that'd take me a long time. ... > instructions at the beginning, and at the end (look for them in the api ...
    (comp.lang.java.programmer)