-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexetoc.c
More file actions
45 lines (43 loc) · 808 Bytes
/
exetoc.c
File metadata and controls
45 lines (43 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
char *exe = "exe";
char *tmp = "";
for (; *argv[0] != '\0';tmp++, argv[0]++) {
*tmp = *argv[0];
printf("tmp<%c>argv<%c>\n",*tmp,*argv);
}
tmp--;
while (*tmp == *exe)
{
if (*tmp == 'x')
*tmp = '\0';
tmp--;
exe--;
}
*tmp = 'c';
printf("tmp<%c>\n",*tmp);
while (*tmp != '\0') {
tmp--;
}
tmp++;
printf("tmp<%c>\n",*tmp);
printf("\n");
/*
for (; i = '\0';tmp++, argv[0]++)
printf("%c\n", *argv[0]);
printf("argv<%c>\n",*argv[0]);
argv[0]--;
while (*exe == *argv[0])
{
printf("exe<%c>argv<%c>\n",*exe,*argv[0]);
exe++;
argv[0]--;
}
*argv[0] = 'c';
printf("argv<%c>\n",*argv[0]);
argv[0]++;
*argv[0] = '\0';
printf("argv<%c>\n",*argv[0]); */
}