-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmem_hide.c
29 lines (26 loc) · 812 Bytes
/
mem_hide.c
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
extern main();
extern outport();
mem_hide(int fdSer) {
int opcode, memory_number, hide_byte;
char hide_char;
printf("Enter memory channel modify [31=p1, 32=p2] -> ");
scanf("%d", &memory_number);
if (memory_number <= 0 || memory_number >= 33) {
printf("Invalid value!!!\n");
return;
}
printf("Hide or unhide channel? [h=hide, u=unhide] -> ");
scanf("%s", &hide_char);
if (hide_char == 'h' || hide_char == 'u') {
opcode = 0x03;
if (hide_char == 'h') {
hide_byte = 0x01;
} else {
hide_byte = 0x02;
}
} else {
printf("Invalid value!!!\n");
opcode = 0x00; /* invalid, opcode must do nothing */
}
outport(fdSer, opcode, opcode, hide_byte, memory_number, opcode);
}