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

📄 actioncompiler.cpp

📁 flash文件的解码程序
💻 CPP
字号:
#include <iostream>
#include <sstream>

#include "../fbase.h"
#include "../faction.h"
#include "action.h"

#include "actioncompiler.h"

CompiledActions::CompiledActions(char *data, int len)
{
	this->data = (char*)malloc(len);
	memcpy(this->data, data, len);
	this->len = len;
}

void CompiledActions::Write(std::ostream &out)
{
	out.write(data,len);
}
void CompiledActions::Read(std::istream &in)
{	
}


ActionCompiler::ActionCompiler(int version)
{
	this->version = version;		
}	

void ActionCompiler::Compile(char *script, std::ostream &outputStream)
{
	Buffer outputBuffer;

	int success = 0;

	if(version == 4)
	{
		swf4ParseInit(script,0);
		success = swf4parse(&outputBuffer);
	}
	else if(version == 5)
	{	
		swf5ParseInit(script,0);
		success = swf5parse(&outputBuffer);
	}
	else
	{
		//throw Exception("Unsupported flash version");
	}

	if(success != 0)
	{
		//throw Exception("Output buffer is empty");
		return;
	}

	outputStream.write(outputBuffer->buffer, bufferLength(outputBuffer));	        
	destroyBuffer(outputBuffer);
}

⌨️ 快捷键说明

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