⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faction.cpp

📁 flash文件的解码程序
💻 CPP
📖 第 1 页 / 共 2 页
字号:
	UWORD len = tmp.pcount();
	out.write(outputBuffer, len);		
	out << (char)0;
	return out;
}
std::istream &operator>> (std::istream &in,  FlashTagDoAction &data)
{
	FlashActionVectorImporter i;
	i.Import(in,data.records, data.records_delete);
	return in;
}
#define IMPORT_ACTION_IF(n,x)					\
		if(i == x)								\
		{										\
			FlashActionRecord *p = new n();     \
			v.push_back(p);				        \
			d.push_back(p);                     \
			(*v[count]).Read(in);				\
		}
#define IMPORT_ACTION_ELSE_IF(n,x)				\
		else IMPORT_ACTION_IF(n,x)

void FlashActionVectorImporter::Import(std::istream &in, std::vector<FlashActionRecord *> &v, gc_vector<FlashActionRecord*> &d)
{
	int i;
	int count = 0;

	for(i = in.get(); i != 0; i=in.get())
	{
		in.putback(i);
		IMPORT_ACTION_IF(FlashActionNextFrame,0x04)
		IMPORT_ACTION_ELSE_IF(FlashActionPreviousFrame,0x05)
		IMPORT_ACTION_ELSE_IF(FlashActionPlay,0x06)
		IMPORT_ACTION_ELSE_IF(FlashActionStop,0x07)
		IMPORT_ACTION_ELSE_IF(FlashActionToggleQuality,0x08)
		IMPORT_ACTION_ELSE_IF(FlashActionStopSounds,0x09)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoFrame,0x81)
		IMPORT_ACTION_ELSE_IF(FlashActionSetTarget,0x8B)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoLabel,0x8C)

		IMPORT_ACTION_ELSE_IF(FlashActionGetURL, 0x83)
		IMPORT_ACTION_ELSE_IF(FlashActionWaitForFrame, 0x8A)
				
		IMPORT_ACTION_ELSE_IF(FlashActionAdd,0x0A)
		IMPORT_ACTION_ELSE_IF(FlashActionSubtract,0x0B)
		IMPORT_ACTION_ELSE_IF(FlashActionMultiply,0x0C)
		IMPORT_ACTION_ELSE_IF(FlashActionDivide,0x0D)
		IMPORT_ACTION_ELSE_IF(FlashActionEquals,0x0E)
		IMPORT_ACTION_ELSE_IF(FlashActionLess,0x0F)
		IMPORT_ACTION_ELSE_IF(FlashActionAnd,0x10)
		IMPORT_ACTION_ELSE_IF(FlashActionOr,0x11)
		IMPORT_ACTION_ELSE_IF(FlashActionNot,0x12)
		IMPORT_ACTION_ELSE_IF(FlashActionStringEquals,0x13)
		IMPORT_ACTION_ELSE_IF(FlashActionStringLength,0x14)
		IMPORT_ACTION_ELSE_IF(FlashActionStringExtract,0x15)
		IMPORT_ACTION_ELSE_IF(FlashActionPop,0x17)
		IMPORT_ACTION_ELSE_IF(FlashActionToInteger,0x18)
		IMPORT_ACTION_ELSE_IF(FlashActionGetVariable,0x1C)
		IMPORT_ACTION_ELSE_IF(FlashActionSetVariable,0x1D)
		IMPORT_ACTION_ELSE_IF(FlashActionSetTarget2,0x20)
		IMPORT_ACTION_ELSE_IF(FlashActionGetProperty,0x22)
		IMPORT_ACTION_ELSE_IF(FlashActionSetProperty,0x23)
		IMPORT_ACTION_ELSE_IF(FlashActionCloneSprite,0x24)
		IMPORT_ACTION_ELSE_IF(FlashActionRemoveSprite,0x25)
		IMPORT_ACTION_ELSE_IF(FlashActionTrace,0x26)
		IMPORT_ACTION_ELSE_IF(FlashActionStartDrag,0x27)
		IMPORT_ACTION_ELSE_IF(FlashActionEndDrag,0x28)
		IMPORT_ACTION_ELSE_IF(FlashActionStringAdd,0x21)
		IMPORT_ACTION_ELSE_IF(FlashActionStringLess,0x29)
		IMPORT_ACTION_ELSE_IF(FlashActionRandomNumber,0x30)
		IMPORT_ACTION_ELSE_IF(FlashActionMBStringLength,0x31)
		IMPORT_ACTION_ELSE_IF(FlashActionCharToAscii,0x32)
		IMPORT_ACTION_ELSE_IF(FlashActionAsciiToChar,0x33)
		IMPORT_ACTION_ELSE_IF(FlashActionGetTime,0x34)
		IMPORT_ACTION_ELSE_IF(FlashActionMBCharToAscii,0x36)
		IMPORT_ACTION_ELSE_IF(FlashActionMBStringExtract,0x35)
		IMPORT_ACTION_ELSE_IF(FlashActionMBAsciToChar,0x37)
		IMPORT_ACTION_ELSE_IF(FlashActionWaitForFrame2,0x8D)
		IMPORT_ACTION_ELSE_IF(FlashActionJump,0x99)
		IMPORT_ACTION_ELSE_IF(FlashActionGetURL2,0x9A)
		IMPORT_ACTION_ELSE_IF(FlashActionIf,0x9D)
		IMPORT_ACTION_ELSE_IF(FlashActionCall,0x9E)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoFrame2,0x9F)

		IMPORT_ACTION_ELSE_IF(FlashActionPush, 0x96) // handle alternate instances??
		
		IMPORT_ACTION_ELSE_IF(FlashActionDelete,0x3a)
		IMPORT_ACTION_ELSE_IF(FlashActionDelete2,0x3b)
		IMPORT_ACTION_ELSE_IF(FlashActionDefineLocal,0x3c)
		IMPORT_ACTION_ELSE_IF(FlashActionCallFunction,0x3d)
		IMPORT_ACTION_ELSE_IF(FlashActionReturn,0x3e)
		IMPORT_ACTION_ELSE_IF(FlashActionModulo,0x3f)
		IMPORT_ACTION_ELSE_IF(FlashActionNewObject,0x40)
		IMPORT_ACTION_ELSE_IF(FlashActionDefineLocal2,0x41)
		IMPORT_ACTION_ELSE_IF(FlashActionInitArray,0x42)
		IMPORT_ACTION_ELSE_IF(FlashActionInitObject,0x4)
		IMPORT_ACTION_ELSE_IF(FlashActionTypeOf,0x44)
		IMPORT_ACTION_ELSE_IF(FlashActionTargetPath,0x45)
		IMPORT_ACTION_ELSE_IF(FlashActionEnumerate,0x46)
		IMPORT_ACTION_ELSE_IF(FlashActionAdd2,0x47)
		IMPORT_ACTION_ELSE_IF(FlashActionLess2,0x48)
		IMPORT_ACTION_ELSE_IF(FlashActionEquals2,0x49)
		IMPORT_ACTION_ELSE_IF(FlashActionToNumber,0x4a)
		IMPORT_ACTION_ELSE_IF(FlashActionToString,0x4b)
		IMPORT_ACTION_ELSE_IF(FlashActionPushDuplicate,0x4c)
		IMPORT_ACTION_ELSE_IF(FlashActionStackSwap,0x4d)
		IMPORT_ACTION_ELSE_IF(FlashActionGetMember,0x4e)
		IMPORT_ACTION_ELSE_IF(FlashActionSetMember,0x4f)
		IMPORT_ACTION_ELSE_IF(FlashActionIncrement,0x50)
		IMPORT_ACTION_ELSE_IF(FlashActionDecrement,0x51)
		IMPORT_ACTION_ELSE_IF(FlashActionCallMethod,0x52)
		IMPORT_ACTION_ELSE_IF(FlashActionNewMethod,0x53)
		IMPORT_ACTION_ELSE_IF(FlashActionBitAnd,0x60)
		IMPORT_ACTION_ELSE_IF(FlashActionBitOr,0x61)
		IMPORT_ACTION_ELSE_IF(FlashActionBitXor,0x62)
		IMPORT_ACTION_ELSE_IF(FlashActionBitLShift,0x63)
		IMPORT_ACTION_ELSE_IF(FlashActionBitRShift,0x64)
		IMPORT_ACTION_ELSE_IF(FlashActionBitURShift,0x65)
		IMPORT_ACTION_ELSE_IF(FlashActionStoreRegister,0x87)

		IMPORT_ACTION_ELSE_IF(FlashActionDefineFunction, 0x9B)
		IMPORT_ACTION_ELSE_IF(FlashActionConstantPool, 0x88)
		IMPORT_ACTION_ELSE_IF(FlashActionWith, 0x94)
		else
		{
			FlashActionRecord *p = new FlashActionRecord();
			v.push_back(p);
			d.push_back(p);
			(*v[count]).Read(in);
		}
		count ++;
	}
	count = 0;
}

void FlashActionVectorImporter::Import(std::istream &in, std::vector<FlashActionRecord *> &v, gc_vector<FlashActionRecord*> &d, UDWORD num_actions)
{
	int i;
	int count = 0;

	for(UDWORD num = 0; num < num_actions; num++)
	{
		i = in.get();
		in.putback(i);
		IMPORT_ACTION_IF(FlashActionNextFrame,0x04)
		IMPORT_ACTION_ELSE_IF(FlashActionPreviousFrame,0x05)
		IMPORT_ACTION_ELSE_IF(FlashActionPlay,0x06)
		IMPORT_ACTION_ELSE_IF(FlashActionStop,0x07)
		IMPORT_ACTION_ELSE_IF(FlashActionToggleQuality,0x08)
		IMPORT_ACTION_ELSE_IF(FlashActionStopSounds,0x09)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoFrame,0x81)
		IMPORT_ACTION_ELSE_IF(FlashActionSetTarget,0x8B)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoLabel,0x8C)

		IMPORT_ACTION_ELSE_IF(FlashActionGetURL, 0x83)
		IMPORT_ACTION_ELSE_IF(FlashActionWaitForFrame, 0x8A)
				
		IMPORT_ACTION_ELSE_IF(FlashActionAdd,0x0A)
		IMPORT_ACTION_ELSE_IF(FlashActionSubtract,0x0B)
		IMPORT_ACTION_ELSE_IF(FlashActionMultiply,0x0C)
		IMPORT_ACTION_ELSE_IF(FlashActionDivide,0x0D)
		IMPORT_ACTION_ELSE_IF(FlashActionEquals,0x0E)
		IMPORT_ACTION_ELSE_IF(FlashActionLess,0x0F)
		IMPORT_ACTION_ELSE_IF(FlashActionAnd,0x10)
		IMPORT_ACTION_ELSE_IF(FlashActionOr,0x11)
		IMPORT_ACTION_ELSE_IF(FlashActionNot,0x12)
		IMPORT_ACTION_ELSE_IF(FlashActionStringEquals,0x13)
		IMPORT_ACTION_ELSE_IF(FlashActionStringLength,0x14)
		IMPORT_ACTION_ELSE_IF(FlashActionStringExtract,0x15)
		IMPORT_ACTION_ELSE_IF(FlashActionPop,0x17)
		IMPORT_ACTION_ELSE_IF(FlashActionToInteger,0x18)
		IMPORT_ACTION_ELSE_IF(FlashActionGetVariable,0x1C)
		IMPORT_ACTION_ELSE_IF(FlashActionSetVariable,0x1D)
		IMPORT_ACTION_ELSE_IF(FlashActionSetTarget2,0x20)
		IMPORT_ACTION_ELSE_IF(FlashActionGetProperty,0x22)
		IMPORT_ACTION_ELSE_IF(FlashActionSetProperty,0x23)
		IMPORT_ACTION_ELSE_IF(FlashActionCloneSprite,0x24)
		IMPORT_ACTION_ELSE_IF(FlashActionRemoveSprite,0x25)
		IMPORT_ACTION_ELSE_IF(FlashActionTrace,0x26)
		IMPORT_ACTION_ELSE_IF(FlashActionStartDrag,0x27)
		IMPORT_ACTION_ELSE_IF(FlashActionEndDrag,0x28)
		IMPORT_ACTION_ELSE_IF(FlashActionStringAdd,0x21)
		IMPORT_ACTION_ELSE_IF(FlashActionStringLess,0x29)
		IMPORT_ACTION_ELSE_IF(FlashActionRandomNumber,0x30)
		IMPORT_ACTION_ELSE_IF(FlashActionMBStringLength,0x31)
		IMPORT_ACTION_ELSE_IF(FlashActionCharToAscii,0x32)
		IMPORT_ACTION_ELSE_IF(FlashActionAsciiToChar,0x33)
		IMPORT_ACTION_ELSE_IF(FlashActionGetTime,0x34)
		IMPORT_ACTION_ELSE_IF(FlashActionMBCharToAscii,0x36)
		IMPORT_ACTION_ELSE_IF(FlashActionMBStringExtract,0x35)
		IMPORT_ACTION_ELSE_IF(FlashActionMBAsciToChar,0x37)
		IMPORT_ACTION_ELSE_IF(FlashActionWaitForFrame2,0x8D)
		IMPORT_ACTION_ELSE_IF(FlashActionJump,0x99)
		IMPORT_ACTION_ELSE_IF(FlashActionGetURL2,0x9A)
		IMPORT_ACTION_ELSE_IF(FlashActionIf,0x9D)
		IMPORT_ACTION_ELSE_IF(FlashActionCall,0x9E)
		IMPORT_ACTION_ELSE_IF(FlashActionGotoFrame2,0x9F)

		IMPORT_ACTION_ELSE_IF(FlashActionPush, 0x96) // Not Exactly....handle alternate instances
		
		IMPORT_ACTION_ELSE_IF(FlashActionDelete,0x3a)
		IMPORT_ACTION_ELSE_IF(FlashActionDelete2,0x3b)
		IMPORT_ACTION_ELSE_IF(FlashActionDefineLocal,0x3c)
		IMPORT_ACTION_ELSE_IF(FlashActionCallFunction,0x3d)
		IMPORT_ACTION_ELSE_IF(FlashActionReturn,0x3e)
		IMPORT_ACTION_ELSE_IF(FlashActionModulo,0x3f)
		IMPORT_ACTION_ELSE_IF(FlashActionNewObject,0x40)
		IMPORT_ACTION_ELSE_IF(FlashActionDefineLocal2,0x41)
		IMPORT_ACTION_ELSE_IF(FlashActionInitArray,0x42)
		IMPORT_ACTION_ELSE_IF(FlashActionInitObject,0x4)
		IMPORT_ACTION_ELSE_IF(FlashActionTypeOf,0x44)
		IMPORT_ACTION_ELSE_IF(FlashActionTargetPath,0x45)
		IMPORT_ACTION_ELSE_IF(FlashActionEnumerate,0x46)
		IMPORT_ACTION_ELSE_IF(FlashActionAdd2,0x47)
		IMPORT_ACTION_ELSE_IF(FlashActionLess2,0x48)
		IMPORT_ACTION_ELSE_IF(FlashActionEquals2,0x49)
		IMPORT_ACTION_ELSE_IF(FlashActionToNumber,0x4a)
		IMPORT_ACTION_ELSE_IF(FlashActionToString,0x4b)
		IMPORT_ACTION_ELSE_IF(FlashActionPushDuplicate,0x4c)
		IMPORT_ACTION_ELSE_IF(FlashActionStackSwap,0x4d)
		IMPORT_ACTION_ELSE_IF(FlashActionGetMember,0x4e)
		IMPORT_ACTION_ELSE_IF(FlashActionSetMember,0x4f)
		IMPORT_ACTION_ELSE_IF(FlashActionIncrement,0x50)
		IMPORT_ACTION_ELSE_IF(FlashActionDecrement,0x51)
		IMPORT_ACTION_ELSE_IF(FlashActionCallMethod,0x52)
		IMPORT_ACTION_ELSE_IF(FlashActionNewMethod,0x53)
		IMPORT_ACTION_ELSE_IF(FlashActionBitAnd,0x60)
		IMPORT_ACTION_ELSE_IF(FlashActionBitOr,0x61)
		IMPORT_ACTION_ELSE_IF(FlashActionBitXor,0x62)
		IMPORT_ACTION_ELSE_IF(FlashActionBitLShift,0x63)
		IMPORT_ACTION_ELSE_IF(FlashActionBitRShift,0x64)
		IMPORT_ACTION_ELSE_IF(FlashActionBitURShift,0x65)
		IMPORT_ACTION_ELSE_IF(FlashActionStoreRegister,0x87)

		IMPORT_ACTION_ELSE_IF(FlashActionDefineFunction, 0x9B)
		IMPORT_ACTION_ELSE_IF(FlashActionConstantPool, 0x88)
		IMPORT_ACTION_ELSE_IF(FlashActionWith, 0x94)
		else
		{
			FlashActionRecord *p = new FlashActionRecord();
			v.push_back(p);
			d.push_back(p);
			(*v[count]).Read(in);
		}
		count ++;
	}
	count = 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -