golimarrrr / fix-3gp Goto Github PK
View Code? Open in Web Editor NEWTries to fix a 3GP file using another file with the same format
License: GNU General Public License v3.0
Tries to fix a 3GP file using another file with the same format
License: GNU General Public License v3.0
Hi,
I tried to use you program to fix 3gpp file but i failed. Nevertheless, incidentally the orderring of files is different from untrunc
and the output does not say where is the output written.
$ ./fix-3gp broken.3gp good.3gp
Opening BROKEN file: broken.3gp
File size: 16261120
mdat found at: 40 (0x28)
mdat section size declared by 3gp file: 0 (0x0), integer value size: 4
mdat section real size: 16261080 (0xf81fd8)
Opening OK file: good.3gp
File size: 52775991
mdat found at: 40 (0x28)
mdat section size declared by 3gp file: 52251244 (0x31d4a6c), integer value size: 4
Writing result file
Finished, freeing up resources
$
vlc result.3gp
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb08cc7a400] moov atom not found
[00007fb030001180] mp4 demux error: MP4 plugin discarded (no moov,foov,moof box)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb030c03380] moov atom not found
[00007fb030001180] avformat demux error: Could not open result.3gp: Unknown error 1094995529
$
Obviously, the line Writing result file
should include a full path to the file written out. Sadly, it did not help with my file anyway.
$ clang fix-3gp.c -o fix-3gp
fix-3gp.c:46:30: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
printf("File size: %d\n" , lSizeBroken);
~~ ^~~~~~~~~~~
%ld
fix-3gp.c:50:64: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
fprintf(stderr, "Max file size to load into memory: %d\n", maxFileSize);
~~ ^~~~~~~~~~~
%zu
fix-3gp.c:69:40: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
printf("mdat found at: %d (0x%x)\n", mdatPosBroken-bufferFileBroken, mdatPosBroken-bufferFileBroken);
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%ld
fix-3gp.c:69:72: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat]
printf("mdat found at: %d (0x%x)\n", mdatPosBroken-bufferFileBroken, mdatPosBroken-bufferFileBroken);
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%lx
fix-3gp.c:72:127: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
printf("mdat section size declared by 3gp file: %d (0x%x), integer value size: %d\n", *pMdatSectionSize, *pMdatSectionSize, sizeof(*pMdatSectionSize));
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%lu
fix-3gp.c:79:49: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
printf("mdat section real size: %d (0x%x)\n", newMdatSectionSize, newMdatSectionSize);
~~ ^~~~~~~~~~~~~~~~~~
%ld
fix-3gp.c:79:69: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat]
printf("mdat section real size: %d (0x%x)\n", newMdatSectionSize, newMdatSectionSize);
~~ ^~~~~~~~~~~~~~~~~~
%lx
fix-3gp.c:97:30: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
printf("File size: %d\n" , lSizeOk);
~~ ^~~~~~~
%ld
fix-3gp.c:101:64: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
fprintf(stderr, "Max file size to load into memory: %d\n", maxFileSize);
~~ ^~~~~~~~~~~
%zu
fix-3gp.c:120:40: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
printf("mdat found at: %d (0x%x)\n", mdatPosOk-bufferFileOk, mdatPosOk-bufferFileOk);
~~ ^~~~~~~~~~~~~~~~~~~~~~
%ld
fix-3gp.c:120:64: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat]
printf("mdat found at: %d (0x%x)\n", mdatPosOk-bufferFileOk, mdatPosOk-bufferFileOk);
~~ ^~~~~~~~~~~~~~~~~~~~~~
%lx
fix-3gp.c:123:21: warning: implicit declaration of function '__bswap_32' is invalid in C99 [-Wimplicit-function-declaration]
mdatSectionSize = __bswap_32(*pMdatSectionSize); // big endian to little endian
^
fix-3gp.c:124:123: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
printf("mdat section size declared by 3gp file: %d (0x%x), integer value size: %d\n", mdatSectionSize, mdatSectionSize, sizeof(mdatSectionSize));
~~ ^~~~~~~~~~~~~~~~~~~~~~~
%lu
fix-3gp.c:126:95: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
fprintf(stderr, "Invalid declared section size, corrupted file %d %d\n", mdatSectionSize, lSizeOk);
~~ ^~~~~~~
%ld
14 warnings generated.
ld: error: undefined symbol: __bswap_32
>>> referenced by fix-3gp.c
>>> /tmp/fix-3gp-32678d.o:(main)
>>> referenced by fix-3gp.c
>>> /tmp/fix-3gp-32678d.o:(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can i compile it on windows, my mov, mp4, wav files was encrypted by ransomware 150kb of header and 334 bytes added from the end of files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.