4 Replies Latest reply on Oct 24, 2019 6:51 AM by byteman_ask

    Byteman and KEmulator?

    byteman_ask

      Hello. I was just wondering if it is possible to inject code to games executed by KEmulator or any other Java emulator available for PC.
      Did anyone tried that? How could I achieve that?

      Kind regards,
      byteman user.

        • 1. Re: Byteman and KEmulator?
          adinn

          The emulator would need to implement the JVMTI Java agent protocol. You can read about that here and here.

           

          n.b. the emulator would not need to implement all of JVMTI; it would be possible to omit the JVMTI native agent parts. A very lightweight implementation could also omit loading of agents into a running JVM (i.e. only support installation of Byteman during startup).

          However, if it did that then you would probably only be able to load a Byteman agent when the emulator starts running the Java code.

           

          I am curious as to why you appear to be restricting yourself to using  a Java emulator to run games written in Java? Can you not simply run those games on OpenJDK for Windows?

           

          regards,

           

           

          Andrew Dinn

          1 of 1 people found this helpful
          • 2. Re: Byteman and KEmulator?
            byteman_ask

            adinn  wrote:

            I am curious as to why you appear to be restricting yourself to using  a Java emulator to run games written in Java? Can you not simply run those games on OpenJDK for Windows?

            Oh, sorry, I didn't know that this is possible. I was only able to run games using KEmulator. How can I do that? Should I download OpenJDK, run game in OpenJDK and then game will be visible as running process with unique PID? Which version of OpenJDK should I use?

            • 3. Re: Byteman and KEmulator?
              adinn

              byteman_ask  wrote:

               

              adinn   wrote:

              I am curious as to why you appear to be restricting yourself to using  a Java emulator to run games written in Java? Can you not simply run those games on OpenJDK for Windows?

              Oh, sorry, I didn't know that this is possible. I was only able to run games using KEmulator. How can I do that? Should I download OpenJDK, run game in OpenJDK and then game will be visible as running process with unique PID? Which version of OpenJDK should I use?

               

              If the games are just normal Java programs then you should be able to run them on the Windows release of OpenJDK. Byteman works on Windows and Linux with all current versions of OpenJDK. If you want a download try one of the LTS (long term support) releases we have made available at the releases page on the AdoptOpenJDK site: https://adoptopenjdk.net/releases.html.

               

              I suggest you start by trying the full JDK release of JDK8 for Windows. It is probably best to use the installer version. That should ensure that the Java binary in the download is used when you run the java command in a shell. If you use the plain download then you will need to use an explicit path to run java or set up your shell path to point to the download. However, please note I am no Windows expert so if you have problems running Java you might be best asking someone else how to get it set up and running correctly.

               

              Once you have Java running and executing the game you should be able to install Byteman from the command line or using the bminstall script provided in the Byteman download. See the first Byteman tutorial for more details of how to do that.

              1 of 1 people found this helpful
              • 4. Re: Byteman and KEmulator?
                byteman_ask

                Hey, thanks for explanation. Now I get what you meant earlier, but the problem is that game I want to insert debug lines into is made for J2ME, so it is not a standard JAR file and I think that it can be played on PC only by emulator (correct me if I'm wrong, but google has no info about playing J2ME games on OpenSDK).