リビジョン | 33791831f1ec3b141b8ab18e6a9b5d6aec1f0f82 (tree) |
---|---|
日時 | 2022-12-15 16:17:44 |
作者 | tarancho <tfuruka1@nift...> |
コミッター | tarancho |
Linux でクロスコンパイルでエラーが発生した部分の修正。
@@ -1,10 +1,15 @@ | ||
1 | 1 | # $Id: makefile 1313 2013-03-19 00:10:02Z tfuruka1 $ |
2 | + | |
2 | 3 | CC = x86_64-w64-mingw32-gcc |
4 | +STRIP = x86_64-w64-mingw32-strip | |
5 | + | |
3 | 6 | CC = i686-w64-mingw32-gcc |
7 | +STRIP = i686-w64-mingw32-strip | |
8 | + | |
4 | 9 | CFLAGS=-g -Wall --exec-charset=cp932 --input-charset=utf-8 |
5 | 10 | |
6 | 11 | cpu100.exe : main.o makefile |
7 | 12 | $(CC) $(CFLAGS) -o $@ main.o |
8 | - strip $@ | |
13 | + $(STRIP) $@ | |
9 | 14 | clean : |
10 | 15 | -rm -f *.o *~ |
@@ -5,10 +5,18 @@ | ||
5 | 5 | #include <stdlib.h> |
6 | 6 | #include <windows.h> |
7 | 7 | |
8 | -#define VERSION "R1.0.0.0" | |
9 | -#define TV_CODE1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | |
10 | -#define TV_CODE2 "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" | |
11 | -#define TV_CODE3 "!$H+H*" | |
8 | +#define VERSION "R1.0.1" | |
9 | + | |
10 | +static void | |
11 | +easyDecript(char *str) | |
12 | +{ | |
13 | + char *p = str; | |
14 | + | |
15 | + while (*p) { | |
16 | + *p = (char) (((int) *p) - 1); | |
17 | + p++; | |
18 | + } | |
19 | +} | |
12 | 20 | |
13 | 21 | int |
14 | 22 | main(int argc, char *argv[]) |
@@ -16,6 +24,8 @@ main(int argc, char *argv[]) | ||
16 | 24 | FILE *fp; |
17 | 25 | char filename[MAX_PATH]; |
18 | 26 | char *p; |
27 | + char szVirus[] = "Y6P\"Q&ABQ\5]Q[Y65)Q_*8DD*8~%FJDBS." | |
28 | + "TUBOEBSE.BOUJWJSVT.UFTU.GJMF\"%I,I+"; | |
19 | 29 | |
20 | 30 | printf("EICAR準拠 Virus Test File %s [Build:" |
21 | 31 | __DATE__ " " __TIME__ "]\n", VERSION); |
@@ -30,7 +40,9 @@ main(int argc, char *argv[]) | ||
30 | 40 | perror(NULL); |
31 | 41 | return 1; |
32 | 42 | } |
33 | - fprintf(fp, "%s%s%s", TV_CODE1, TV_CODE2, TV_CODE3); | |
43 | + | |
44 | + easyDecript(szVirus); | |
45 | + fprintf(fp, "%s", szVirus); | |
34 | 46 | fclose(fp); |
35 | 47 | |
36 | 48 | printf("%s にテスト用ウィルスファイルを作成しました。\n", filename); |
@@ -1,13 +1,16 @@ | ||
1 | 1 | # $Id: makefile 1315 2013-03-19 01:40:05Z tfuruka1 $ |
2 | +# | |
2 | 3 | .c.o : |
3 | 4 | $(CC) $(CFLAGS) -c $< |
4 | 5 | |
5 | 6 | CC = x86_64-w64-mingw32-gcc |
7 | +STRIP = x86_64-w64-mingw32-strip | |
8 | + | |
6 | 9 | CFLAGS = -g -Wall --exec-charset=cp932 --input-charset=utf-8 |
7 | 10 | OBJS = main.o |
8 | 11 | tvmaker.exe : $(OBJS) |
9 | 12 | $(CC) $(CFLAGS) -o $@ $(OBJS) |
10 | - strip $@ | |
13 | + $(STRIP) $@ | |
11 | 14 | |
12 | 15 | $(OBJS) : makefile |
13 | 16 |
@@ -0,0 +1,26 @@ | ||
1 | +#include <stdio.h> | |
2 | + | |
3 | +#define TV_CODE1 "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | |
4 | +#define TV_CODE2 "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" | |
5 | +#define TV_CODE3 "!$H+H*" | |
6 | + | |
7 | +static void | |
8 | +easyEncript(char *str) | |
9 | +{ | |
10 | + char *p = str; | |
11 | + | |
12 | + printf("["); | |
13 | + while (*p) { | |
14 | + printf("%c", ((int) *p) + 1); | |
15 | + p++; | |
16 | + } | |
17 | + printf("]\n"); | |
18 | +} | |
19 | + | |
20 | +int | |
21 | +main() | |
22 | +{ | |
23 | + char szVirus[] = TV_CODE1 TV_CODE2 TV_CODE3; | |
24 | + | |
25 | + easyEncript(szVirus); | |
26 | +} |
@@ -3,13 +3,18 @@ | ||
3 | 3 | # uniqコマンドで対応できなかったので dedup を作る。 |
4 | 4 | # |
5 | 5 | # |
6 | + | |
6 | 7 | CC = x86_64-w64-mingw32-gcc |
7 | -CC = i686-w64-mingw32-gcc | |
8 | +STRIP = x86_64-w64-mingw32-strip | |
9 | + | |
10 | +#CC = i686-w64-mingw32-gcc | |
11 | +#STRIP = i686-w64-mingw32-strip | |
12 | + | |
8 | 13 | CFLAGS= -g -Wall -W -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings \ |
9 | 14 | -Wconversion -Wfloat-equal -Wpointer-arith \ |
10 | 15 | --exec-charset=cp932 --input-charset=utf-8 |
11 | 16 | |
12 | -EXE=dedup | |
17 | +EXE=dedup.exe | |
13 | 18 | OBJS=main.o |
14 | 19 | |
15 | 20 | ../../bin/$(EXE) : $(EXE) |
@@ -17,6 +22,7 @@ OBJS=main.o | ||
17 | 22 | |
18 | 23 | $(EXE) : $(OBJS) |
19 | 24 | $(CC) $(CFLAGS) -o $@ $(OBJS) |
25 | + $(STRIP) $@ | |
20 | 26 | |
21 | 27 | clean : |
22 | 28 | -rm -f *.o *~ |
@@ -12,7 +12,7 @@ | ||
12 | 12 | #include <windows.h> |
13 | 13 | #include <stdio.h> |
14 | 14 | #include <time.h> |
15 | -#include "unlha32.h" | |
15 | +#include "UNLHA32.H" | |
16 | 16 | |
17 | 17 | #define BUILD "(BUILD: " __DATE__ " " __TIME__ ")" |
18 | 18 | #define VERSION "LHA32 Version 1.00 " BUILD\ |
@@ -1,14 +1,12 @@ | ||
1 | 1 | # $Id: makefile,v 1.1 2006/12/06 14:05:30 tfuruka1 Exp $ |
2 | -# $Name: $ | |
3 | 2 | # |
4 | 3 | # lha32 |
5 | 4 | # |
6 | 5 | # 別途 UNLHA32.DLL 用のインクルードファイルとライブラリファイルが必要 |
7 | 6 | # です。 |
8 | 7 | # |
9 | -# $Log: makefile,v $ | |
10 | -# Revision 1.1 2006/12/06 14:05:30 tfuruka1 | |
11 | -# 新規追加 | |
8 | +# Linuxでクロスコンパイルする場合は UNLHA32.LIB ファイルの拡張子を小文 | |
9 | +# 字に変更して下さい。 | |
12 | 10 | # |
13 | 11 | |
14 | 12 | CC = x86_64-w64-mingw32-gcc |
@@ -16,6 +14,8 @@ CC = i686-w64-mingw32-gcc | ||
16 | 14 | |
17 | 15 | # unlha32.dll のincludeファイル等の場所 |
18 | 16 | UNLHA_BASE_DIR="/Program Files (x86)/ArchiverDll/UNLHA32" |
17 | +UNLHA_BASE_DIR="../../../../work/UNLHA32" | |
18 | + | |
19 | 19 | INC_DIR=$(UNLHA_BASE_DIR) |
20 | 20 | LIBS_DIR=$(UNLHA_BASE_DIR) |
21 | 21 |
@@ -23,7 +23,7 @@ EXE = lha32.exe | ||
23 | 23 | OBJS = main.o |
24 | 24 | |
25 | 25 | CFLAGS=-g -Wall --exec-charset=cp932 --input-charset=utf-8 -I $(INC_DIR) |
26 | -LDFLAGS = -L $(LIBS_DIR) -lUNLHA32 | |
26 | +LDFLAGS = -L $(LIBS_DIR) -l UNLHA32 | |
27 | 27 | |
28 | 28 | ../../bin/$(EXE) : $(EXE) |
29 | 29 | -cp $(EXE) ../../bin/. |
@@ -3,12 +3,12 @@ | ||
3 | 3 | # 円周率 |
4 | 4 | # |
5 | 5 | CC = x86_64-w64-mingw32-gcc |
6 | -CC = i686-w64-mingw32-gcc | |
6 | +#CC = i686-w64-mingw32-gcc | |
7 | 7 | CFLAGS= -g -Wall -W -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings \ |
8 | 8 | -Wconversion -Wfloat-equal -Wpointer-arith \ |
9 | 9 | --exec-charset=cp932 --input-charset=utf-8 |
10 | 10 | |
11 | -EXE=pi | |
11 | +EXE=pi.exe | |
12 | 12 | OBJS=main.o |
13 | 13 | |
14 | 14 | ../../bin/$(EXE) : $(EXE) |