GithubHelp home page GithubHelp logo

fix-3gp's People

Contributors

golimarrrr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

4dvn

fix-3gp's Issues

Please provide some documentation

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.

FreeBSD 13: Build error: error: undefined symbol: __bswap_32

$ 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)

Need help

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.