Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java class pattern error[E0004]: Type error, Array expanded past end of data. #120

Open
Guigumua opened this issue Jun 6, 2023 · 2 comments

Comments

@Guigumua
Copy link
Contributor

Guigumua commented Jun 6, 2023

attribute_name_index value show error[E0004]: Type error, Array expanded past end of data.

image

Reappear

Java source code:

class Test {
  private String a = "a";
  private String b = "b";
  private String c = "c";
  private String d = "d";
  private String e = "e";
  private String f = "f";
  private String g = "g";
  private String h = "h";
  private String i = "i";
  private String j = "j";
  private String k = "k";
  private String l = "l";
  private String m = "m";
  private String n = "n";
  private String o = "o";
  private String p = "p";
  private String q = "q";
  private String r = "r";
  private String s = "s";
  private String t = "t";
  private String u = "u";
  private String v = "v";
  private String w = "w";
  private String x = "x";
  private String y = "y";
  private String z = "z";
  private String aa = "aa";
  private String ab = "ab";
  private String ac = "ac";
  private String ad = "ad";
  private String ae = "ae";
  private String af = "af";
  private String ag = "ag";
  private String ah = "ah";
  private String ai = "ai";
  private String aj = "aj";
  private String ak = "ak";
  private String al = "al";
  private String am = "am";
  private String an = "an";
  private String ao = "ao";
  private String ap = "ap";
  private String aq = "aq";
  private String ar = "ar";
  private String as = "as";
  private String at = "at";
  private String au = "au";
  private String av = "av";
  private String aw = "aw";
  private String ax = "ax";
  private String ay = "ay";
  private String az = "az";
  private String ba = "ba";
  private String bb = "bb";
  private String bc = "bc";
  private String bd = "bd";
  private String be = "be";
  private String bf = "bf";
  private String bg = "bg";

  public static void main(String[] args) throws Exception {
    System.out.println("Hello World!");
    System.out.println("Hello World");
  }
  
}

error occurred in file.methods[n].attributes[n].attribute_name_index and file.methods[n].attributes[n].atrributes[n].attribute_name_index :

image

if delete a field, error occurred in file.methods[n].attributes[n].atrributes[n].attribute_name_index:

image

if delete two field, no orror:

image

I don't know if this error is related to the number of fields or the constant pool size, I also got this error with another class that has multiple methods but only one field.

@paxcut
Copy link
Contributor

paxcut commented Jun 6, 2023

can you provide the binary file to test the pattern or instructions on how to generate fro, the source code?

@Guigumua
Copy link
Contributor Author

Guigumua commented Jun 6, 2023

can you provide the binary file to test the pattern or instructions on how to generate fro, the source code?

https://github.com/Guigumua/file/blob/main/Test.class

If you can't reproduce the problem, you can try adding more fields, source code in the same folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants