Tumgik
#Bytecode
wolvieex · 2 years
Text
Java Virtual Machine (JVM)
Java bytecode can be executed in a virtual runtime environment called the Java Virtual Machine, or JVM. Java bytecode is loaded, checked, and executed by the JVM. Every type of processor has a unique machine language that can only be used to represent a program if it is expressed in that language. Programs written in high-level languages must first be converted into the machine language of the specific processor in order to be run on a computer. Compilers are specialized computer programs that carry out this translation. As a result, the compiler receives a high-level program at the entrance and converts it into a program that can be executed by a machine. Then, this machine-language program may be run countless times. Machine language is still used to compile Java programs. However, that machine language was created by a Java Virtual Machine, a hypothetical computer (JVM). A software implementation of a real machine is a virtual machine. Java was created with the idea of WORA in mind (Write Once and Run Anywhere). The java file is first converted into a class file by the compiler. JVM receives the class file and loads and runs it. Java bytecode refers to the machine language of a Java virtual machine. As a result, the Java program is converted into a JVM machine language, which cannot be run directly on a physical computer. A Java bytecode interpreter, which is included with JVM, is required on the computer in order to run a Java program that has been converted into Java bytecode. For each type of machine, a distinct Java bytecode interpreter is required (different versions of JVM), but they all work the same. One of the key differences between Java and other languages is that the same Java program can run on several computer kinds after being translated or compiled. Also, did you know that java is both interpreted and compiled language as a compiler converts a program from one level of language to another and an interpreter converts a program at one level to another programming language at same level, in Java, the Just is Time Code generator converts the bytecode into the native machine code which are at the same programming levels. Hence, Java is both Compiled as well as Interpreted Language.
4 notes · View notes
devsnews · 1 year
Link
WebAssembly enables developers to combine different languages into a single application by allowing them to compile code written in different languages into a single bytecode format. This bytecode can then be executed in the same virtual machine, regardless of the language the code was originally written in. This makes it easier for developers to use a variety of languages in a single project and enables them to share code between projects. Additionally, WebAssembly allows developers to take advantage of existing code libraries written in different languages and have them run as part of their projects.
0 notes
Text
Tumblr media
Write your answer in the comment section . . . visit: https://bit.ly/3GaTl1z Q no. 1 for the answer
0 notes
rabbiteclair · 1 year
Text
instead of saying I 'spent an hour and a half in the middle of the night parsing out metadata on messages being passed between two services' it is much cooler and still basically correct to say 'at midnight i spied on the hidden words spoken between two daemons'
74 notes · View notes
cauchys-special-boy · 2 months
Text
i spend a lot of time thinking about ways to do the common lisp readtime/compiletime/runtime thing better and there's really nothing pretty. for my shitlisp i think im just going to read, compile, execute each top-level expression in order from top to bottom. if executing expr1 has the side effect of changing the reader, the reader will just be changed when it reads expr2
0 notes
peletic · 1 year
Text
i think society (men in particular) need to stop sexualizing women
i think said people need to start sexualizing people like me (specifically me) ergo 15 year old boys in bed eating ice cream watching people do machine code
1 note · View note
wuggen · 6 months
Text
So the thing about me is that if your high-level programming language doesn't have strict statically-checked types I'll kill you, and if your low-level bytecode knows about anything except raw untyped bytes I'll kill you
484 notes · View notes
foone · 9 months
Note
As the person I follow who does reverse engineering, do you have any suggestions for finding resources on reverse engineering Android apps?
Specifically, there's an app I'm playing with, where after seeing the structure of the "export as Markdown" output I want to know what the internal structure and representation of the data is. The end goal of understanding it is to be able to add certain kinds of data dynamically, rather than up front. That's certainly doable typing in raw markdown, but being able to do it "app style" would be more convenient.
The google Play Store entry does not mention any open source licenses, or looking for the source code and hopefully a git repo or something would have been my first step.
(I'll probably need to bang together a crappy app to do what I really want regardless, but maybe this app's data structure would be more convenient than doing so with markdown.)
So, android stuff:
First you need the APK. You can do some trickery with your phone to pull it over the ADB connection if you install the android SDK, but generally I just google "app name APK" and you'll find some greymarket site that'll give you a copy.
Secondly, APKs are just ZIP files (JAR files, technically, but JAR files are also just ZIP files!). Unzip them and you can find lots of interesting stuff, often.
Tumblr media
For disassembling/decompiling them, my go-to program is jadx. It's a java decompiler that's been around a while and can natively open APK files and decompile them. There's some weirder new APKs that it can't handle (something to do with a newer bytecode revision, I think?) but I can't recall the details on how you handle those. Those are rare, in my experience. jadx is pretty good, but you'll occasionally find methods or entire classes that it just can't figure out, and it'll give you a bytecode dump. I don't yet have a good solution for those, other than "get good at reading JVM bytecode".
If you're dealing with games, another useful thing can be UABE and dotPeek. These are unity/C# tools, but you would be surprised how many android games (and non-games!) are actually unity under the hood.
Bluestacks can also be useful, because it'll let you run the app on your desktop and that can be handy for things like running WireShark to log all network traffic.
Speaking of logging, the other handy thing I've done is enabling android developer mode on my phone to get to one specific option: Bluetooth HCI snoop log.
Now, actually getting that log is tricky and varies from phone to phone, because for some reason manufacturers like to move it around, but it's one of the best ways to reverse engineer bluetooth communication stuff. You basically turn on the log and everything your phone does to communicate with your Smart Toothbrush or whatever will be logged to a file, then you can yank that file over and stuff it into Wireshark.
So... hopefully some of that is a helpful start? I've not done a huge amount of Android reversing so I'm not super familiar with the tools used, but these are the ones I've got on hand for when I do.
also sorry for all the horny robotgirl posters who saw "android reverse engineering" in the tags and thought this was gonna be about taking them apart with screwdrivers and rooting around in their insides. Not today!
109 notes · View notes
yokowan · 2 months
Text
tethys can read and write, but very slowly. it has to look at each letter and remember what its ASCII bytecode it is.
15 notes · View notes
moose-mousse · 7 months
Text
So I made an app for PROTO. Written in Kotlin and runs on Android.
Next, I want to upgrade it with a controller mode. It should work so so I simply plug a wired xbox controller into my phone with a USB OTG adaptor… and bam, the phone does all the complex wireless communication and is a battery. Meaning that besides the controller, you only need the app and… any phone. Which anyone is rather likely to have Done.
Now THAT is convenient!
( Warning, the rest of the post turned into... a few rants. ) Why Android? Well I dislike Android less than IOS
So it is it better to be crawling in front of the alter of "We are making the apocalypse happen" Google than "5 Chinese child workers died while you read this" Apple?
Not much…
I really should which over to a better open source Linux distribution… But I do not have the willpower to research which one... So on Android I stay.
Kotlin is meant to be "Java, but better/more modern/More functional programming style" (Everyone realized a few years back that the 100% Object oriented programming paradigme is stupid as hell. And we already knew that about the functional programming paradigme. The best is a mix of everything, each used when it is the best option.) And for the most part, it succeeds. Java/Kotlin compiles its code down to "bytecode", which is essentially assembler but for the Java virtual machine. The virtual machine then runs the program. Like how javascript have the browser run it instead of compiling it to the specific machine your want it to run on… It makes them easy to port…
Except in the case of Kotlin on Android... there is not a snowflakes chance in hell that you can take your entire codebase and just run it on another linux distribution, Windows or IOS…
So... you do it for the performance right? The upside of compiling directly to the machine is that it does not waste power on middle management layers… This is why C and C++ are so fast!
Except… Android is… Clunky… It relies on design ideas that require EVERY SINGLE PROGRAM AND APP ON YOUR PHONE to behave nicely (Lots of "This system only works if every single app uses it sparingly and do not screw each-other over" paradigms .). And many distributions from Motorola like mine for example comes with software YOUR ARE NOT ALLOWED TO UNINSTALL... meaning that software on your phone is ALWAYS behaving badly. Because not a single person actually owns an Android phone. You own a brick of electronics that is worthless without its OS, and google does not sell that to you or even gift it to you. You are renting it for free, forever. Same with Motorola which added a few extra modifications onto Googles Android and then gave it to me.
That way, google does not have to give any rights to its costumers. So I cannot completely control what my phone does. Because it is not my phone. It is Googles phone.
That I am allowed to use. By the good graces of our corporate god emperors
"Moose stares blankly into space trying to stop being permanently angry at hoe everyone is choosing to run the world"
… Ok that turned dark… Anywho. TLDR There is a better option for 95% of apps (Which is "A GUI that interfaces with a database") "Just write a single HTML document with internal CSS and Javascript" Usually simpler, MUCH easier and smaller… And now your app works on any computer with a browser. Meaning all of them…
I made a GUI for my parents recently that works exactly like that. Soo this post:
It was frankly a mistake of me to learn Kotlin… Even more so since It is a… awful language… Clearly good ideas then ruined by marketing department people yelling "SUPPORT EVERYTHING! AND USE ALL THE BUZZWORD TECHNOLOGY! Like… If your language FORCES you to use exceptions for normal runtime behavior "Stares at CancellationException"... dear god that is horrible...
Made EVEN WORSE by being a really complicated way to re-invent the GOTO expression… You know... The thing every programmer is taught will eat your feet if you ever think about using it because it is SO dangerous, and SO bad form to use it? Yeah. It is that, hidden is a COMPLEATLY WRONG WAY to use exceptions…
goodie… I swear to Christ, every page or two of my Kotlin notes have me ranting how I learned how something works, and that it is terrible... Blaaa. But anyway now that I know it, I try to keep it fresh in my mind and use it from time to time. Might as well. It IS possible to run certain things more effective than a web page, and you can work much more directly with the file system. It is... hard-ish to get a webpage to "load" a file automatically... But believe me, it is good that this is the case.
Anywho. How does the app work and what is the next version going to do?
PROTO is meant to be a platform I test OTHER systems on, so he is optimized for simplicity. So how you control him is sending a HTTP 1.1 message of type Text/Plain… (This is a VERY fancy sounding way of saying "A string" in network speak). The string is 6 comma separated numbers. Linear movement XYZ and angular movement XYZ.
The app is simply 5 buttons that each sends a HTTP PUT request with fixed values. Specifically 0.5/-0.5 meter/second linear (Drive back or forward) 0.2/-0.2 radians/second angular (Turn right or turn left) Or all 0 for stop
(Yes, I just formatted normal text as code to make it more readable... I think I might be more infected by programming so much than I thought...)
Aaaaaanywho. That must be enough ranting. Time to make the app
29 notes · View notes
Text
Friday, March 31, 2023
Tumblr media
In Persona 5 Royal, just before New Year's, Joker has a strange dream in Shujin Academy as he transitions into Maruki's Cognitive Reality. But how does this scene work, on a technical level? Strictly speaking, like this. Gross.
Tumblr media
Let's go step by step and cover what exactly is going on here. In P5R, every time slot of every day is controlled by a "Scheduler" BF File. BF, otherwise known as Binary Flowscript, is a low-level bytecode scripting format created by ATLUS back in 2004 that most Persona games use. The game loads a Scheduler function based on the current timeslot, and each function is named after the timeslot it occurs on, so we can determine this takes place on Year 1, December 31st in the Late Evening.
Tumblr media
It's important this takes place on the Late Evening instead of next morning, as the shading and coloring data of Shujin Academy at night is much more moody and appropriate. Additionally, at night, all NPCs in Shujin are despawned.
Tumblr media Tumblr media
After turning off the Date UI, the game loads Event ID 485_310, a sort of precursor where Joker wakes up confused in Maruki's Office.
Tumblr media Tumblr media
Afterwards, the script sets COUNT values 18 and 22. COUNT values are special integers stored in the game's save data but often come with special properties. 18 and 22 set Joker's current field model ( .GMD ) and animation set ( .GAP ). 18 parses the integer as several arguments, in this case loading c0001_117_00.GMD, while 22 loads the requested field animations in BF0001_212.GAP. c0001_117_00.GMD is his Velvet Room Prisoner attire with GAP 212 being a slow, shambling walk.
Tumblr media Tumblr media Tumblr media
After setting many flags in the game's memory linked to specific features like disabling the main Triangle menu, the game sets COUNT 0X10 ( A.K.A 16 ) and calls Keyfree Event 651_103. While a regular Event in the game is a regular cutscene, a Keyfree Event is a sequence where you're allowed to walk around. Take for example, any chase scenes or special sequences. Keyfree events work by essentially overriding every file associated with a specific field, whether it be trigger data, npc placement, script functions, etc, and replacing it with special curated Keyfree files.
Tumblr media Tumblr media
Interestingly, this Keyfree chose specifically not to include a modified INIT script, so the scene where joker glances around and assumes he needs to go home is actually performed by the normal Shujin Academy INIT script every time you load into the field. This is why COUNT 16 is set before loading the Keyfree, the Shujin Academy INIT checks this value to determine which of several Keyfree story sequences it's in to pass onto MAIN_65110100_MidnightSchool_Ready()
Tumblr media
After setting the Place Name from Shujin Academy to ??? - ??? and redundantly setting Joker's model and animations, EVT_CA_START() applies a wavy Chromatic Aberration to the screen, making it appear hazy.
Tumblr media
The rest of the script is dedicated to making joker walk into the hallway and setting up the Blue Butterfly you chase, which is actually an NPC!
Tumblr media
Set along the hallways are various invisible trigger boxes that activate the function EVT_CA_BUTTON_ANIME(), a special function created mostly just for this scene that temporarily paints the screen blood red while increasing the strength of the hazy Chromatic Aberration.
Tumblr media
This is how the Keyfree event mostly plays out! Various invisible triggers exclusive to this Keyfree are hit that tell the game to move the butterfly farther away while playing specific voicelines and at the very end the last trigger plays a normal Event showing Joker rejecting the new reality before proceeding on with Year 2, January 1st! That's all for now, see you soon!
Tumblr media
58 notes · View notes
l-1-z-a · 11 months
Text
TS1 Edith #13 - Debug - Cool Lighting Tweaks
SimAntics is a CISC bytecode language which powers the objects in The Sims 1, The Sims 2, The Sims Online etc.
Development of SimAntics was coordinated by Jamie Doornbos with the help of Patrick J. Barrett III and Don Hopkins.
youtube
19 notes · View notes
delmondo · 6 months
Text
man when i see THIS reply i have the same reaction this person does to the original post.
the fact that it was hand-written ASM doesn't (theoretically) disqualify it from having its values toyed with if the modder finds where it's stored in the executable. the value could be sitting somwhere in the data segment, or the literal value could have been straight up pushed into an arbitrary register somewhere in the machine code, placing it somewhere deep in the code segment or whatever the PE analog to that is. also, let's say for a moment the game was written in C. since an overwhelming majority of C compilers target native machine code (with ASM likely being generated in some intermediate compilation step, so any limitation with ASM this person proposes is the reason for not being able to tweak values in the executable is transitively applied here), there is no plain C to be found in the resulting executable, rendering it completely nonsensical to write "int const TOTAL_NUM_POSSIBLE_PARKS = 2;" somewhere in it and having it just work. if this game ran on a really exotic runtime that can parse plain C files and JIT or interpret the resulting bytecode then maybe.
9 notes · View notes
roseliejack123 · 7 months
Text
From Novice to Java Pro: A Step-by-Step Learning Journey
Java programming, renowned for its platform independence and versatility, is a sought-after language in the world of software development. It's the language behind countless web applications, mobile apps, game development, and more. This blog serves as your comprehensive guide to embarking on a journey to learn and master Java programming. We'll walk you through the basics of programming, Java's syntax and structure, the essential tools and libraries, and the importance of practice. 
Tumblr media
The Path to Java Proficiency:
1. Understand the Basics of Programming:
Prior Experience: If you're new to programming, it's crucial to start with the foundational concepts. Variables, data types, control structures (if-else, loops), and functions are universal principles that you need to understand before delving into any programming language, including Java.
What to Learn: Begin by grasping the basics of programming logic and problem-solving. Familiarize yourself with concepts like variables (to store data), data types (to specify the kind of data), and control structures (to make decisions and loop through actions). These concepts serve as the building blocks for Java programming.
2. Java Syntax and Structure:
Prior Experience: As you delve into Java, you'll find that it's an object-oriented language with its unique syntax and structure. While prior programming experience is beneficial, it's not a prerequisite. You can start with Java as your first language.
What to Learn: Java introduces you to classes and objects. Classes are blueprints for creating objects, which are instances of classes. Java is known for its object-oriented nature, where you'll encounter concepts like inheritance (creating new classes based on existing ones), polymorphism (objects of different classes can be treated as objects of the same class), encapsulation (data hiding), and abstraction (simplifying complex reality by modeling classes based on real-world objects).
3. Get Your Hands on a Compiler and IDE:
Prior Experience: No prior experience is required to set up your Java development environment.
What to Learn: To start writing and running Java code, you'll need to install a Java Development Kit (JDK), which includes the Java compiler (javac). This kit allows you to compile your source code into bytecode that the Java Virtual Machine (JVM) can execute. Additionally, install an Integrated Development Environment (IDE) like Eclipse, IntelliJ IDEA, or NetBeans. These IDEs provide a user-friendly interface for coding, debugging, and managing your Java projects.
4. Learn the Java Standard Library:
Prior Experience: No specific prior experience is necessary, but familiarity with basic programming concepts is beneficial.
What to Learn: Java's power lies in its extensive standard library. This library includes pre-built classes and packages that simplify common programming tasks. For example, you can utilize classes in the java.io package to handle file input and output. You'll explore the java.lang package, which provides fundamental classes like String and Integer. Understanding this library is crucial for performing operations like file handling, string manipulation, and working with data structures.
5. Practice, Practice, Practice:
Prior Experience: No prior experience is required. This stage is suitable for beginners and those with basic programming knowledge.
What to Learn: The key to mastering Java or any programming language is practice. Apply the knowledge you've gained by working on small coding projects. Start with simple programs and gradually move on to more complex tasks. Solving programming challenges, such as those on websites like LeetCode or HackerRank, is an excellent way to put your skills to the test. Build simple applications to get hands-on experience in real-world scenarios.
6. Join Java Communities:
Prior Experience: No prior experience is needed to join Java communities.
What to Learn: Engage with Java communities and forums, such as Stack Overflow or Reddit's r/java. These platforms provide a space to ask questions, seek advice, and learn from experienced Java developers. You can also contribute by answering questions and sharing your knowledge.
7. Enroll in Java Courses:
Prior Experience: Enrolling in Java courses is suitable for learners of all levels, from beginners to advanced users.
What to Learn: ACTE Technologies offers comprehensive Java training programs that cater to a diverse range of learners. These programs are designed to provide hands-on experience and real-world examples, ensuring that you gain practical skills in Java programming.
Tumblr media
In your journey to master Java programming, structured training plays a pivotal role. ACTE Technologies is a trusted partner, offering Java training programs for learners at all levels. Whether you're a beginner taking your first steps in Java or an experienced programmer seeking to expand your skill set, they can provide the guidance and resources needed to excel in the world of Java development. Consider exploring their Java courses to kickstart or enhance your Java programming journey. Java programming is a versatile and essential language, and mastering it is a rewarding journey. With dedication, practice, and structured training, you can become a proficient Java developer. Institutions like ACTE Technologies offer valuable resources and courses to accelerate your learning process, making your journey to Java mastery even more efficient.
7 notes · View notes
sacredechoes · 2 months
Note
I'm thinking of trying my hand at some GBA Fire Emblem ROM hacking, and I was wondering, what software/program/whatever was used to make Sacred Echoes?
My workflow for Sacred Echoes ended up being pretty similar to how the original devs built FE8 - meaning I was mostly working with source code and the compiler with various command-line utilities to convert my asset files into a data format the GBA could handle. When I started the project in mid-2018, I already had some formal education and work experience in programming, so I was past the steepest part of the learning curve for these specific tools.
Please note that my methods are NOT the methods I would recommend for a first project unless you're already familiar with the software development process and using command-line tools. I went into Sacred Echoes knowing I would need to write a bunch of custom code to modify the game mechanics beyond what the beginner tools at the time allowed me to do, so I chose the more complex path. If you're looking for an all-in-one graphical editor that's more friendly to beginners, FEBuilder is amazing and constantly updated with new functions. Whichever method you decide on using, the FE Universe forum and discord are full of resources, tutorials, and helpful people, and I wouldn't have been able to succeed without them. Best of luck on your project!
That said, here's all the technical details and links to all the tools I used:
Sacred Echoes was built using a combination of GNU make (a build system used to automatically detect and compile changes to source code in large projects) and Event Assembler, a utility primarily built for editing the GBA Fire Emblem games. Event Assembler is used with a method called the buildfile, which is essentially a fancy text file with instructions for Event Assembler to insert source files into a ROM and linking different parts together. This meant I used different tools for creating each type of data. Unlike with a ROM editor (such as FEBuilder), I wasn't constantly saving my changes to the same ROM file, but instead freshly building it each time I made a change and wanted to test. This meant that if I messed up (very common when writing custom code), I could just comment out the relevant code or instructions in the buildfile and rebuild from source, rather than try to pick through the ROM by hand to fix issues.
There were cases where I would need to view and edit raw binary data with a hex editor (usually to find a pointer to compressed graphics or a data table); I prefer HxD for that.
For graphics, use any program that can edit and save .PNG files (I used MS Paint and GIMP), and then a tool for game graphics called Usenti to put them into a format the GBA can read. If you need to find and rip graphics from a ROM to edit them, GBAGE is the gold standard (and comes built-in to FEBuilder).
Maps are built from the tileset graphics using a program called Tiled.
For music, the GBA uses MIDI sequences, so any audio program with MIDI support works fine for that. (I used Anvil Studio). The MIDI file is then converted to GBA with a utility called midi2agb.
For unit data and other large data structures, I used a spreadsheet in CSV format, which can be edited with a program like Excel or LibreOffice Calc.
For map events and loading units, the GBA FE games use a scripting language called Event Assembler Language, which just gets written in a raw .txt file. A good plaintext editor like Notepad++ or SublimeText can help keep track of language syntax and keywords.
For assembly code, it is also written in a text editor, and then compiled to bytecode with devkitARM. Most of it I wrote in raw ARM assembly language (which is specific to the GBA's CPU), but in more complex cases towards the end of the project I wrote the code in the C programming language and compiled it with devkitARM.
To keep track of my source files and changes, and to make backups and version control easier, I just used GitHub because I already had an account, but you could also use GitLab or Bitbucket instead.
Finally, I used some tools made by the FE hacking community specifically for automating some tasks and formatting data - most of these are Python scripts, but some can be downloaded as compiled executables. I used "lyn", "TMX2EA", "C2EA", TextProcess and ParseFile, and AnimationAssembler. Ask on the FEU discord or check the forum's toolbox tag.
6 notes · View notes
solstakao · 6 months
Text
gender options:
female
enter text
enter hex code
enter LaTeX expression
enter java bytecode
upload image
upload smell
open bus (use last gender processed)
male
6 notes · View notes