Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1012227 // Print Smart Bot's main class's constant pool using BCEL (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 1311K of libraries. Click here for Pure Java version (1677L/11K).

1  
!7
2  
3  
p {
4  
  File classFile = prepareProgramFile("main.class");
5  
  Class prog = hotwire(#1010745);
6  
  copyMainClassFileFromHotwiredProgram(prog, classFile);
7  
  JavaClass c = classToBCEL(prog);
8  
  
9  
  //pnl(c.getMethods();
10  
  for (int i = 0; i < c.getConstantPool().getLength(); i++)
11  
    print((i+1) + ". " + c.getConstantPool().getConstant(i));
12  
  
13  
  print();
14  
  print("main.class size: " + fileSize(classFile));
15  
  print("Constant pool size: " + c.getConstantPool().getLength());
16  
  print("Fields: " + l(c.getFields()));
17  
  print("Methods: " + l(c.getMethods()));
18  
}

Author comment

Began life as a copy of #1004069

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): afbdgwpgxusd, aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012227
Snippet name: Print Smart Bot's main class's constant pool using BCEL (OK)
Eternal ID of this version: #1012227/10
Text MD5: aaa96551c21c8cb6e0752a71ce9ffb2f
Transpilation MD5: 462ddb1c822d537cfcf2ac4bfb02caa6
Author: stefan
Category: javax / byte code
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-24 13:54:30
Source code size: 569 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 485 / 1033
Version history: 9 change(s)
Referenced in: [show references]