Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.68 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.68 KB

j2struct

use java to parse the binary struct of "C/C++"

example

if you have a gay colleague, he is the R&D position of "C/C++", because of some businesses, he wrote binary files using structure.

view the following c/c++ code

image image

you need to read this binary file, but you only know "java" language.

you: "oh, my God, what should I do"

don't worry, j2struct helps you. XDDDDDDDDDD

view the following java code

image image image image

is it very cool?

it may also be very backward! XDDDDDDD

use

J2Struct.readStruct(); or J2Struct.readSturctAutoAlign(); not StructUtil

if your Class needs to be used as a structure object, use annotation @Struct(index=0).

your Class attribute needs to be used as a structure attribute. please use the corresponding annotation. the index configuration represents the order of attributes in the structure

j2struct can not only read struct binary, but also write struct binary!

j2struct supports all basic types

image