ADD exercices week 2

This commit is contained in:
2025-02-27 19:27:10 +01:00
parent 9df5ce5b66
commit 914fbc5d6d
35 changed files with 470 additions and 0 deletions

0
01-VeryEasy2/VE2 Normal file → Executable file
View File

0
01-VeryEasy2/VE2.gpr Normal file
View File

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<FILE_INFO>
<BASIC_INFO>
<STATE NAME="CONTENT_TYPE" TYPE="string" VALUE="Program" />
<STATE NAME="PARENT" TYPE="string" VALUE="/" />
<STATE NAME="FILE_ID" TYPE="string" VALUE="a801f6fb66758882284485789" />
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
<STATE NAME="NAME" TYPE="string" VALUE="VE2" />
</BASIC_INFO>
</FILE_INFO>

Binary file not shown.

View File

@ -0,0 +1,5 @@
VERSION=1
/
00000000:VE2:a801f6fb66758882284485789
NEXT-ID:1
MD5:d41d8cd98f00b204e9800998ecf8427e

View File

@ -0,0 +1,5 @@
VERSION=1
/
00000000:VE2:a801f6fb66758882284485789
NEXT-ID:1
MD5:d41d8cd98f00b204e9800998ecf8427e

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<FILE_INFO>
<BASIC_INFO>
<STATE NAME="OWNER" TYPE="string" VALUE="remi" />
</BASIC_INFO>
</FILE_INFO>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<PROJECT>
<PROJECT_DATA_XML_NAME NAME="DISPLAY_DATA">
<SAVE_STATE>
<ARRAY NAME="EXPANDED_PATHS" TYPE="string">
<A VALUE="VE2:" />
</ARRAY>
<STATE NAME="SHOW_TABLE" TYPE="boolean" VALUE="false" />
</SAVE_STATE>
</PROJECT_DATA_XML_NAME>
<TOOL_MANAGER ACTIVE_WORKSPACE="Workspace">
<WORKSPACE NAME="Workspace" ACTIVE="true" />
</TOOL_MANAGER>
</PROJECT>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<FILE_INFO>
<BASIC_INFO>
<STATE NAME="CONTENT_TYPE" TYPE="string" VALUE="ProgramUserData" />
<STATE NAME="PARENT" TYPE="string" VALUE="/" />
<STATE NAME="FILE_ID" TYPE="string" VALUE="a801f6fa08361347999654449" />
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
<STATE NAME="NAME" TYPE="string" VALUE="udf_a801f6fb66758882284485789" />
</BASIC_INFO>
</FILE_INFO>

Binary file not shown.

View File

@ -0,0 +1,4 @@
VERSION=1
/
NEXT-ID:0
MD5:d41d8cd98f00b204e9800998ecf8427e

View File

@ -0,0 +1,5 @@
VERSION=1
/
00000000:udf_a801f6fb66758882284485789:a801f6fa08361347999654449
NEXT-ID:1
MD5:d41d8cd98f00b204e9800998ecf8427e

View File

@ -0,0 +1,2 @@
IADD:00000000:/udf_a801f6fb66758882284485789
IDSET:/udf_a801f6fb66758882284485789:a801f6fa08361347999654449

View File

@ -0,0 +1,4 @@
VERSION=1
/
NEXT-ID:0
MD5:d41d8cd98f00b204e9800998ecf8427e

View File

@ -0,0 +1,4 @@
VERSION=1
/
NEXT-ID:0
MD5:d41d8cd98f00b204e9800998ecf8427e

8
01-VeryEasy2/VE2.txt Normal file
View File

@ -0,0 +1,8 @@
1. Was this executable compiled with debugging symbols?
yes, with debug_info
2. How is protected the secret password hard-coded into this executable?
By shift of 'W'
3. What is the secret password hard-coded into this executable? You must send this value by email to pascal+sre25@mod-p.ch before Mar. 3rd, 2025, 12h00 CET to validate this lab and get 1 point.
JSHGnQumN+sQ

43
01-VeryEasy2/code.c Normal file
View File

@ -0,0 +1,43 @@
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
char ENCSECRETPASSWORD[];
int main(int param_1, char* *param_2) {
int8_t output_value;
size_t input_length;
char acStack_19 [13];
if (param_1 == 2) {
input_length = strlen((char *)param_2[1]);
if (input_length == 12) {
for (uint8_t i = 0; i < 13; i++) {
acStack_19[i] = ENCSECRETPASSWORD[i] + 'W'; // JSHGnQumN+sQ
//f3 fc f1 f0 17 fa 1e 16 f7 d4 1c fa a9
//
}
for (uint8_t i = 0; i < 13; i++) {
if (acStack_19[i] != *(char *)((long)i + param_2[1])) {
fwrite("\nWrong password ! Try again...\n\n",1,32,stderr);
return 1;
}
}
fprintf(stderr,"\nCongratulations ! The right password is indeed %s :-)\n\n",param_2[1]);
output_value = 35;
}
else {
fwrite("\nWrong password ! Try again...\n\n",1,32,stderr);
output_value = 1;
}
}
else {
fwrite("\nMSE-SRE Challenge VE2 --- Enjoy !\n",1,35,stderr);
fprintf(stderr,"\nUsage: %s <password>\n\n",*param_2);
output_value = 1;
}
return output_value;
}

16
01-VeryEasy2/foo.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdint.h>
int main() {
char foo[14] = {0xf3, 0xfc, 0xf1, 0xf0, 0x17, 0xfa, 0x1e, 0x16, 0xf7, 0xd4, 0x1c, 0xfa, 0xa9, '\0'};
for (uint8_t i = 0; i<13; i++) {
foo[i] += 'W';
}
foo[13] = '\0';
printf("%s \r\t", foo);
return 0;
}
void myfunc(int a, ...) {
}