SlideShare a Scribd company logo
ADVANCED DEBUGGING USING
JAVA BYTECODES
Ganesh Samarthyam (ganesh@codeops.tech)
Don’t understand what’s under the
hood?
How to debug without source code?
Java Bytecodes
But this low level stuff is scary -
do I wanna learn it?
Did Rose knew how to use an axe
when trying to free Jack?
“On the job training!!”
So, come, let’s explore the bytecodes!
(1	-	(2	/	3))	+	((4	%	5)	*	6)
Draw the
expression tree
(1	-	(2	/	3))	+	((4	%	5)	*	6)
Perform post-order
traversal of the tree
1 2 3 / - 4 5 % 6 * +
post-order
traversal
result
Use a stack for
evaluating this
postfix expression
1 2 3 / - 4 5 % 6 * +
Advanced Debugging Using Java Bytecodes
1 2 3 / - 4 5 % 6 * +
1 1
2
1
2
3
1
0
Initial
empty
push 1 push 2 push 3
pop 3
pop 2
push 2 / 3
1
pop 0
pop 1
push 1 - 0
1
push 4
4
1
push 5
4
5
1
pop 5
pop 4
push 4 % 5
4
1
push 6
4
6
1
pop 6
pop 4
push 6 * 4
24
25
pop 24
pop 1
push 24 + 1
1 2 3 / - 4 5 % 6 * +
Initial
empty
1 2 3 / - 4 5 % 6 * +
1
push 1
1 2 3 / - 4 5 % 6 * +
1
2
push 2
1 2 3 / - 4 5 % 6 * +
1
2
3
push 3
1 2 3 / - 4 5 % 6 * +
1
0
pop 3
pop 2
push 2 / 3
1 2 3 / - 4 5 % 6 * +
1
pop 0
pop 1
push 1 - 0
1 2 3 / - 4 5 % 6 * +
1
push 4
4
1 2 3 / - 4 5 % 6 * +
1
push 5
4
5
1 2 3 / - 4 5 % 6 * +
1
pop 5
pop 4
push 4 % 5
4
1 2 3 / - 4 5 % 6 * +
1
push 6
4
6
1 2 3 / - 4 5 % 6 * +
1
pop 6
pop 4
push 6 * 4
24
1 2 3 / - 4 5 % 6 * +
25
pop 24
pop 1
push 24 + 1
1 2 3 / - 4 5 % 6 * +
Let us give
names to these
operations
push 1
push 2
push 3
div
sub
push 4
push 5
mod
push 6
mul
add
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
This is what a Java
compiler generates
iload_1
iload_2
iload_3
idiv
isub
iload 4
iload 5
irem
iload 6
imul
iadd
istore 7
push 1
push 2
push 3
div
sub
push 4
push 5
mod
push 6
mul
add
ourbytecode
Javabytecodes
(1	-	(2	/	3))	+	((4	%	5)	*	6)Source code
Java
Compiler
JavaBytecode
JVM
iload_1
iload_2
iload_3
idiv
isub
iload 4
iload 5
irem
iload 6
imul
iadd
istore 7
Java bytecodes supports object oriented programming
Typed intermediate language
Supports primitive types (int, float, double, …) and
reference types (arrays, strings, objects, …)
Instructions can be classified into various types such as:
loading (*load*)
storing (*store*)
method invocation
arithmetic operations
logical operations
control flow
memory allocation
exception handling
…
:% ! xxd in
vim
Viewing hex values of
the .class files
Advanced Debugging Using Java Bytecodes
$ cat Expr.java
class Expr {
public static void main(String []args) {
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
System.out.println("" + r);
}
}
$ javac Expr.java
$ java Expr
25
$ javap -c Expr.class
Compiled from "Expr.java"
class Expr {
Expr();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: iconst_1
1: istore_1
...
Java
compiler
JavaVM
Java
disassembler
Use java tool for
disassembling
Using Dr. Garbage’s Bytecode
Visualizer and Debugger
http://www.drgarbage.com/bytecode-visualizer/
Using Dr. Garbage’s Bytecode
Visualizer and Debugger
http://www.drgarbage.com/bytecode-visualizer/
System.out.println(“Hello World");
Java bytecodes
// disassembled code using javap tool
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3 // String Hello World
5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
int i = 10;
if(i != 20)
i = i*20;
System.out.println(i);
javap -c
0: bipush 10
2: istore_1
3: iload_1
4: bipush 20
6: if_icmpeq 14
9: iload_1
10: bipush 20
12: imul
13: istore_1
14: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
17: iload_1
18: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
21: return
public static void
main(java.lang.String[]);
descriptor: ??
flags: ??, ??
Code:
stack=??, locals=??, args_size=??
Pop
Quiz
public static void main(String []args) {
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
System.out.println("" + r);
}
public static void
main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=8, args_size=1
Answer
1 2 3 / - 4 5 % 6 * +
1 1
2
1
2
3
1
0
Initial
empty
push 1 push 2 push 3
pop 3
pop 2
push 2 / 3
1
pop 0
pop 1
push 1 - 0
1
push 4
4
1
push 5
4
5
1
pop 5
pop 4
push 4 % 5
4
1
push 6
4
6
1
pop 6
pop 4
push 6 * 4
24
25
pop 24
pop 1
push 24 + 1
Answer:
max stack
value is 3
Supplier<String> s = () -> "hello world";
System.out.println(s.get());
Pop
Quiz
What bytecode
instruction would
s.get() generate?
invokedynamic
Answer
Pop
Quiz
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: iload_2
5: bipush 10
7: if_icmpge 20
10: iload_1
11: iload_2
12: iadd
13: istore_1
14: iinc 2, 1
17: goto 4
20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
23: iload_1
24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
27: return
Decompile this
assembly code
Answer
public static void main(String []args) {
int sum = 0;
for(int i = 0; i < 10; i++) {
sum += i;
}
System.out.println(sum);
}
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: iload_2
5: bipush 10
7: if_icmpge 20
10: iload_1
11: iload_2
12: iadd
13: istore_1
14: iinc 2, 1
17: goto 4
20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
23: iload_1
24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
27: return
What is the “magic number"
of Java’s “.class” files?
Pop
Quiz
A. 0xDEADBEEF
B. 0xCAFEBABE
C. 0xC0DEC0DA
D. 0xBAADF00D
CAFEBABE
Let’s fix it
class URL {
public static void main(String []args) {
http://www.google.com
System.out.println("Hello");
}
}
http: is a label and // is start
of a comment!!
public static void main(java.lang.String[]);
Code:
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3 // String Hello
5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
Question	
What	will	be	the	output	of	this	program?
class Color {
int red,	green,	blue;
void Color()	{
red	=	10;	green	=	10; blue	=	10;
}
void printColor()	{
System.out.println("red:	"	+	red	+	"	green:	"	+	green	+	"	blue:	"	+	blue);
}
public	static	void	main(String	[]	args)	{
Color color=	new Color();
color.printColor();
}
}
A.	Compiler	error:	no	constructor	provided	for	the	class
B.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	0	green:	0	blue:	0
C.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	10	green:	10	blue:	10
D.	Compiles	fine,	and	when	run,	crashes	by	throwing	NullPointerException
Answer
What	will	be	the	output	of	this	program?
class Color {
int red,	green,	blue;
void Color()	{
red	=	10;	green	=	10;	blue	=	10;
}
void printColor()	{
System.out.println("red:	"	+	red	+	"	green:	"	+	green	+	"	blue:	"	+	blue);
}
public	static	void	main(String	[]	args)	{
Color color=	new Color();
color.printColor();
}
}
A.	Compiler	error:	no	constructor	provided	for	the	class
B.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	0	green:	0	blue:	0
C.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	10	green:	10	blue:	10
D.	Compiles	fine,	and	when	run,	crashes	by	throwing	NullPointerException
$ javap Color.class
Compiled from "Color.java"
class Color {
int red;
int green;
int blue;
Color();
void Color();
void printColor();
public static void main(java.lang.String[]);
}
Color();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
void Color();
Code:
0: aload_0
1: bipush 10
3: putfield #2 // Field red:I
6: aload_0
7: bipush 10
9: putfield #3 // Field green:I
12: aload_0
13: bipush 10
15: putfield #4 // Field blue:I
18: return
Aha! The generated code
doesn’t look right!
				void	Color()	{	
	 				red	=	10;	green	=	10;	blue	=	10;	
				}
abstract class Printer {
private Integer portNumber = getPortNumber();
abstract Integer getPortNumber();
public static void main(String[]s) {
Printer p = new LPDPrinter();
System.out.println(p.portNumber);
}
}
class LPDPrinter extends Printer {
/* Line Printer Deamon port no is 515 */
private Integer defaultPortNumber = 515;
Integer getPortNumber() {
return defaultPortNumber;
}
}
abstract class Printer {
private Integer portNumber = getPortNumber();
abstract Integer getPortNumber();
public static void main(String[]s) {
Printer p = new LPDPrinter();
System.out.println(p.portNumber);
}
}
class LPDPrinter extends Printer {
/* Line Printer Deamon port no is 515 */
private Integer defaultPortNumber = 515;
Integer getPortNumber() {
return defaultPortNumber;
}
}
$ javap -c LPDPrinter.class
Compiled from "Printer.java"
class LPDPrinter extends Printer {
LPDPrinter();
Code:
0: aload_0
1: invokespecial #1 // Method Printer."<init>":()V
4: aload_0
5: sipush 515
8: invokestatic #2 // Method java/lang/Integer.valueOf:(I)Ljava/
lang/Integer;
11: putfield #3 // Field defaultPortNumber:Ljava/lang/Integer;
14: return
java.lang.Integer getPortNumber();
Code:
0: aload_0
1: getfield #3 // Field defaultPortNumber:Ljava/lang/Integer;
4: areturn
}
Initialisation happens *after*
the base class constructor got
javap can get you lost in
details!
int ch = 0;
while((ch = inputFile.read()) != 0) {
System.out.print(ch);
}
48: iconst_0
49: istore 7
51: aload 5
53: invokevirtual #8 // Method java/io/FileReader.read:()I
56: dup
57: istore 7
59: ifeq 73
62: getstatic #9 // Field java/lang/System.out:Ljava/io/PrintStream
65: iload 7
67: invokevirtual #10 // Method java/io/PrintStream.print:(I)V
• Difficult to debug when reflection and runtime class
generation is involved
• Obfuscated bytecodes are extremely difficult to debug
FUN PROJECT
The best way to learn Java bytecodes is to implement a Java
disassembler on your own!
For implementation, read the documentation of Java
bytecodes (in the JVM specification) and use javap tool as
the reference implementation.
BOOKSTO READ
Free download here: https://docs.oracle.com/javase/specs/jvms/se8/jvms8.pdf
BOOKSTO READ
BOOKSTO READ
IMAGE CREDITS
• https://pixabay.com/static/uploads/photo/2015/12/28/15/58/ferrari-1111582_960_720.jpg
• http://i.dailymail.co.uk/i/pix/2014/08/29/article-0-0296355F000004B0-113_634x421.jpg
• http://blogs.shell.com/climatechange/wp-content/uploads/2015/01/Check-under-the-hood.jpg
• https://diaryofabusymumdotcom.files.wordpress.com/2015/01/1369952540_be029c8337.jpg
• http://trentarthur.ca/wp-content/uploads/2013/05/gatsby.jpg
• http://cdn.playbuzz.com/cdn/84b94651-08da-4191-9b45-069535cf523f/9c35f887-a6fc-4c8d-861a-f323078709e8.jpg
• http://pad2.whstatic.com/images/thumb/5/54/Draw-a-Simple-Tree-Step-2.jpg/aid594851-728px-Draw-a-Simple-Tree-Step-2.jpg
• http://www.seabreeze.com.au/Img/Photos/Windsurfing/5350271.jpg
• https://d.gr-assets.com/hostedimages/1380222758ra/461081.gif
• http://cdn.shopify.com/s/files/1/0021/6982/products/GW-7693274_large.jpg?v=1283553128
• http://www.fisher-price.com/en_IN/Images/RMA_RWD_rock_a_stack_tcm222-163387.jpg
• http://www.njfamily.com/NJ-Family/January-2011/Learn-How-to-Spot-a-Learning-Disability/Boy-learning-disability.jpg
• https://teens.drugabuse.gov/sites/default/files/styles/medium/public/NIDA-News-What-was-down-the-hole-Alice.jpg?itok=DH19L7F2
• http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg
• http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg
• http://www.urbanspaces.co.uk/image/error-message-error-us.jpg
• http://conservationmagazine.org/wordpress/wp-content/uploads/2013/05/dig-deeper.jpg
• http://4.bp.blogspot.com/-BAZm9rddEhQ/TWy441M-p1I/AAAAAAAAAQg/_SKF8PMkVHA/s1600/
mr%2Bfixit.tif%2B%2528Converted%2529--6.jpg

More Related Content

What's hot (20)

Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting Lambdas
Ganesh Samarthyam
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
Soumya Behera
 
Java Generics
Java GenericsJava Generics
Java Generics
Zülfikar Karakaya
 
Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8
Ganesh Samarthyam
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
David Gómez García
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
Pramod Kumar
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
Nishan Barot
 
Java Generics
Java GenericsJava Generics
Java Generics
Carol McDonald
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL file
RACHIT_GUPTA
 
Java Generics for Dummies
Java Generics for DummiesJava Generics for Dummies
Java Generics for Dummies
knutmork
 
Java programs
Java programsJava programs
Java programs
Mukund Gandrakota
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
Trisha Gee
 
Initial Java Core Concept
Initial Java Core ConceptInitial Java Core Concept
Initial Java Core Concept
Rays Technologies
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
Andrzej Grzesik
 
Why Learn Python?
Why Learn Python?Why Learn Python?
Why Learn Python?
Christine Cheung
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
Rafael Winterhalter
 
Java practical
Java practicalJava practical
Java practical
shweta-sharma99
 
OCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertionsOCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertions
Hari kiran G
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Susan Potter
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in Java
Doug Hawkins
 
Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting Lambdas
Ganesh Samarthyam
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
Soumya Behera
 
Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8
Ganesh Samarthyam
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
David Gómez García
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
Pramod Kumar
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
Nishan Barot
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL file
RACHIT_GUPTA
 
Java Generics for Dummies
Java Generics for DummiesJava Generics for Dummies
Java Generics for Dummies
knutmork
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
Trisha Gee
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
Rafael Winterhalter
 
OCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertionsOCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertions
Hari kiran G
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Susan Potter
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in Java
Doug Hawkins
 

Viewers also liked (20)

Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
CodeOps Technologies LLP
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
Nawazish Mohammad Khan
 
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
CodeOps Technologies LLP
 
Better java with design
Better java with designBetter java with design
Better java with design
Narayann Swaami
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture
CodeOps Technologies LLP
 
7 best quotes on dev ops
7 best quotes on dev ops7 best quotes on dev ops
7 best quotes on dev ops
CodeOps Technologies LLP
 
Choosing Between Cross Platform of Native Development
Choosing	Between Cross Platform of Native DevelopmentChoosing	Between Cross Platform of Native Development
Choosing Between Cross Platform of Native Development
CodeOps Technologies LLP
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
CodeOps Technologies LLP
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
Krishna Kishore
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
CodeOps Technologies LLP
 
Java Concurrency by Example
Java Concurrency by ExampleJava Concurrency by Example
Java Concurrency by Example
CodeOps Technologies LLP
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)
Heartin Jacob
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous Delivery
Murughan Palaniachari
 
DevOps Toolchain v1.0
DevOps Toolchain v1.0DevOps Toolchain v1.0
DevOps Toolchain v1.0
Giragadurai Vallirajan
 
DevOps game marshmallow challenge
DevOps game marshmallow challengeDevOps game marshmallow challenge
DevOps game marshmallow challenge
Murughan Palaniachari
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
Ganesh Samarthyam
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
CodeOps Technologies LLP
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Ganesh Samarthyam
 
Core Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug HuntCore Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug Hunt
CodeOps Technologies LLP
 
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
CodeOps Technologies LLP
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture
CodeOps Technologies LLP
 
Choosing Between Cross Platform of Native Development
Choosing	Between Cross Platform of Native DevelopmentChoosing	Between Cross Platform of Native Development
Choosing Between Cross Platform of Native Development
CodeOps Technologies LLP
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)
Heartin Jacob
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous Delivery
Murughan Palaniachari
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
Ganesh Samarthyam
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Ganesh Samarthyam
 
Ad

Similar to Advanced Debugging Using Java Bytecodes (20)

Java Bytecodes by Example
Java Bytecodes by ExampleJava Bytecodes by Example
Java Bytecodes by Example
Ganesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
Charles Nutter
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
Javed Ahmed Samo
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
sunny khan
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012
Anton Arhipov
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
Laxman Puri
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015
Raimon Ràfols
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
Ecommerce Solution Provider SysIQ
 
Jvm internals
Jvm internalsJvm internals
Jvm internals
Luiz Fernando Teston
 
The bytecode gobbledygook
The bytecode gobbledygookThe bytecode gobbledygook
The bytecode gobbledygook
Raimon Ràfols
 
Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014
Raimon Ràfols
 
02 basic java programming and operators
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operators
Danairat Thanabodithammachari
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
Gabor Paller
 
Jvm2
Jvm2Jvm2
Jvm2
Mykola Bova
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware Analysis
Brian Baskin
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
Anton Arhipov
 
Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014
Raimon Ràfols
 
Java introduction
Java introductionJava introduction
Java introduction
The icfai university jaipur
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
Charles Nutter
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
sunny khan
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012
Anton Arhipov
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
Laxman Puri
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015
Raimon Ràfols
 
The bytecode gobbledygook
The bytecode gobbledygookThe bytecode gobbledygook
The bytecode gobbledygook
Raimon Ràfols
 
Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014
Raimon Ràfols
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
Gabor Paller
 
