📄 spliter.c.svn-base
字号:
if (dq) { while (dq->NextP) dq=dq->NextP; dq->NextP=(struct PAndRObjects *)p; } else { MCp->MovieClipP->Frames[MCp->frame].TagsListP=(struct PAndRObjects *)p; } return 0;}void reader_AddActionRecord(struct ActionRecord** add_to_p,struct ActionRecord* ar_p) { struct ActionRecord* p = NULL; p = *add_to_p; if (p) { while (p->NextP) { p = p->NextP; }; p->NextP=ar_p; } else { *add_to_p = ar_p; };};int reader_GetActionRecord(struct reader_t *reader,int len,struct ActionRecord **ActionRecordP) { struct ActionRecord *p,*dq;//,*decomp; //UI8 count=0; //UI16 ecount=0; UI32 length; //long i; length=len; p=(struct ActionRecord *)malloc(sizeof(struct ActionRecord)+length-1); bzero((void *)p,sizeof(struct ActionRecord)+length-1); p->Length=length; if (reader->read(reader, (p->Code), length) != length) return gg_error(); //decomp_action(p,&decomp); //free(p); if(*ActionRecordP) { dq=*ActionRecordP; while(dq->NextP) dq=dq->NextP; dq->NextP=p; } else { *ActionRecordP=p; } return 0; /* if(len==0){ while(1){ if (reader->read(reader, &count, 1) != 1) return 0; length=count; if (!count) return 0; if (count>=0x80){ if (reader->read(reader, &ecount, 2) != 2) return 0; length=ecount; } p=(struct ActionRecord *)malloc(sizeof(struct ActionRecord)+length-1); bzero((void *)p,sizeof(struct ActionRecord)+length-1); p->Length=length; if (reader->read(reader, (p->Code), length) != length) return 0; if(*ActionRecordP){ dq=*ActionRecordP; while(dq->NextP) dq=dq->NextP; dq->NextP=p; }else{ *ActionRecordP=p; } } }else{ i=len; while(i){ if (reader->read(reader, &count, 1) != 1) return 0; i-=1; length=count; if (!count) break; if (count>=0x80){ if (reader->read(reader, &ecount, 2) != 2) return 0; i-=2; length=ecount; } p=(struct ActionRecord *)malloc(sizeof(struct ActionRecord)+length-1); bzero((void *)p,sizeof(struct ActionRecord)+length-1); p->Length=length; if (reader->read(reader, (p->Code), length) != length) return 0; i-=length; if(*ActionRecordP){ dq=*ActionRecordP; while(dq->NextP) dq=dq->NextP; dq->NextP=p; }else{ *ActionRecordP=p; } if (i<0){ printf("read Action Record error!\n"); exit(0); } } } */}int g_GetPlaceObject2(struct reader_t *reader,swf_file_t *swf_p,int len) { struct PlaceObject *p; struct PAndRObjects *dq; char ptr[4]; char *strp; UI16 Num; UI16 Flags16; //UI8 KeyCode; struct ActionRecord *ActionRecordP; UI32 ActionRecordSize; struct MovieClips *MCp; MCp=reader->MovieClipsPointer; while (MCp->NextP) { MCp=MCp->NextP; } p=(struct PlaceObject *)malloc(sizeof(struct PlaceObject)); bzero((void *)p,sizeof(struct PlaceObject)); p->PlaceAndRemoveType=TPlaceObjectTwo; if (reader->read(reader, &(p->Flags), 1) != 1) return gg_error(); if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->Depth=SWAP16(Num); if ((p->Flags&PlaceFlagHasCharacter)==PlaceFlagHasCharacter) { if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->CharacterID=SWAP16(Num); } if ((p->Flags&PlaceFlagHasMatrix)==PlaceFlagHasMatrix) { reader_GetMatrix(reader,&(p->Matrix)); } if ((p->Flags&PlaceFlagHasColorTransform)==PlaceFlagHasColorTransform) { reader_GetCxFromWithAlpha(reader,&(p->ColorTransform)); } if ((p->Flags&PlaceFlagHasRatio)==PlaceFlagHasRatio) { if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->Ratio=SWAP16(Num); } if ((p->Flags&PlaceFlagHasName)==PlaceFlagHasName) { reader_GetString(reader,&strp); p->NameP=strp;#if DEBUG printf("namep:%s\n",tmpmcp->NameP);#endif } if ((p->Flags&PlaceFlagHasClipDepth)==PlaceFlagHasClipDepth) { if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->ClipDepth=SWAP16(Num); } if ((p->Flags&PlaceFlagHasClipActions)==PlaceFlagHasClipActions) { struct ActionBlock *actions_p = g_new0(struct ActionBlock,1); p->ActionBlockP = actions_p; if (swf_p->version<=5) { if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); while(1) { if (reader->read(reader, &Flags16, 2) !=2 ) return gg_error(); // Flags16=SWAP16(Flags16); printf("v5 flags %d\n",Flags16); if (!Flags16) break; if (reader->read(reader, &ptr, 4) !=4 ) return gg_error(); ActionRecordSize=GET32(ptr); if(ActionRecordSize) { ActionRecordP=NULL; reader_GetActionRecord(reader,ActionRecordSize,&ActionRecordP); if ((Flags16&(TClipEventKeyupP))==(TClipEventKeyupP)) { reader_AddActionRecord(&actions_p->ClipEventKeyupP,ActionRecordP); } if ((Flags16&(TClipEventKeyDownP))==(TClipEventKeyDownP)) { reader_AddActionRecord(&actions_p->ClipEventKeyDownP,ActionRecordP); } if ((Flags16&(TClipEventMouseUpP))==(TClipEventMouseUpP)) { reader_AddActionRecord(&actions_p->ClipEventMouseUpP,ActionRecordP); } if ((Flags16&(TClipEventMouseDownP))==(TClipEventMouseDownP)) { reader_AddActionRecord(&actions_p->ClipEventMouseDownP,ActionRecordP); } if ((Flags16&(TClipEventMouseMoveP))==(TClipEventMouseMoveP)) { reader_AddActionRecord(&actions_p->ClipEventMouseMoveP,ActionRecordP); } if ((Flags16&(TClipEventUnloadP))==(TClipEventUnloadP)) { reader_AddActionRecord(&actions_p->ClipEventUnloadP,ActionRecordP); } if ((Flags16&(TClipEventEnterFrameP))==(TClipEventEnterFrameP)) { reader_AddActionRecord(&actions_p->ClipEventEnterFrameP,ActionRecordP); } if ((Flags16&(TClipEventLoadP))==(TClipEventLoadP)) { reader_AddActionRecord(&actions_p->ClipEventLoadP,ActionRecordP); } if ((Flags16&(TClipEventDragOverP))==(TClipEventDragOverP)) { reader_AddActionRecord(&actions_p->ClipEventDragOverP,ActionRecordP); } if ((Flags16&(TClipEventRollOutP))==(TClipEventRollOutP)) { reader_AddActionRecord(&actions_p->ClipEventRollOutP,ActionRecordP); } if ((Flags16&(TClipEventRollOverP))==(TClipEventRollOverP)) { reader_AddActionRecord(&actions_p->ClipEventRollOverP,ActionRecordP); } if ((Flags16&(TClipEventReleaseOutsideP))==(TClipEventReleaseOutsideP)) { reader_AddActionRecord(&actions_p->ClipEventReleaseOutsideP,ActionRecordP); } if ((Flags16&(TClipEventReleaseP))==(TClipEventReleaseP)) { reader_AddActionRecord(&actions_p->ClipEventReleaseP,ActionRecordP); } if ((Flags16&(TClipEventPressP))==(TClipEventPressP)) { reader_AddActionRecord(&actions_p->ClipEventPressP,ActionRecordP); } if ((Flags16&(TClipEventInitializeP))==(TClipEventInitializeP)) { reader_AddActionRecord(&actions_p->ClipEventInitializeP,ActionRecordP); } if ((Flags16&(TClipEventDataP))==(TClipEventDataP)) { reader_AddActionRecord(&actions_p->ClipEventDataP,ActionRecordP); } } } } else { //for v6 and newer if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); while(1) { UI16 Flagsv6; UI8 keycode; if (reader->read(reader, &Flags16, 2) !=2 ) return gg_error(); Flags16=SWAP16(Flags16); if (reader->read(reader, &Flagsv6, 2) !=2 ) return gg_error(); Flagsv6=SWAP16(Flagsv6); if (!(Flags16|Flagsv6)) break; printf("v6 flags %d\n",Flags16); if ((Flagsv6&(TClipEventKeyPressP))==(TClipEventKeyPressP)) { if (reader->read(reader, &keycode, 1) !=1 ) return gg_error(); } if (reader->read(reader, &ptr, 4) !=4 ) return gg_error(); ActionRecordSize=GET32(ptr); if(ActionRecordSize) { ActionRecordP=NULL; reader_GetActionRecord(reader,ActionRecordSize,&ActionRecordP); if ((Flags16&(TClipEventKeyupP))==(TClipEventKeyupP)) { reader_AddActionRecord(&actions_p->ClipEventKeyupP,ActionRecordP); } if ((Flags16&(TClipEventKeyDownP))==(TClipEventKeyDownP)) { reader_AddActionRecord(&actions_p->ClipEventKeyDownP,ActionRecordP); } if ((Flags16&(TClipEventMouseUpP))==(TClipEventMouseUpP)) { reader_AddActionRecord(&actions_p->ClipEventMouseUpP,ActionRecordP); } if ((Flags16&(TClipEventMouseDownP))==(TClipEventMouseDownP)) { reader_AddActionRecord(&actions_p->ClipEventMouseDownP,ActionRecordP); } if ((Flags16&(TClipEventMouseMoveP))==(TClipEventMouseMoveP)) { reader_AddActionRecord(&actions_p->ClipEventMouseMoveP,ActionRecordP); } if ((Flags16&(TClipEventUnloadP))==(TClipEventUnloadP)) { reader_AddActionRecord(&actions_p->ClipEventUnloadP,ActionRecordP); } if ((Flags16&(TClipEventEnterFrameP))==(TClipEventEnterFrameP)) { printf("ClipEventEnterFrameP in split\n"); reader_AddActionRecord(&actions_p->ClipEventEnterFrameP,ActionRecordP); } if ((Flags16&(TClipEventLoadP))==(TClipEventLoadP)) { reader_AddActionRecord(&actions_p->ClipEventLoadP,ActionRecordP); } if ((Flags16&(TClipEventDragOverP))==(TClipEventDragOverP)) { reader_AddActionRecord(&actions_p->ClipEventDragOverP,ActionRecordP); } if ((Flags16&(TClipEventRollOutP))==(TClipEventRollOutP)) { reader_AddActionRecord(&actions_p->ClipEventRollOutP,ActionRecordP); } if ((Flags16&(TClipEventRollOverP))==(TClipEventRollOverP)) { reader_AddActionRecord(&actions_p->ClipEventRollOverP,ActionRecordP); } if ((Flags16&(TClipEventReleaseOutsideP))==(TClipEventReleaseOutsideP)) { reader_AddActionRecord(&actions_p->ClipEventReleaseOutsideP,ActionRecordP); } if ((Flags16&(TClipEventReleaseP))==(TClipEventReleaseP)) { reader_AddActionRecord(&actions_p->ClipEventReleaseP,ActionRecordP); } if ((Flags16&(TClipEventPressP))==(TClipEventPressP)) { reader_AddActionRecord(&actions_p->ClipEventPressP,ActionRecordP); } if ((Flags16&(TClipEventInitializeP))==(TClipEventInitializeP)) { reader_AddActionRecord(&actions_p->ClipEventInitializeP,ActionRecordP); } if ((Flags16&(TClipEventDataP))==(TClipEventDataP)) { reader_AddActionRecord(&actions_p->ClipEventDataP,ActionRecordP); } if ((Flagsv6&(TClipEventConstructP))==(TClipEventConstructP)) { reader_AddActionRecord(&actions_p->ClipEventConstructP,ActionRecordP); } if ((Flagsv6&(TClipEventDragOutP))==(TClipEventDragOutP)) { reader_AddActionRecord(&actions_p->ClipEventDragOutP,ActionRecordP); } if ((Flagsv6&(TClipEventKeyPressP))==(TClipEventKeyPressP)) { reader_AddActionRecord(&actions_p->ClipEventKeyPressP[keycode],ActionRecordP); } } } } } dq=MCp->MovieClipP->Frames[MCp->frame].TagsListP; if (dq) { while (dq->NextP) dq=dq->NextP; dq->NextP=(struct PAndRObjects *)p; } else { MCp->MovieClipP->Frames[MCp->frame].TagsListP=(struct PAndRObjects *)p; } return 0;}int g_GetPlaceObject(struct reader_t *reader,int len) { struct PlaceObject *p; struct PAndRObjects *dq; UI16 Num; int pos; int i; struct MovieClips *MCp; pos=len; MCp=reader->MovieClipsPointer; while (MCp->NextP) { MCp=MCp->NextP; } p=(struct PlaceObject *)malloc(sizeof(struct PlaceObject)); bzero((void *)p,sizeof(struct PlaceObject)); p->PlaceAndRemoveType=TPlaceObjectOne; if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->CharacterID=SWAP16(Num); if (reader->read(reader, &Num, 2) !=2 ) return gg_error(); p->Depth=SWAP16(Num); p->Flags|=PlaceFlagHasMatrix; p->Flags|=PlaceFlagHasCharacter; pos-=4; i=reader->pos; reader_GetMatrix(reader,&(p->Matrix)); i-=reader->pos; pos+=i; if (pos>0) { p->Flags|=PlaceFlagHasColorTransform; reader_GetCxFrom(reader,&(p->ColorTransform)); } dq=MCp->MovieClipP->Frames[MCp->frame].TagsListP; if (dq) { while (dq->NextP) dq=dq->NextP; dq->NextP=(struct PAndRObjects *)p; } else { MCp->MovieClipP->Frames[MCp->frame].TagsListP=(struct PAndRObjects *)p; } return 0;}int g_GetFrameLabel(struct reader_t *reader,int len) { struct FrameLabel *p,*dq; struct MovieClips *MCp; int size,i; UI8 tmp; size=len; p=(struct FrameLabel *)malloc(sizeof(struct FrameLabel)); bzero((void *)p,sizeof(struct FrameLabel));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -