AMF_Creator

This commit is contained in:
Erik Zandvliet 2011-03-13 15:48:38 +01:00
parent 1a6a9eeb9b
commit 566849ff72
4 changed files with 44 additions and 0 deletions

19
AMF_Creator/Makefile Normal file
View file

@ -0,0 +1,19 @@
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
OUT = AMFtest
INCLUDES =
CCFLAGS = -Wall -Wextra -funsigned-char -g
CC = $(CROSS)g++
LD = $(CROSS)ld
AR = $(CROSS)ar
LIBS = -lssl -lcrypto
.SUFFIXES: .cpp
.PHONY: clean default
default: $(OUT)
.cpp.o:
$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(OUT): $(OBJ) amf.cpp
$(CC) $(LIBS) -o $(OUT) $(OBJ)
clean:
rm -rf $(OBJ) $(OUT) Makefile.bak *~

1
AMF_Creator/amf.cpp Symbolic link
View file

@ -0,0 +1 @@
/home/immortal/werk/pls/util/amf.cpp

24
AMF_Creator/main.cpp Normal file
View file

@ -0,0 +1,24 @@
#define DEBUG 10 //maximum debugging level evah
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include "amf.cpp"
int main( int argc, char * argv[] ) {
if( argc != 2 ) { return 1; }
std::string temp;
std::ifstream ifs( argv[1] );
while( ifs.good() ) {
temp += ifs.get();
}
static AMFType amfdata("empty", (unsigned char)0xFF);
amfdata = parseAMF( (const unsigned char*)temp.c_str(), temp.length()-1 );
amfdata.Print( );
temp = amfdata.Pack( );
std::ofstream ofs( "output.bin" );
for( unsigned int i = 0; i < temp.size( ); i++ ) {
ofs << temp[i];
}
return 0;
}

BIN
AMF_Creator/output.bin Normal file

Binary file not shown.