From Java bytecode to ASM practice

1. Overview The concept of AOP (Aspect Oriented Programming) is now widely used. The following is an explanation excerpted from Baidu Encyclopedia, which is relatively easy to understand. In the software industry, AOP is the abbreviation of Aspect Oriented Programming, which means: Aspect-oriented programming, a technology that achieves unified maintenance of program functions through pre-compilation […]

Stripping the pants of Kotlin intrinsic functions by looking at bytecode instructions

Exposing Kotlin intrinsic functions by looking at bytecode instructions There are many articles on the Internet about Kotlin inline functions. Most of them tell you the conclusion. Just use the xxx keyword and forget about it after a while. This article will guide you. From the JVM bytecode, I will take you step by step […]

PE dump bytecode viewer

Writing of own code viewer for PE files #include<Windows.h> #include<Richedit.h> #include<CommCtrl.h> #pragma comment(lib,”comctl32.lib”) #include<strsafe.h> #include<stdio.h> #include”resource.h” //TCHAR szAppName[MAX_PATH] = TEXT(“PE”); HANDLE hInstance, hWinMain, hWinEdit, hRichEdit; int dwStop, totalSize; char* lpMemory; DWORD WINAPI _OpenFile(LPVOID); void _Processing(); void _AppendInfo(const TCHAR* lpsz);//Append text to the text box void init(); void Exception(void); BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); void […]

[The vast road to architecture] 1. Class File bytecode file analysis

The JDK version of all content in this article is OpenJDK 11 JDK11 Class File official description. Java parsing bytecode file source code reference, the following is a partial bytecode parsing source code display. public ClassFile(DataInputStream in) {<!– –> try {<!– –> //magic: 0xCAFEBABE this.magic = ClassReader.readInt(in); System.out.println(“magic: >>> ” + this.magic); this.minorVersion = ClassReader.readUnsignedShort(in); […]

Android does not recognize Java compiled bytecode, which cost me a weekend

1. Problem background I have an SDK integrated into SystemUI. SystemUI prompted the following error when building Coverage over the weekend (some irrelevant information was omitted, and only key text was retained): dex2oatd method_verifier.cc:5126] void …c(…) failed to verify: [0x115] expected to be within a catch-all for an instruction when a monitor is held dex2oatd […]

Gradle development (3), bytecode instrumentation, automatically registers and summarizes mapping table classes that collect page routing information during compilation.

Article directory Gradle development, bytecode instrumentation, automatic registration of routing components 1. What is bytecode instrumentation? 1.2 Scenario 1.3 Technical principles 2. Automatic registration of page routing 2.1 Create a new Transform 2.2 Collection of information 2.3 Generate mapping table 3. Summarize all mapping tables 3.1 Structure of target class 3.2 Install and introduce the […]

Android compiler instrumentation manipulates bytecode

This article explains how to compile instrumentation manipulation bytecode. Just use ASM to achieve a simple compilation and instrumentation effect. Through instrumentation, the corresponding log is output when each Activity is opened. Implementation ideas The process mainly consists of two steps: 1. Traverse all .class files in the project? How to find all the .class […]

The cornerstone of traffic governance – full-link traffic label transparent transmission based on bytecode enhancement

AuthorAuthor: Li Lai, Senior Software Engineer, Huawei Cloud 1. Full-link traffic label transparent transmission In the microservice architecture, traffic labels are used to mark and classify traffic, enabling more granular routing, load balancing, flow control and other traffic management capabilities between microservices. Taking HTTP messages as an example, each header can be a traffic label. […]

JVM bytecode structure file analysis

Question: How many interfaces can be implemented in Java? 00 00==>FFFF==>15*16^3 + 15*16^2 + 15*16 + 15 class constant pool type classification One: Source code package com.tuling.smlz.jvm.classbyatecode; /** * Created by smlz on 2019/11/5. */ public class TulingByteCode { private String userName; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName […]