0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Joke] 最大の圧縮率を誇るtmcompの復号プログラムtmdecomp

Last updated at Posted at 2024-07-16

最大の圧縮率を誇るtmcomp用復号プログラムtmdecompです。
非可逆圧縮なので、元のファイルは戻りませんが、同じ名前のファイルを出力します。
ファイル内容はどんなファイルを復号しても0x0aです。
あれだけ非可逆圧縮と断っていたので、元のファイルが戻らなくても、怒らないで下さい。
cc tmdecomp.c -o tmdecompでコンパイルし、
./tmdecomp file.tmcで実行して下さい。

tmdecomp.c
#include    <stdio.h>
#include    <stdlib.h>
#include    <string.h>
void main(int argc,char *argv[]) {
    if (argc!=2) {
        fprintf((stderr),"Error invalid argument.");
        exit(1);
        }
    char *s=argv[1];
    if (strcmp(&(s[strlen(s)-4]),".tmc")!=0) {
        fprintf((stderr),"It is not .tmc file.\n");
        exit(1);
        }
    char spi[strlen(s)-4];
    strncpy(spi,s,strlen(s)-4);
    FILE *efp=fopen(s,"r");
    if (efp==NULL) {
        fprintf(stderr,"File does not exsist.\n");
        exit(1);
        }
    FILE *ofp=fopen(spi,"wb");
    fputc((int)0xa,ofp);
    fclose(efp);
    fclose(ofp);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?