Java bytecode Malware Analysis
Java bytecode Malware AnalysisJava bytecode Malware Analysis
Java bytecode Malware Analysis
Brian Baskin
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
Anton Arhipov
 
Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014
Raimon Ràfols
 
Ad

More from Ganesh Samarthyam (20)

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
Ganesh Samarthyam
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
Ganesh Samarthyam
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
Ganesh Samarthyam
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
Ganesh Samarthyam
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
Ganesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
Ganesh Samarthyam
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
Ganesh Samarthyam
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
Ganesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
Ganesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
Ganesh Samarthyam
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
Ganesh Samarthyam
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
Ganesh Samarthyam
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
Ganesh Samarthyam
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
Ganesh Samarthyam
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
Ganesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
Ganesh Samarthyam
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
Ganesh Samarthyam
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
Ganesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
Ganesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
Ganesh Samarthyam
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 

Recently uploaded (20)

FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The SequelMarketo & Dynamics can be Most Excellent to Each Other – The Sequel
Marketo & Dynamics can be Most Excellent to Each Other – The Sequel
BradBedford3
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Maximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdfMaximizing Business Value with AWS Consulting Services.pdf
Maximizing Business Value with AWS Consulting Services.pdf
Elena Mia
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 

Advanced Debugging Using Java Bytecodes

  • 1. ADVANCED DEBUGGING USING JAVA BYTECODES Ganesh Samarthyam ([email protected])
  • 2. Don’t understand what’s under the hood?
  • 3. How to debug without source code?
  • 4. Java Bytecodes But this low level stuff is scary - do I wanna learn it?
  • 5. Did Rose knew how to use an axe when trying to free Jack?
  • 6. “On the job training!!”
  • 7. So, come, let’s explore the bytecodes!
  • 11. 1 2 3 / - 4 5 % 6 * + post-order traversal result
  • 12. Use a stack for evaluating this postfix expression 1 2 3 / - 4 5 % 6 * +
  • 14. 1 2 3 / - 4 5 % 6 * + 1 1 2 1 2 3 1 0 Initial empty push 1 push 2 push 3 pop 3 pop 2 push 2 / 3 1 pop 0 pop 1 push 1 - 0 1 push 4 4 1 push 5 4 5 1 pop 5 pop 4 push 4 % 5 4 1 push 6 4 6 1 pop 6 pop 4 push 6 * 4 24 25 pop 24 pop 1 push 24 + 1
  • 15. 1 2 3 / - 4 5 % 6 * + Initial empty
  • 16. 1 2 3 / - 4 5 % 6 * + 1 push 1
  • 17. 1 2 3 / - 4 5 % 6 * + 1 2 push 2
  • 18. 1 2 3 / - 4 5 % 6 * + 1 2 3 push 3
  • 19. 1 2 3 / - 4 5 % 6 * + 1 0 pop 3 pop 2 push 2 / 3
  • 20. 1 2 3 / - 4 5 % 6 * + 1 pop 0 pop 1 push 1 - 0
  • 21. 1 2 3 / - 4 5 % 6 * + 1 push 4 4
  • 22. 1 2 3 / - 4 5 % 6 * + 1 push 5 4 5
  • 23. 1 2 3 / - 4 5 % 6 * + 1 pop 5 pop 4 push 4 % 5 4
  • 24. 1 2 3 / - 4 5 % 6 * + 1 push 6 4 6
  • 25. 1 2 3 / - 4 5 % 6 * + 1 pop 6 pop 4 push 6 * 4 24
  • 26. 1 2 3 / - 4 5 % 6 * + 25 pop 24 pop 1 push 24 + 1
  • 27. 1 2 3 / - 4 5 % 6 * + Let us give names to these operations push 1 push 2 push 3 div sub push 4 push 5 mod push 6 mul add
  • 28. int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); This is what a Java compiler generates iload_1 iload_2 iload_3 idiv isub iload 4 iload 5 irem iload 6 imul iadd istore 7 push 1 push 2 push 3 div sub push 4 push 5 mod push 6 mul add ourbytecode Javabytecodes
  • 30. Java bytecodes supports object oriented programming Typed intermediate language Supports primitive types (int, float, double, …) and reference types (arrays, strings, objects, …) Instructions can be classified into various types such as: loading (*load*) storing (*store*) method invocation arithmetic operations logical operations control flow memory allocation exception handling …
  • 31. :% ! xxd in vim Viewing hex values of the .class files
  • 33. $ cat Expr.java class Expr { public static void main(String []args) { int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); System.out.println("" + r); } } $ javac Expr.java $ java Expr 25 $ javap -c Expr.class Compiled from "Expr.java" class Expr { Expr(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: iconst_1 1: istore_1 ... Java compiler JavaVM Java disassembler Use java tool for disassembling
  • 34. Using Dr. Garbage’s Bytecode Visualizer and Debugger http://www.drgarbage.com/bytecode-visualizer/
  • 35. Using Dr. Garbage’s Bytecode Visualizer and Debugger http://www.drgarbage.com/bytecode-visualizer/
  • 36. System.out.println(“Hello World"); Java bytecodes // disassembled code using javap tool 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello World 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
  • 37. int i = 10; if(i != 20) i = i*20; System.out.println(i); javap -c 0: bipush 10 2: istore_1 3: iload_1 4: bipush 20 6: if_icmpeq 14 9: iload_1 10: bipush 20 12: imul 13: istore_1 14: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 17: iload_1 18: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 21: return
  • 38. public static void main(java.lang.String[]); descriptor: ?? flags: ??, ?? Code: stack=??, locals=??, args_size=?? Pop Quiz public static void main(String []args) { int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); System.out.println("" + r); }
  • 39. public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code: stack=3, locals=8, args_size=1 Answer
  • 40. 1 2 3 / - 4 5 % 6 * + 1 1 2 1 2 3 1 0 Initial empty push 1 push 2 push 3 pop 3 pop 2 push 2 / 3 1 pop 0 pop 1 push 1 - 0 1 push 4 4 1 push 5 4 5 1 pop 5 pop 4 push 4 % 5 4 1 push 6 4 6 1 pop 6 pop 4 push 6 * 4 24 25 pop 24 pop 1 push 24 + 1 Answer: max stack value is 3
  • 41. Supplier<String> s = () -> "hello world"; System.out.println(s.get()); Pop Quiz What bytecode instruction would s.get() generate?
  • 43. Pop Quiz 0: iconst_0 1: istore_1 2: iconst_0 3: istore_2 4: iload_2 5: bipush 10 7: if_icmpge 20 10: iload_1 11: iload_2 12: iadd 13: istore_1 14: iinc 2, 1 17: goto 4 20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 23: iload_1 24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 27: return Decompile this assembly code
  • 44. Answer public static void main(String []args) { int sum = 0; for(int i = 0; i < 10; i++) { sum += i; } System.out.println(sum); } 0: iconst_0 1: istore_1 2: iconst_0 3: istore_2 4: iload_2 5: bipush 10 7: if_icmpge 20 10: iload_1 11: iload_2 12: iadd 13: istore_1 14: iinc 2, 1 17: goto 4 20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 23: iload_1 24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 27: return
  • 45. What is the “magic number" of Java’s “.class” files? Pop Quiz A. 0xDEADBEEF B. 0xCAFEBABE C. 0xC0DEC0DA D. 0xBAADF00D
  • 48. class URL { public static void main(String []args) { http://www.google.com System.out.println("Hello"); } } http: is a label and // is start of a comment!! public static void main(java.lang.String[]); Code: 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return
  • 49. Question What will be the output of this program? class Color { int red, green, blue; void Color() { red = 10; green = 10; blue = 10; } void printColor() { System.out.println("red: " + red + " green: " + green + " blue: " + blue); } public static void main(String [] args) { Color color= new Color(); color.printColor(); } } A. Compiler error: no constructor provided for the class B. Compiles fine, and when run, it prints the following: red: 0 green: 0 blue: 0 C. Compiles fine, and when run, it prints the following: red: 10 green: 10 blue: 10 D. Compiles fine, and when run, crashes by throwing NullPointerException
  • 50. Answer What will be the output of this program? class Color { int red, green, blue; void Color() { red = 10; green = 10; blue = 10; } void printColor() { System.out.println("red: " + red + " green: " + green + " blue: " + blue); } public static void main(String [] args) { Color color= new Color(); color.printColor(); } } A. Compiler error: no constructor provided for the class B. Compiles fine, and when run, it prints the following: red: 0 green: 0 blue: 0 C. Compiles fine, and when run, it prints the following: red: 10 green: 10 blue: 10 D. Compiles fine, and when run, crashes by throwing NullPointerException
  • 51. $ javap Color.class Compiled from "Color.java" class Color { int red; int green; int blue; Color(); void Color(); void printColor(); public static void main(java.lang.String[]); } Color(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return void Color(); Code: 0: aload_0 1: bipush 10 3: putfield #2 // Field red:I 6: aload_0 7: bipush 10 9: putfield #3 // Field green:I 12: aload_0 13: bipush 10 15: putfield #4 // Field blue:I 18: return Aha! The generated code doesn’t look right! void Color() { red = 10; green = 10; blue = 10; }
  • 52. abstract class Printer { private Integer portNumber = getPortNumber(); abstract Integer getPortNumber(); public static void main(String[]s) { Printer p = new LPDPrinter(); System.out.println(p.portNumber); } } class LPDPrinter extends Printer { /* Line Printer Deamon port no is 515 */ private Integer defaultPortNumber = 515; Integer getPortNumber() { return defaultPortNumber; } }
  • 53. abstract class Printer { private Integer portNumber = getPortNumber(); abstract Integer getPortNumber(); public static void main(String[]s) { Printer p = new LPDPrinter(); System.out.println(p.portNumber); } } class LPDPrinter extends Printer { /* Line Printer Deamon port no is 515 */ private Integer defaultPortNumber = 515; Integer getPortNumber() { return defaultPortNumber; } } $ javap -c LPDPrinter.class Compiled from "Printer.java" class LPDPrinter extends Printer { LPDPrinter(); Code: 0: aload_0 1: invokespecial #1 // Method Printer."<init>":()V 4: aload_0 5: sipush 515 8: invokestatic #2 // Method java/lang/Integer.valueOf:(I)Ljava/ lang/Integer; 11: putfield #3 // Field defaultPortNumber:Ljava/lang/Integer; 14: return java.lang.Integer getPortNumber(); Code: 0: aload_0 1: getfield #3 // Field defaultPortNumber:Ljava/lang/Integer; 4: areturn } Initialisation happens *after* the base class constructor got
  • 54. javap can get you lost in details! int ch = 0; while((ch = inputFile.read()) != 0) { System.out.print(ch); } 48: iconst_0 49: istore 7 51: aload 5 53: invokevirtual #8 // Method java/io/FileReader.read:()I 56: dup 57: istore 7 59: ifeq 73 62: getstatic #9 // Field java/lang/System.out:Ljava/io/PrintStream 65: iload 7 67: invokevirtual #10 // Method java/io/PrintStream.print:(I)V
  • 55. • Difficult to debug when reflection and runtime class generation is involved • Obfuscated bytecodes are extremely difficult to debug
  • 56. FUN PROJECT The best way to learn Java bytecodes is to implement a Java disassembler on your own! For implementation, read the documentation of Java bytecodes (in the JVM specification) and use javap tool as the reference implementation.
  • 57. BOOKSTO READ Free download here: https://docs.oracle.com/javase/specs/jvms/se8/jvms8.pdf
  • 60. IMAGE CREDITS • https://pixabay.com/static/uploads/photo/2015/12/28/15/58/ferrari-1111582_960_720.jpg • http://i.dailymail.co.uk/i/pix/2014/08/29/article-0-0296355F000004B0-113_634x421.jpg • http://blogs.shell.com/climatechange/wp-content/uploads/2015/01/Check-under-the-hood.jpg • https://diaryofabusymumdotcom.files.wordpress.com/2015/01/1369952540_be029c8337.jpg • http://trentarthur.ca/wp-content/uploads/2013/05/gatsby.jpg • http://cdn.playbuzz.com/cdn/84b94651-08da-4191-9b45-069535cf523f/9c35f887-a6fc-4c8d-861a-f323078709e8.jpg • http://pad2.whstatic.com/images/thumb/5/54/Draw-a-Simple-Tree-Step-2.jpg/aid594851-728px-Draw-a-Simple-Tree-Step-2.jpg • http://www.seabreeze.com.au/Img/Photos/Windsurfing/5350271.jpg • https://d.gr-assets.com/hostedimages/1380222758ra/461081.gif • http://cdn.shopify.com/s/files/1/0021/6982/products/GW-7693274_large.jpg?v=1283553128 • http://www.fisher-price.com/en_IN/Images/RMA_RWD_rock_a_stack_tcm222-163387.jpg • http://www.njfamily.com/NJ-Family/January-2011/Learn-How-to-Spot-a-Learning-Disability/Boy-learning-disability.jpg • https://teens.drugabuse.gov/sites/default/files/styles/medium/public/NIDA-News-What-was-down-the-hole-Alice.jpg?itok=DH19L7F2 • http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg • http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg • http://www.urbanspaces.co.uk/image/error-message-error-us.jpg • http://conservationmagazine.org/wordpress/wp-content/uploads/2013/05/dig-deeper.jpg • http://4.bp.blogspot.com/-BAZm9rddEhQ/TWy441M-p1I/AAAAAAAAAQg/_SKF8PMkVHA/s1600/ mr%2Bfixit.tif%2B%2528Converted%2529--6.jpg