ADD A3 solution, miss report
This commit is contained in:
		
							
								
								
									
										0
									
								
								03-Average3/A3
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								03-Average3/A3
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										6
									
								
								03-Average3/A3.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								03-Average3/A3.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  | 1. What is the algorithm used to check the validity of a password? | ||||||
|  |  | ||||||
|  | 2. This program relies on a specific trick. How does it work? | ||||||
|  |  | ||||||
|  | 3. Can you recover the secret password? You must send 1 the valid password by email to pascal+sre25@mod-p.ch before Apr. 28th, 2025, 12h00 CET to validate this lab and get 10 points. | ||||||
|  | JFuzhFSI4YShfqE7 | ||||||
							
								
								
									
										30153
									
								
								03-Average3/code.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30153
									
								
								03-Average3/code.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										52
									
								
								03-Average3/pw.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								03-Average3/pw.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | |||||||
|  |  #include <stdio.h> | ||||||
|  |  #include <stdint.h> | ||||||
|  |  #include <stdbool.h> | ||||||
|  |  #include <string.h> | ||||||
|  |  #include <sys/types.h> | ||||||
|  |  #include <signal.h> | ||||||
|  |  #include <sys/ptrace.h> | ||||||
|  |  | ||||||
|  |  // uVar4 = 1396505404 = 0x533CFB3C | ||||||
|  |  // uVar5 = 2294410125 = 0x88C1EB8D | ||||||
|  |  // uVar6 = 2929865363 = 0xAEA23293 | ||||||
|  |  | ||||||
|  | uint8_t main(int argc, char** argv) { | ||||||
|  |     char* list = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-"; | ||||||
|  |     uint32_t uVar4 = 1396505404; | ||||||
|  |     uint32_t uVar5 = 929308192; | ||||||
|  |     uint32_t uVar6 = 2929865363; | ||||||
|  |     char password[17]; | ||||||
|  |     password[16] = '\0'; | ||||||
|  |     password[0] = list[uVar6 >> 0x1a]; | ||||||
|  |     password[1] = list[uVar6 >> 0x14 & 0x3f]; | ||||||
|  |     password[2] = list[uVar6 >> 0xe & 0x3f]; | ||||||
|  |      // [uVar6 >> 8 & 0x3f] ^ password[3] | | ||||||
|  |     password[3] = list[uVar6 >> 8 & 0x3f]; | ||||||
|  |      // [uVar6 >> 2 & 0x3f] ^ password[4] | | ||||||
|  |     password[4] = list[uVar6 >> 2 & 0x3f]; | ||||||
|  |      // [(uVar6 & 3) << 4 | uVar4 >> 0x1c] ^ password[5] | | ||||||
|  |     password[5] = list[(uVar6 & 3) << 4 | uVar4 >> 0x1c]; | ||||||
|  |      // [uVar4 >> 0x16 & 0x3f] ^ password[6] | | ||||||
|  |     password[6] = list[uVar4 >> 0x16 & 0x3f]; | ||||||
|  |      // [uVar4 >> 0x10 & 0x3f] ^ password[7] | | ||||||
|  |     password[7] = list[uVar4 >> 0x10 & 0x3f]; | ||||||
|  |      // [uVar4 >> 10 & 0x3f] ^ password[8] | | ||||||
|  |     password[8] = list[uVar4 >> 10 & 0x3f]; | ||||||
|  |      // [uVar4 >> 4 & 0x3f] ^ password[9] | | ||||||
|  |     password[9] = list[uVar4 >> 4 & 0x3f]; | ||||||
|  |      // [uVar5 >> 0x1e | (uVar4 & 0xf) << 2] ^ password[10] | | ||||||
|  |     password[10] = list[uVar5 >> 0x1e | (uVar4 & 0xf) << 2]; | ||||||
|  |      // [uVar5 >> 0x18 & 0x3f] ^ password[11] | | ||||||
|  |     password[11] = list[uVar5 >> 0x18 & 0x3f]; | ||||||
|  |      // [uVar5 >> 0x12 & 0x3f] ^ password[12] | | ||||||
|  |     password[12] = list[uVar5 >> 0x12 & 0x3f]; | ||||||
|  |      // [uVar5 >> 0xc & 0x3f] ^ password[13] | | ||||||
|  |     password[13] = list[uVar5 >> 0xc & 0x3f]; | ||||||
|  |      // [uVar5 >> 6 & 0x3f] ^ password[14] | | ||||||
|  |     password[14] = list[uVar5 >> 6 & 0x3f]; | ||||||
|  |      // [uVar5 & 0x3f] ^ password[15] | ||||||
|  |     password[15] = list[uVar5 & 0x3f]; | ||||||
|  |  | ||||||
|  |     printf("%s\n", password); | ||||||
|  |     return 0; | ||||||
|  | } | ||||||
| @@ -1,10 +1,12 @@ | |||||||
| VERSION=1 | VERSION=1 | ||||||
| / | / | ||||||
|   00000001:A1:a801f6f89b95769364193802 |   00000001:A1:a801f6f89b95769364193802 | ||||||
|  |   00000006:A3:a801f56ab658487152928151 | ||||||
|  |   00000007:D1:c0a82d69e3b15562440310963 | ||||||
|   00000000:E4:a801f6f84bf5726727918611 |   00000000:E4:a801f6f84bf5726727918611 | ||||||
|   00000002:HelloRust:c0a82f6ac5f11262297970056 |   00000002:HelloRust:c0a82f6ac5f11262297970056 | ||||||
|   00000005:liba2.so:c0a82678bad57470710627698 |   00000005:liba2.so:c0a82678bad57470710627698 | ||||||
| /E5.apk | /E5.apk | ||||||
|   00000004:DebugProbesKt.bin:a947c5a05d160355288677079 |   00000004:DebugProbesKt.bin:a947c5a05d160355288677079 | ||||||
| NEXT-ID:6 | NEXT-ID:8 | ||||||
| MD5:d41d8cd98f00b204e9800998ecf8427e | MD5:d41d8cd98f00b204e9800998ecf8427e | ||||||
|   | |||||||
| @@ -2,10 +2,11 @@ VERSION=1 | |||||||
| / | / | ||||||
|   00000001:A1:a801f6f89b95769364193802 |   00000001:A1:a801f6f89b95769364193802 | ||||||
|   00000006:A3:a801f56ab658487152928151 |   00000006:A3:a801f56ab658487152928151 | ||||||
|  |   00000007:D1:c0a82d69e3b15562440310963 | ||||||
|   00000000:E4:a801f6f84bf5726727918611 |   00000000:E4:a801f6f84bf5726727918611 | ||||||
|   00000002:HelloRust:c0a82f6ac5f11262297970056 |   00000002:HelloRust:c0a82f6ac5f11262297970056 | ||||||
|   00000005:liba2.so:c0a82678bad57470710627698 |   00000005:liba2.so:c0a82678bad57470710627698 | ||||||
| /E5.apk | /E5.apk | ||||||
|   00000004:DebugProbesKt.bin:a947c5a05d160355288677079 |   00000004:DebugProbesKt.bin:a947c5a05d160355288677079 | ||||||
| NEXT-ID:7 | NEXT-ID:8 | ||||||
| MD5:d41d8cd98f00b204e9800998ecf8427e | MD5:d41d8cd98f00b204e9800998ecf8427e | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ VERSION=1 | |||||||
|   00000000:udf_a801f6f84bf5726727918611:a801f6f835112597744365961 |   00000000:udf_a801f6f84bf5726727918611:a801f6f835112597744365961 | ||||||
|   00000001:udf_a801f6f89b95769364193802:c0a82ee829520057231966697 |   00000001:udf_a801f6f89b95769364193802:c0a82ee829520057231966697 | ||||||
|   00000003:udf_a947c5a05d160355288677079:a947c5b473161854856522726 |   00000003:udf_a947c5a05d160355288677079:a947c5b473161854856522726 | ||||||
|  |   00000004:udf_c0a82678bad57470710627698:c0a82679e4158658428888916 | ||||||
|   00000002:udf_c0a82f6ac5f11262297970056:a801f2faf4d101904923747351 |   00000002:udf_c0a82f6ac5f11262297970056:a801f2faf4d101904923747351 | ||||||
| NEXT-ID:4 | NEXT-ID:5 | ||||||
| MD5:d41d8cd98f00b204e9800998ecf8427e | MD5:d41d8cd98f00b204e9800998ecf8427e | ||||||
|   | |||||||
| @@ -1,9 +1,11 @@ | |||||||
| VERSION=1 | VERSION=1 | ||||||
| / | / | ||||||
|  |   00000005:udf_a801f56ab658487152928151:c0a82d6804915544445885584 | ||||||
|   00000000:udf_a801f6f84bf5726727918611:a801f6f835112597744365961 |   00000000:udf_a801f6f84bf5726727918611:a801f6f835112597744365961 | ||||||
|   00000001:udf_a801f6f89b95769364193802:c0a82ee829520057231966697 |   00000001:udf_a801f6f89b95769364193802:c0a82ee829520057231966697 | ||||||
|   00000003:udf_a947c5a05d160355288677079:a947c5b473161854856522726 |   00000003:udf_a947c5a05d160355288677079:a947c5b473161854856522726 | ||||||
|   00000004:udf_c0a82678bad57470710627698:c0a82679e4158658428888916 |   00000004:udf_c0a82678bad57470710627698:c0a82679e4158658428888916 | ||||||
|  |   00000006:udf_c0a82d69e3b15562440310963:c0a82d68fef15936786772401 | ||||||
|   00000002:udf_c0a82f6ac5f11262297970056:a801f2faf4d101904923747351 |   00000002:udf_c0a82f6ac5f11262297970056:a801f2faf4d101904923747351 | ||||||
| NEXT-ID:5 | NEXT-ID:7 | ||||||
| MD5:d41d8cd98f00b204e9800998ecf8427e | MD5:d41d8cd98f00b204e9800998ecf8427e | ||||||
|   | |||||||
| @@ -1,2 +1,4 @@ | |||||||
| IADD:00000004:/udf_c0a82678bad57470710627698 | IADD:00000005:/udf_a801f56ab658487152928151 | ||||||
| IDSET:/udf_c0a82678bad57470710627698:c0a82679e4158658428888916 | IDSET:/udf_a801f56ab658487152928151:c0a82d6804915544445885584 | ||||||
|  | IADD:00000006:/udf_c0a82d69e3b15562440310963 | ||||||
|  | IDSET:/udf_c0a82d69e3b15562440310963:c0a82d68fef15936786772401 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user