Documentation
¶
Index ¶
- Constants
- Variables
- func Add2Trak(init *mp4.InitSegment, frag *mp4.Fragment, index int, data [][]byte) error
- func Convert2JPG(data []byte) ([]byte, error)
- func ConvertAnime2GIF(animeFrames [][]byte, maskFrames [][]byte) ([]byte, error)
- func Dat2Image(data []byte) ([]byte, string, error)
- func Dat2ImageV4(data []byte, aeskey []byte) ([]byte, string, error)
- func ScanAndSetXorKey(dirPath string) (byte, error)
- func SetAesKey(key string)
- func Transmux2MP4(data []byte) ([]byte, error)
- func TransmuxAnime2MP4(animeFrames [][]byte, maskFrames [][]byte) ([]byte, error)
- func Wxam2pic(data []byte) ([]byte, string, error)
- type AesKeyValidator
- type Format
- type Partition
- type Partitions
Constants ¶
View Source
const ( ENV_FFMPEG_PATH = "FFMPEG_PATH" MinRatio = 0.6 FixSliceHeaders = true )
Variables ¶
View Source
var ( // Common image format definitions JPG = Format{Header: []byte{0xFF, 0xD8, 0xFF}, Ext: "jpg"} PNG = Format{Header: []byte{0x89, 0x50, 0x4E, 0x47}, Ext: "png"} GIF = Format{Header: []byte{0x47, 0x49, 0x46, 0x38}, Ext: "gif"} TIFF = Format{Header: []byte{0x49, 0x49, 0x2A, 0x00}, Ext: "tiff"} BMP = Format{Header: []byte{0x42, 0x4D}, Ext: "bmp"} WXGF = Format{Header: []byte{0x77, 0x78, 0x67, 0x66}, Ext: "wxgf"} Formats = []Format{JPG, PNG, GIF, TIFF, BMP, WXGF} V4Format1 = Format{Header: []byte{0x07, 0x08, 0x56, 0x31}, AesKey: []byte("cfcd208495d565ef")} V4Format2 = Format{Header: []byte{0x07, 0x08, 0x56, 0x32}, AesKey: []byte("0000000000000000")} // FIXME V4Formats = []*Format{&V4Format1, &V4Format2} // WeChat v4 related constants V4XorKey byte = 0x37 // Default XOR key for WeChat v4 dat files JpgTail = []byte{0xFF, 0xD9} // JPG file tail marker )
View Source
var ( FFmpegMode = false FFMpegPath = "ffmpeg" )
Functions ¶
func Convert2JPG ¶
func ConvertAnime2GIF ¶
ConvertAnime2GIF convert anime frames and mask frames to mp4 FIXME No longer need to write to temporary files
func Dat2Image ¶
Dat2Image converts WeChat dat file data to image data Returns the decoded image data, file extension, and any error encountered
func Dat2ImageV4 ¶
Dat2ImageV4 processes WeChat v4 dat image files WeChat v4 uses a combination of AES-ECB and XOR encryption
func ScanAndSetXorKey ¶
ScanAndSetXorKey scans a directory for "_t.dat" files to calculate and set the global XOR key for WeChat v4 dat files Returns the found key and any error encountered
func Transmux2MP4 ¶
func TransmuxAnime2MP4 ¶
Types ¶
type AesKeyValidator ¶
func NewImgKeyValidator ¶
func NewImgKeyValidator(path string) *AesKeyValidator
func (*AesKeyValidator) Validate ¶
func (v *AesKeyValidator) Validate(key []byte) bool
type Partitions ¶
func (*Partitions) LikeAnime ¶
func (p *Partitions) LikeAnime() bool
Click to show internal directories.
Click to hide internal directories.