Esempio n. 1
0
//do action to the node.
void ONConstant::Action(Node *node)
{
	if ( !JudgeType(node) ) {
		return;
	}

	// do not obfuscate constant char 'x'
	if ( node->tokenString[0] == '\'' && node->tokenString.length() != 3 ) {
		return ;
	}

	// get Ture value. If fail do not obfusc.
	double trueValue;
	if ( !getConstantValue(node->tokenString,&trueValue) ) {
		return ;
	}

	// do Obfuscate To Node.
	beforeObfuscate = node->tokenString;
	afterObfuscated = NumberExpGenerator::get().Generate(trueValue); 

	// set value to the node.
	node->obfuscatedTokenString = afterObfuscated;
	node->isObfuscated = true;
	
	// will save the changes.
	recordTable->AddRecord(beforeObfuscate,afterObfuscated,
		node->first_line,node->first_column,
		node->last_line,node->last_column);
}
Esempio n. 2
0
jobject CAstWrapper::makeFieldEntity(jobject declaringClass, jobject name, bool isStatic, list<jobject> *modifiers) {

  jobject entity = env->NewObject(NativeFieldEntity, fieldEntityInit, getConstantValue(name), makeSet(modifiers), isStatic, declaringClass);

  THROW_ANY_EXCEPTION(java_ex);
  return entity;
}
Esempio n. 3
0
var DspInstance::getInfo() const
{
	if (object != nullptr)
	{
		String info;

		info << "Name: " + moduleName << "\n";

		info << "Parameters: " << String(object->getNumParameters()) << "\n";

		for (int i = 0; i < object->getNumParameters(); i++)
		{
			const String line = String("Parameter #" + String(i) + String(": current value: ") + String(object->getParameter(i)) + String("\n"));

			info << line;
		}

		info << "\n";

		info << "Constants: " << String(object->getNumConstants()) << "\n";

		for (int i = 0; i < object->getNumConstants(); i++)
		{
			info << "Constant #" << String(i) << ": " << getConstantName(i).toString() << +" = " << getConstantValue(i).toString() << "\n";
		}

		return var(info);
	}

	return var("No module loaded");
}
Esempio n. 4
0
int DspInstance::getCachedIndex(const var &constantName) const
{
	return getConstantValue((int)constantName);
}