String getCodeWithArguments(int size) throws IOException { try { return code.replace( "@@1", argumentType.elementAt(0) + argumentFunction.elementAt(0) + "(" + size + ")"); } catch (Exception d) { LogHolder.getInstanceOf() .addLog("********* Error ********* in function getCodeWithArguments...", true); Miscellaneous.println(" Enter a character to continue..."); System.in.read(); } return ""; }
public String getCodeWithArguments( Un fixedArguments, Vector<Integer> sizesOfIndividualParameters) { String ret = code; try { if (argumentFunction.size() != sizesOfIndividualParameters.size()) { Miscellaneous.printlnErr( "either bytecode defination file is wrong or opcode-parameter file is wrong."); Miscellaneous.printlnErr( "bytecode defination required " + argumentFunction.size() + " parameters, in " + "contrast the opcode-parameter file required " + sizesOfIndividualParameters.size() + " parameters"); Miscellaneous.exit(); } LFRevUn.bigEndian = true; for (int loop = argumentFunction.size() - 1; loop >= 0; loop--) { String nextThingToReplace = "@@" + (loop + 1); int argSize = sizesOfIndividualParameters.elementAt(loop); Un afterCutting = Un.cutBytes(argSize, fixedArguments); String toReplaceWith = "(0x" + afterCutting.toString() + ")"; if (loop != argumentFunction.size() - 1) { toReplaceWith += ", "; } ret = ret.replace(nextThingToReplace, argumentType.elementAt(loop) + toReplaceWith); } LFRevUn.bigEndian = false; } catch (Exception d) { Miscellaneous.println("Error in bytecode defination file. " + this + ", " + fixedArguments); d.printStackTrace(); Miscellaneous.exit(); } return ret; }
public String getCodeWithArguments( Vector<Integer> sizesOfIndividualParameters, int totalSizeOfParmeters) { String ret = code; int offSet = totalSizeOfParmeters; for (int loop = 0; loop < argumentFunction.size(); loop++) { offSet -= sizesOfIndividualParameters.elementAt(loop); String funPara = sizesOfIndividualParameters.elementAt(loop) + ""; if (argumentFunction.elementAt(loop).contains(OFFSET_FUNCTION)) { funPara += ", " + offSet; } String toReplaceWith = argumentType.elementAt(loop) + argumentFunction.elementAt(loop) + "(" + funPara + ")"; if (loop + 1 < argumentFunction.size()) { toReplaceWith += ", "; } ret = ret.replace("@@" + (loop + 1), toReplaceWith); } return ret; }
public boolean hasArguments() { return argumentFunction.size() > 0 ? true : false; }