Module jvm :: Class JavaCode
[hide private]
[frames] | no frames]

Class JavaCode

source code

JavaCode manages a list of bytecode to a specific method, by decoding a raw buffer and transform each bytecode into a JBC object

Instance Methods [hide private]
 
__init__(self, class_manager, buff) source code
 
_patch_bytecodes(self) source code
 
get(self)
Return all bytecodes
source code
 
get_raw(self) source code
 
show(self)
Display the code like a disassembler
source code
 
pretty_show(self, m_a)
Display the code like a disassembler but with instructions' links
source code
 
get_relative_idx(self, idx)
Return the relative idx by given an offset in the code
source code
 
get_at(self, idx)
Return a specific bytecode at an index
source code
 
remove_at(self, idx)
Remove bytecode at a specific index
source code
 
_adjust_maps(self, val, size) source code
 
_adjust_maps_i(self, val, size) source code
 
_adjust_branches(self, val, size) source code
 
insert_at(self, idx, byte_code)
Insert bytecode at a specific index
source code
 
remplace_at(self, idx, bytecode)
Remplace bytecode at a specific index by another bytecode (remplace = remove + insert)
source code
 
set_cm(self, cm) source code
Method Details [hide private]

get(self)

source code 

Return all bytecodes

@rtype : list

get_relative_idx(self, idx)

source code 

Return the relative idx by given an offset in the code

Parameters:
  • idx - an offset in the code

    @rtype : the relative index in the code, it's the position in the list of a bytecode

get_at(self, idx)

source code 

Return a specific bytecode at an index

@param : the index of a bytecode

@rtype : JBC

remove_at(self, idx)

source code 

Remove bytecode at a specific index

Parameters:
  • idx - the index to remove the bytecode

    @rtype : the length of the removed bytecode

insert_at(self, idx, byte_code)

source code 

Insert bytecode at a specific index

Parameters:
  • idx - the index to insert the bytecode
  • bytecode - a list which represent the bytecode

    @rtype : the length of the inserted bytecode

remplace_at(self, idx, bytecode)

source code 

Remplace bytecode at a specific index by another bytecode (remplace = remove + insert)

Parameters:
  • idx - the index to insert the bytecode
  • bytecode - a list which represent the bytecode

    @rtype : the length of the inserted bytecode