ADD week 4
This commit is contained in:
parent
84135a321e
commit
86f265f22d
0
02-Easy4/E4
Normal file → Executable file
0
02-Easy4/E4
Normal file → Executable file
26
02-Easy4/E4.txt
Normal file
26
02-Easy4/E4.txt
Normal file
@ -0,0 +1,26 @@
|
||||
1. Was this executable stripped?
|
||||
yes
|
||||
|
||||
2. How are the password checking functionalities entangled with the operating system?
|
||||
|
||||
|
||||
3. What is the algorithm used to check the validity of a password?
|
||||
|
||||
|
||||
4. Can you break this password checker, i.e., implementing a generator of valid passwords? You must send 16 different valid passwords by email to pascal+sre25@mod-p.ch before Mar. 24th, 2025, 12h00 CET to validate this lab and get 5 points.
|
||||
3A3A3A3A3A3A
|
||||
3A4B5C6D7E8F
|
||||
SaSaSaSaSaSa
|
||||
SaTbUcVdWeXf
|
||||
+9+9+9+9+9+9
|
||||
+99GGUUccq4B
|
||||
!//==KKYYggu
|
||||
>L3AGUES3AN\
|
||||
HVESDRHVESDR
|
||||
8F7E6D5C4B3A
|
||||
XfWeVdUcTbSa
|
||||
4BcqUcGU9G+9
|
||||
guYgKY=K/=!/
|
||||
N\3AESGU3A>L
|
||||
DRESHVDRESHV
|
||||
#1HVESLZP^#1
|
61
02-Easy4/code.c
Normal file
61
02-Easy4/code.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
static char* input_pw;
|
||||
static char return_check_pw;
|
||||
|
||||
|
||||
|
||||
void check_pw(void) {
|
||||
uint8_t bVar1;
|
||||
char *pcVar2;
|
||||
char *pcVar3;
|
||||
|
||||
bVar1 = 0;
|
||||
pcVar2 = input_pw;
|
||||
do {
|
||||
pcVar3 = pcVar2 + 2;
|
||||
bVar1 = bVar1 | ((pcVar2[1] - 14) - pcVar2[0]);
|
||||
pcVar2 = pcVar3;
|
||||
} while (input_pw + 12 != pcVar3);
|
||||
return_check_pw = (int)(char)bVar1;
|
||||
return;
|
||||
}
|
||||
|
||||
void print_check_pw(void) {
|
||||
if (return_check_pw != 0) {
|
||||
fwrite("\nWrong password ! Try again...\n\n",1,0x20,stderr);
|
||||
return;
|
||||
}
|
||||
fprintf(stderr,"\nCongratulations ! A right password is indeed %s :-)\n\n",input_pw);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64_t main(int param_1,char* *param_2) {
|
||||
char *__s;
|
||||
size_t sVar1;
|
||||
|
||||
if (param_1 == 2) {
|
||||
__s = (char *)param_2[1];
|
||||
sVar1 = strlen(__s);
|
||||
if (sVar1 == 12) {
|
||||
input_pw = __s;
|
||||
signal(10,check_pw);
|
||||
signal(12,print_check_pw);
|
||||
kill(0,10);
|
||||
kill(0,12);
|
||||
return 0;
|
||||
}
|
||||
fwrite("\nWrong password ! Try again...\n\n",1,0x20,stderr);
|
||||
} else {
|
||||
fwrite("\nMSE-SRE Challenge E4 --- Enjoy !\n",1,0x22,stderr);
|
||||
fwrite("\nWhat I need is 1024 passwords passing the check!\n",1,0x32,stderr);
|
||||
fprintf(stderr,"\nUsage: %s <password>\n\n",*param_2);
|
||||
}
|
||||
return 1;
|
||||
}
|
0
03-Average1/A1
Normal file → Executable file
0
03-Average1/A1
Normal file → Executable file
BIN
03-Average1/A1-vscode/.gradle/8.5/checksums/checksums.lock
Normal file
BIN
03-Average1/A1-vscode/.gradle/8.5/checksums/checksums.lock
Normal file
Binary file not shown.
Binary file not shown.
BIN
03-Average1/A1-vscode/.gradle/8.5/fileHashes/fileHashes.lock
Normal file
BIN
03-Average1/A1-vscode/.gradle/8.5/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
#Sun Mar 16 11:54:07 CET 2025
|
||||
gradle.version=8.5
|
56
03-Average1/A1-vscode/.vscode/launch.json
vendored
Normal file
56
03-Average1/A1-vscode/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Ghidra",
|
||||
"request": "launch",
|
||||
"mainClass": "ghidra.Ghidra",
|
||||
"args": "ghidra.GhidraRun",
|
||||
"classPaths": [
|
||||
"/opt/ghidra/Ghidra/Framework/Utility/lib/Utility.jar"
|
||||
],
|
||||
"vmArgs": [
|
||||
"-Dghidra.external.modules=${workspaceFolder}",
|
||||
"-Djava.system.class.loader=ghidra.GhidraClassLoader",
|
||||
"-Dfile.encoding=UTF8",
|
||||
"-Duser.country=US",
|
||||
"-Duser.language=en",
|
||||
"-Duser.variant=",
|
||||
"-Dsun.java2d.opengl=false",
|
||||
"-Djdk.tls.client.protocols=TLSv1.2,TLSv1.3",
|
||||
"-Dcpu.core.limit=",
|
||||
"-Dcpu.core.override=",
|
||||
"-Dfont.size.override=",
|
||||
"-Dpython.console.encoding=UTF-8",
|
||||
"-Xshare:off",
|
||||
"-Dsun.java2d.pmoffscreen=false",
|
||||
"-Dsun.java2d.xrender=true",
|
||||
"-Dsun.java2d.uiScale=1",
|
||||
"-Dawt.useSystemAAFontSettings=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "debugpy",
|
||||
"name": "PyGhidra",
|
||||
"request": "launch",
|
||||
"module": "pyghidra.ghidra_launch",
|
||||
"args": [
|
||||
"--install-dir",
|
||||
"/opt/ghidra",
|
||||
"-g",
|
||||
"ghidra.GhidraRun"
|
||||
],
|
||||
"env": {
|
||||
"PYGHIDRA_DEBUG": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Ghidra Attach",
|
||||
"request": "attach",
|
||||
"hostName": "localhost",
|
||||
"port": 18001
|
||||
}
|
||||
]
|
||||
}
|
241
03-Average1/A1-vscode/.vscode/settings.json
vendored
Normal file
241
03-Average1/A1-vscode/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,241 @@
|
||||
{
|
||||
"java.import.maven.enabled": false,
|
||||
"java.import.gradle.enabled": false,
|
||||
"java.import.gradle.wrapper.enabled": false,
|
||||
"java.import.gradle.version": "8.5",
|
||||
"java.format.settings.url": "/opt/ghidra/support/eclipse/GhidraEclipseFormatter.xml",
|
||||
"java.project.sourcePaths": [
|
||||
"src/main/java",
|
||||
"ghidra_scripts"
|
||||
],
|
||||
"java.project.outputPath": "bin/main",
|
||||
"java.project.referencedLibraries": {
|
||||
"include": [
|
||||
"/opt/ghidra/Ghidra/Framework/Utility/lib/Utility.jar",
|
||||
"/opt/ghidra/Ghidra/patch",
|
||||
"/opt/ghidra/Ghidra/Framework/DB/lib/DB.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Docking/lib/Docking.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/Emulation.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/asm-9.7.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/asm-analysis-9.7.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/asm-commons-9.7.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/asm-tree-9.7.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/asm-util-9.7.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/FileSystem/lib/FileSystem.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/Generic.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/bcpkix-jdk15on-1.69.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/bcprov-jdk15on-1.69.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/bcutil-jdk15on-1.69.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/commons-collections4-4.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/commons-compress-1.21.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/commons-io-2.11.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/commons-lang3-3.12.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/commons-text-1.10.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/failureaccess-1.0.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/gson-2.9.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/guava-32.1.3-jre.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/jdom-legacy-1.1.3.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/log4j-api-2.17.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/log4j-core-2.17.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/Graph.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jgrapht-core-1.5.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jgrapht-io-1.5.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jung-algorithms-2.1.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jung-api-2.1.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jung-graph-impl-2.1.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/jung-visualization-2.1.1.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Gui/lib/Gui.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Gui/lib/flatlaf-3.5.4.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Help/lib/Help.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Help/lib/javahelp-2.0.05.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Help/lib/timingframework-1.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Project/lib/Project.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Project/lib/xz-1.9.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Pty/lib/Pty.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Pty/lib/jna-5.14.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/Pty/lib/jna-platform-5.14.0.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/antlr-runtime-3.5.2.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/isorelax-20050913.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/msv-20050913.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/relaxngDatatype-20050913.jar",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/xsdlib-20050913.jar",
|
||||
"/opt/ghidra/Ghidra/Configurations/Public_Release/lib/Public_Release.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/BSim.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/commons-dbcp2-2.9.0.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/commons-logging-1.2.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/commons-pool2-2.11.1.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/h2-2.2.220.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/postgresql-42.7.3.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BSimFeatureVisualizer/lib/BSimFeatureVisualizer.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/Base.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/biz.aQute.bnd.util-7.0.0.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/biz.aQute.bndlib-7.0.0.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/org.apache.felix.framework-7.0.5.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/org.osgi.util.promise-1.3.0.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/phidias-0.3.7.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/slf4j-api-1.7.25.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/slf4j-nop-1.7.25.jar",
|
||||
"/opt/ghidra/Ghidra/Features/BytePatterns/lib/BytePatterns.jar",
|
||||
"/opt/ghidra/Ghidra/Features/ByteViewer/lib/ByteViewer.jar",
|
||||
"/opt/ghidra/Ghidra/Features/CodeCompare/lib/CodeCompare.jar",
|
||||
"/opt/ghidra/Ghidra/Features/DebugUtils/lib/DebugUtils.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Decompiler/lib/Decompiler.jar",
|
||||
"/opt/ghidra/Ghidra/Features/DecompilerDependent/lib/DecompilerDependent.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/AXMLPrinter2.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/FileFormats.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/baksmali-2.5.2.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/dex-ir-2.4.24.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/dex-reader-2.4.24.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/dex-reader-api-2.4.24.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/dex-translator-2.4.24.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/dexlib2-2.5.2.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/sevenzipjbinding-16.02-2.01.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/sevenzipjbinding-all-platforms-16.02-2.01.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/util-2.5.2.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionGraph/lib/FunctionGraph.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionGraphDecompilerExtension/lib/FunctionGraphDecompilerExtension.jar",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionID/lib/FunctionID.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GhidraGo/lib/GhidraGo.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GhidraServer/lib/GhidraServer.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GnuDemangler/lib/GnuDemangler.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphFunctionCalls/lib/GraphFunctionCalls.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/GraphServices.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/jgrapht-core-1.5.1.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/jgrapht-io-1.5.1.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/jheaps-0.13.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/jungrapht-layout-1.4.jar",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/jungrapht-visualization-1.4.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Jython/lib/Jython.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Jython/lib/jython-standalone-2.7.4.jar",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftCodeAnalyzer/lib/MicrosoftCodeAnalyzer.jar",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftDemangler/lib/MicrosoftDemangler.jar",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftDmang/lib/MicrosoftDmang.jar",
|
||||
"/opt/ghidra/Ghidra/Features/PDB/lib/PDB.jar",
|
||||
"/opt/ghidra/Ghidra/Features/ProgramDiff/lib/ProgramDiff.jar",
|
||||
"/opt/ghidra/Ghidra/Features/ProgramGraph/lib/ProgramGraph.jar",
|
||||
"/opt/ghidra/Ghidra/Features/PyGhidra/lib/PyGhidra.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Recognizers/lib/Recognizers.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Sarif/lib/Sarif.jar",
|
||||
"/opt/ghidra/Ghidra/Features/Sarif/lib/java-sarif-2.1-modified.jar",
|
||||
"/opt/ghidra/Ghidra/Features/SourceCodeLookup/lib/SourceCodeLookup.jar",
|
||||
"/opt/ghidra/Ghidra/Features/SwiftDemangler/lib/SwiftDemangler.jar",
|
||||
"/opt/ghidra/Ghidra/Features/SystemEmulation/lib/SystemEmulation.jar",
|
||||
"/opt/ghidra/Ghidra/Features/VersionTracking/lib/VersionTracking.jar",
|
||||
"/opt/ghidra/Ghidra/Features/VersionTrackingBSim/lib/VersionTrackingBSim.jar",
|
||||
"/opt/ghidra/Ghidra/Features/WildcardAssembler/lib/WildcardAssembler.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/AnnotationValidator/lib/AnnotationValidator.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger/lib/Debugger.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-api/lib/Debugger-api.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-isf/lib/Debugger-isf.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-jpda/lib/Debugger-jpda.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-rmi-trace/lib/Debugger-rmi-trace.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Framework-AsyncComm/lib/Framework-AsyncComm.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Framework-AsyncComm/lib/protobuf-java-3.21.8.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/Framework-TraceModeling/lib/Framework-TraceModeling.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/ProposedUtils/lib/ProposedUtils.jar",
|
||||
"/opt/ghidra/Ghidra/Debug/TaintAnalysis/lib/TaintAnalysis.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/68000/lib/68000.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/8051/lib/8051.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/AARCH64/lib/AARCH64.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/ARM/lib/ARM.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/Atmel/lib/Atmel.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/DATA/lib/DATA.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/Dalvik/lib/Dalvik.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/HCS12/lib/HCS12.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/JVM/lib/JVM.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/Loongarch/lib/Loongarch.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/MIPS/lib/MIPS.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/PIC/lib/PIC.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/PowerPC/lib/PowerPC.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/RISCV/lib/RISCV.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/Sparc/lib/Sparc.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/SuperH4/lib/SuperH4.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/TI_MSP430/lib/TI_MSP430.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/V850/lib/V850.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/Xtensa/lib/Xtensa.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/eBPF/lib/eBPF.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/tricore/lib/tricore.jar",
|
||||
"/opt/ghidra/Ghidra/Processors/x86/lib/x86.jar"
|
||||
],
|
||||
"sources": {
|
||||
"/opt/ghidra/Ghidra/Framework/Utility/lib/Utility.jar": "/opt/ghidra/Ghidra/Framework/Utility/lib/Utility-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/DB/lib/DB.jar": "/opt/ghidra/Ghidra/Framework/DB/lib/DB-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Docking/lib/Docking.jar": "/opt/ghidra/Ghidra/Framework/Docking/lib/Docking-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Emulation/lib/Emulation.jar": "/opt/ghidra/Ghidra/Framework/Emulation/lib/Emulation-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/FileSystem/lib/FileSystem.jar": "/opt/ghidra/Ghidra/Framework/FileSystem/lib/FileSystem-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Generic/lib/Generic.jar": "/opt/ghidra/Ghidra/Framework/Generic/lib/Generic-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Graph/lib/Graph.jar": "/opt/ghidra/Ghidra/Framework/Graph/lib/Graph-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Gui/lib/Gui.jar": "/opt/ghidra/Ghidra/Framework/Gui/lib/Gui-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Help/lib/Help.jar": "/opt/ghidra/Ghidra/Framework/Help/lib/Help-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Project/lib/Project.jar": "/opt/ghidra/Ghidra/Framework/Project/lib/Project-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/Pty/lib/Pty.jar": "/opt/ghidra/Ghidra/Framework/Pty/lib/Pty-src.zip",
|
||||
"/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar": "/opt/ghidra/Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/BSim/lib/BSim.jar": "/opt/ghidra/Ghidra/Features/BSim/lib/BSim-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/BSimFeatureVisualizer/lib/BSimFeatureVisualizer.jar": "/opt/ghidra/Ghidra/Features/BSimFeatureVisualizer/lib/BSimFeatureVisualizer-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/Base/lib/Base.jar": "/opt/ghidra/Ghidra/Features/Base/lib/Base-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/BytePatterns/lib/BytePatterns.jar": "/opt/ghidra/Ghidra/Features/BytePatterns/lib/BytePatterns-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/ByteViewer/lib/ByteViewer.jar": "/opt/ghidra/Ghidra/Features/ByteViewer/lib/ByteViewer-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/CodeCompare/lib/CodeCompare.jar": "/opt/ghidra/Ghidra/Features/CodeCompare/lib/CodeCompare-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/DebugUtils/lib/DebugUtils.jar": "/opt/ghidra/Ghidra/Features/DebugUtils/lib/DebugUtils-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/Decompiler/lib/Decompiler.jar": "/opt/ghidra/Ghidra/Features/Decompiler/lib/Decompiler-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/DecompilerDependent/lib/DecompilerDependent.jar": "/opt/ghidra/Ghidra/Features/DecompilerDependent/lib/DecompilerDependent-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/FileFormats/lib/FileFormats.jar": "/opt/ghidra/Ghidra/Features/FileFormats/lib/FileFormats-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionGraph/lib/FunctionGraph.jar": "/opt/ghidra/Ghidra/Features/FunctionGraph/lib/FunctionGraph-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionGraphDecompilerExtension/lib/FunctionGraphDecompilerExtension.jar": "/opt/ghidra/Ghidra/Features/FunctionGraphDecompilerExtension/lib/FunctionGraphDecompilerExtension-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/FunctionID/lib/FunctionID.jar": "/opt/ghidra/Ghidra/Features/FunctionID/lib/FunctionID-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/GhidraGo/lib/GhidraGo.jar": "/opt/ghidra/Ghidra/Features/GhidraGo/lib/GhidraGo-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/GhidraServer/lib/GhidraServer.jar": "/opt/ghidra/Ghidra/Features/GhidraServer/lib/GhidraServer-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/GnuDemangler/lib/GnuDemangler.jar": "/opt/ghidra/Ghidra/Features/GnuDemangler/lib/GnuDemangler-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/GraphFunctionCalls/lib/GraphFunctionCalls.jar": "/opt/ghidra/Ghidra/Features/GraphFunctionCalls/lib/GraphFunctionCalls-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/GraphServices/lib/GraphServices.jar": "/opt/ghidra/Ghidra/Features/GraphServices/lib/GraphServices-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/Jython/lib/Jython.jar": "/opt/ghidra/Ghidra/Features/Jython/lib/Jython-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftCodeAnalyzer/lib/MicrosoftCodeAnalyzer.jar": "/opt/ghidra/Ghidra/Features/MicrosoftCodeAnalyzer/lib/MicrosoftCodeAnalyzer-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftDemangler/lib/MicrosoftDemangler.jar": "/opt/ghidra/Ghidra/Features/MicrosoftDemangler/lib/MicrosoftDemangler-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/MicrosoftDmang/lib/MicrosoftDmang.jar": "/opt/ghidra/Ghidra/Features/MicrosoftDmang/lib/MicrosoftDmang-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/PDB/lib/PDB.jar": "/opt/ghidra/Ghidra/Features/PDB/lib/PDB-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/ProgramDiff/lib/ProgramDiff.jar": "/opt/ghidra/Ghidra/Features/ProgramDiff/lib/ProgramDiff-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/ProgramGraph/lib/ProgramGraph.jar": "/opt/ghidra/Ghidra/Features/ProgramGraph/lib/ProgramGraph-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/PyGhidra/lib/PyGhidra.jar": "/opt/ghidra/Ghidra/Features/PyGhidra/lib/PyGhidra-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/Recognizers/lib/Recognizers.jar": "/opt/ghidra/Ghidra/Features/Recognizers/lib/Recognizers-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/Sarif/lib/Sarif.jar": "/opt/ghidra/Ghidra/Features/Sarif/lib/Sarif-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/SourceCodeLookup/lib/SourceCodeLookup.jar": "/opt/ghidra/Ghidra/Features/SourceCodeLookup/lib/SourceCodeLookup-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/SwiftDemangler/lib/SwiftDemangler.jar": "/opt/ghidra/Ghidra/Features/SwiftDemangler/lib/SwiftDemangler-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/SystemEmulation/lib/SystemEmulation.jar": "/opt/ghidra/Ghidra/Features/SystemEmulation/lib/SystemEmulation-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/VersionTracking/lib/VersionTracking.jar": "/opt/ghidra/Ghidra/Features/VersionTracking/lib/VersionTracking-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/VersionTrackingBSim/lib/VersionTrackingBSim.jar": "/opt/ghidra/Ghidra/Features/VersionTrackingBSim/lib/VersionTrackingBSim-src.zip",
|
||||
"/opt/ghidra/Ghidra/Features/WildcardAssembler/lib/WildcardAssembler.jar": "/opt/ghidra/Ghidra/Features/WildcardAssembler/lib/WildcardAssembler-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/AnnotationValidator/lib/AnnotationValidator.jar": "/opt/ghidra/Ghidra/Debug/AnnotationValidator/lib/AnnotationValidator-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger/lib/Debugger.jar": "/opt/ghidra/Ghidra/Debug/Debugger/lib/Debugger-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-api/lib/Debugger-api.jar": "/opt/ghidra/Ghidra/Debug/Debugger-api/lib/Debugger-api-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-isf/lib/Debugger-isf.jar": "/opt/ghidra/Ghidra/Debug/Debugger-isf/lib/Debugger-isf-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-jpda/lib/Debugger-jpda.jar": "/opt/ghidra/Ghidra/Debug/Debugger-jpda/lib/Debugger-jpda-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Debugger-rmi-trace/lib/Debugger-rmi-trace.jar": "/opt/ghidra/Ghidra/Debug/Debugger-rmi-trace/lib/Debugger-rmi-trace-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Framework-AsyncComm/lib/Framework-AsyncComm.jar": "/opt/ghidra/Ghidra/Debug/Framework-AsyncComm/lib/Framework-AsyncComm-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/Framework-TraceModeling/lib/Framework-TraceModeling.jar": "/opt/ghidra/Ghidra/Debug/Framework-TraceModeling/lib/Framework-TraceModeling-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/ProposedUtils/lib/ProposedUtils.jar": "/opt/ghidra/Ghidra/Debug/ProposedUtils/lib/ProposedUtils-src.zip",
|
||||
"/opt/ghidra/Ghidra/Debug/TaintAnalysis/lib/TaintAnalysis.jar": "/opt/ghidra/Ghidra/Debug/TaintAnalysis/lib/TaintAnalysis-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/68000/lib/68000.jar": "/opt/ghidra/Ghidra/Processors/68000/lib/68000-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/AARCH64/lib/AARCH64.jar": "/opt/ghidra/Ghidra/Processors/AARCH64/lib/AARCH64-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/ARM/lib/ARM.jar": "/opt/ghidra/Ghidra/Processors/ARM/lib/ARM-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/Atmel/lib/Atmel.jar": "/opt/ghidra/Ghidra/Processors/Atmel/lib/Atmel-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/DATA/lib/DATA.jar": "/opt/ghidra/Ghidra/Processors/DATA/lib/DATA-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/Dalvik/lib/Dalvik.jar": "/opt/ghidra/Ghidra/Processors/Dalvik/lib/Dalvik-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/HCS12/lib/HCS12.jar": "/opt/ghidra/Ghidra/Processors/HCS12/lib/HCS12-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/JVM/lib/JVM.jar": "/opt/ghidra/Ghidra/Processors/JVM/lib/JVM-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/Loongarch/lib/Loongarch.jar": "/opt/ghidra/Ghidra/Processors/Loongarch/lib/Loongarch-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/MIPS/lib/MIPS.jar": "/opt/ghidra/Ghidra/Processors/MIPS/lib/MIPS-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/PIC/lib/PIC.jar": "/opt/ghidra/Ghidra/Processors/PIC/lib/PIC-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/PowerPC/lib/PowerPC.jar": "/opt/ghidra/Ghidra/Processors/PowerPC/lib/PowerPC-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/RISCV/lib/RISCV.jar": "/opt/ghidra/Ghidra/Processors/RISCV/lib/RISCV-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/Sparc/lib/Sparc.jar": "/opt/ghidra/Ghidra/Processors/Sparc/lib/Sparc-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/SuperH4/lib/SuperH4.jar": "/opt/ghidra/Ghidra/Processors/SuperH4/lib/SuperH4-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/TI_MSP430/lib/TI_MSP430.jar": "/opt/ghidra/Ghidra/Processors/TI_MSP430/lib/TI_MSP430-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/Xtensa/lib/Xtensa.jar": "/opt/ghidra/Ghidra/Processors/Xtensa/lib/Xtensa-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/eBPF/lib/eBPF.jar": "/opt/ghidra/Ghidra/Processors/eBPF/lib/eBPF-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/tricore/lib/tricore.jar": "/opt/ghidra/Ghidra/Processors/tricore/lib/tricore-src.zip",
|
||||
"/opt/ghidra/Ghidra/Processors/x86/lib/x86.jar": "/opt/ghidra/Ghidra/Processors/x86/lib/x86-src.zip"
|
||||
}
|
||||
},
|
||||
"python.analysis.stubPath": "/opt/ghidra/docs/ghidra_stubs/typestubs"
|
||||
}
|
0
03-Average1/A1-vscode/Module.manifest
Executable file
0
03-Average1/A1-vscode/Module.manifest
Executable file
1
03-Average1/A1-vscode/README.md
Executable file
1
03-Average1/A1-vscode/README.md
Executable file
@ -0,0 +1 @@
|
||||
# Skeleton
|
66
03-Average1/A1-vscode/build.gradle
Executable file
66
03-Average1/A1-vscode/build.gradle
Executable file
@ -0,0 +1,66 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Builds a Ghidra Extension for a given Ghidra installation.
|
||||
//
|
||||
// An absolute path to the Ghidra installation directory must be supplied either by setting the
|
||||
// GHIDRA_INSTALL_DIR environment variable or Gradle project property:
|
||||
//
|
||||
// > export GHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
|
||||
// > gradle
|
||||
//
|
||||
// or
|
||||
//
|
||||
// > gradle -PGHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
|
||||
//
|
||||
// Gradle should be invoked from the directory of the project to build. Please see the
|
||||
// application.gradle.version property in <GHIDRA_INSTALL_DIR>/Ghidra/application.properties
|
||||
// for the correction version of Gradle to use for the Ghidra installation you specify.
|
||||
|
||||
//----------------------START "DO NOT MODIFY" SECTION------------------------------
|
||||
def ghidraInstallDir
|
||||
|
||||
if (System.env.GHIDRA_INSTALL_DIR) {
|
||||
ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR
|
||||
}
|
||||
else if (project.hasProperty("GHIDRA_INSTALL_DIR")) {
|
||||
ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR")
|
||||
}
|
||||
else {
|
||||
ghidraInstallDir = "/opt/ghidra"
|
||||
}
|
||||
|
||||
task distributeExtension {
|
||||
group "Ghidra"
|
||||
|
||||
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
|
||||
dependsOn ':buildExtension'
|
||||
}
|
||||
//----------------------END "DO NOT MODIFY" SECTION-------------------------------
|
||||
|
||||
repositories {
|
||||
// Declare dependency repositories here. This is not needed if dependencies are manually
|
||||
// dropped into the lib/ directory.
|
||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html for more info.
|
||||
// Ex: mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Any external dependencies added here will automatically be copied to the lib/ directory when
|
||||
// this extension is built.
|
||||
}
|
||||
|
||||
// Exclude additional files from the built extension
|
||||
// Ex: buildExtension.exclude '.idea/**'
|
15
03-Average1/A1-vscode/data/README.txt
Executable file
15
03-Average1/A1-vscode/data/README.txt
Executable file
@ -0,0 +1,15 @@
|
||||
The "data" directory is intended to hold data files that will be used by this module and will
|
||||
not end up in the .jar file, but will be present in the zip or tar file. Typically, data
|
||||
files are placed here rather than in the resources directory if the user may need to edit them.
|
||||
|
||||
An optional data/languages directory can exist for the purpose of containing various Sleigh language
|
||||
specification files and importer opinion files.
|
||||
|
||||
The data/buildLanguage.xml is used for building the contents of the data/languages directory.
|
||||
|
||||
The skel language definition has been commented-out within the skel.ldefs file so that the
|
||||
skeleton language does not show-up within Ghidra.
|
||||
|
||||
See the Sleigh language documentation (docs/languages/index.html) for details Sleigh language
|
||||
specification syntax.
|
||||
|
50
03-Average1/A1-vscode/data/buildLanguage.xml
Executable file
50
03-Average1/A1-vscode/data/buildLanguage.xml
Executable file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
+ Compile sleigh languages within this module.
|
||||
+ Sleigh compiler options are read from the sleighArgs.txt file.
|
||||
+ Eclipse: right-click on this file and choose menu item "Run As->Ant Build"
|
||||
-->
|
||||
|
||||
<project name="privateBuildDeveloper" default="sleighCompile">
|
||||
|
||||
<property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>
|
||||
|
||||
<!--Import optional ant properties. GhidraDev Eclipse plugin produces this so this file can find the Ghidra installation-->
|
||||
<import file="../.antProperties.xml" optional="false" />
|
||||
|
||||
<target name="sleighCompile">
|
||||
|
||||
<!-- If language module is detached from installation, get Ghidra installation directory path from imported properties -->
|
||||
<property name="framework.path" value="${ghidra.install.dir}/Ghidra/Framework"/>
|
||||
|
||||
<path id="sleigh.class.path">
|
||||
<fileset dir="${framework.path}/SoftwareModeling/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${framework.path}/Generic/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${framework.path}/Utility/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>
|
||||
|
||||
<fail unless="sleigh.compile.exists" />
|
||||
|
||||
<java classname="${sleigh.compile.class}"
|
||||
classpathref="sleigh.class.path"
|
||||
fork="true"
|
||||
failonerror="true">
|
||||
<jvmarg value="-Xmx2048M"/>
|
||||
<arg value="-i"/>
|
||||
<arg value="sleighArgs.txt"/>
|
||||
<arg value="-a"/>
|
||||
<arg value="./languages"/>
|
||||
</java>
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
121
03-Average1/A1-vscode/data/languages/skel.cspec
Executable file
121
03-Average1/A1-vscode/data/languages/skel.cspec
Executable file
@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/compiler_spec.rxg -->
|
||||
|
||||
<compiler_spec>
|
||||
<data_organization>
|
||||
<pointer_size value="2" />
|
||||
</data_organization>
|
||||
<global>
|
||||
<range space="ram"/>
|
||||
<range space="io"/>
|
||||
</global>
|
||||
<stackpointer register="SP" space="ram"/>
|
||||
<default_proto>
|
||||
<prototype name="__asmA" extrapop="2" stackshift="2" strategy="register">
|
||||
<input>
|
||||
<pentry minsize="1" maxsize="1">
|
||||
<register name="A"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="BC"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="HL"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="DE"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="IY"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="IX"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="500" align="2">
|
||||
<addr offset="2" space="stack"/>
|
||||
</pentry>
|
||||
</input>
|
||||
<output>
|
||||
<pentry minsize="1" maxsize="1">
|
||||
<register name="A"/>
|
||||
</pentry>
|
||||
</output>
|
||||
<unaffected>
|
||||
<register name="SP"/>
|
||||
<register name="BC_"/>
|
||||
<register name="HL_"/>
|
||||
<register name="DE_"/>
|
||||
<register name="AF_"/>
|
||||
<register name="rBBR"/>
|
||||
</unaffected>
|
||||
</prototype>
|
||||
</default_proto>
|
||||
<prototype name="__asmAF" extrapop="2" stackshift="2" strategy="register">
|
||||
<input>
|
||||
<pentry minsize="1" maxsize="1">
|
||||
<register name="A"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="BC"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="HL"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="DE"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="IY"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="IX"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="500" align="2">
|
||||
<addr offset="2" space="stack"/>
|
||||
</pentry>
|
||||
</input>
|
||||
<output>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="AF"/>
|
||||
</pentry>
|
||||
</output>
|
||||
<unaffected>
|
||||
<register name="SP"/>
|
||||
<register name="rBBR"/>
|
||||
<register name="BC_"/>
|
||||
<register name="HL_"/>
|
||||
<register name="DE_"/>
|
||||
<register name="AF_"/>
|
||||
</unaffected>
|
||||
</prototype>
|
||||
<prototype name="__stdcall" extrapop="2" stackshift="2">
|
||||
<input>
|
||||
<pentry minsize="1" maxsize="1">
|
||||
<register name="A"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="BC"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="2">
|
||||
<register name="HL"/>
|
||||
</pentry>
|
||||
<pentry minsize="1" maxsize="500" align="2">
|
||||
<addr offset="2" space="stack"/>
|
||||
</pentry>
|
||||
</input>
|
||||
<output>
|
||||
<pentry minsize="1" maxsize="1">
|
||||
<register name="AF"/>
|
||||
</pentry>
|
||||
</output>
|
||||
<unaffected>
|
||||
<register name="SP"/>
|
||||
<register name="rBBR"/>
|
||||
<register name="BC_"/>
|
||||
<register name="HL_"/>
|
||||
<register name="DE_"/>
|
||||
<register name="AF_"/>
|
||||
</unaffected>
|
||||
</prototype>
|
||||
</compiler_spec>
|
20
03-Average1/A1-vscode/data/languages/skel.ldefs
Executable file
20
03-Average1/A1-vscode/data/languages/skel.ldefs
Executable file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/language_definitions.rxg -->
|
||||
|
||||
<language_definitions>
|
||||
<!-- Uncomment the following to make the language available in Ghidra -->
|
||||
<!--
|
||||
<language processor="Skel"
|
||||
endian="little"
|
||||
size="16"
|
||||
variant="default"
|
||||
version="1.0"
|
||||
slafile="skel.sla"
|
||||
processorspec="skel.pspec"
|
||||
id="skel:LE:16:default">
|
||||
<description>Skeleton Language Module</description>
|
||||
<compiler name="default" spec="skel.cspec" id="default"/>
|
||||
</language>
|
||||
-->
|
||||
</language_definitions>
|
12
03-Average1/A1-vscode/data/languages/skel.opinion
Executable file
12
03-Average1/A1-vscode/data/languages/skel.opinion
Executable file
@ -0,0 +1,12 @@
|
||||
<opinions>
|
||||
<!-- Example of importer opinions - commented-out to prevent use by Ghidra -->
|
||||
<!-- The primary and secondary constraint values must be specifide as a decimal string -->
|
||||
<!--
|
||||
<constraint loader="Executable and Linking Format (ELF)" compilerSpecID="default">
|
||||
<constraint primary="40" secondary="123" processor="Skel" size="16" variant="default" />
|
||||
</constraint>
|
||||
<constraint loader="MS Common Object File Format (COFF)" compilerSpecID="default">
|
||||
<constraint primary="61" processor="Skel" size="16" variant="default" />
|
||||
</constraint>
|
||||
-->
|
||||
</opinions>
|
23
03-Average1/A1-vscode/data/languages/skel.pspec
Executable file
23
03-Average1/A1-vscode/data/languages/skel.pspec
Executable file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/processor_spec.rxg -->
|
||||
|
||||
<processor_spec>
|
||||
<programcounter register="PC"/>
|
||||
<register_data>
|
||||
<register name="AF_" group="Alt"/>
|
||||
<register name="BC_" group="Alt"/>
|
||||
<register name="DE_" group="Alt"/>
|
||||
<register name="HL_" group="Alt"/>
|
||||
</register_data>
|
||||
<default_symbols>
|
||||
<symbol name="RST0" address="ram:0000" entry="true"/>
|
||||
<symbol name="RST1" address="ram:0008" entry="false"/>
|
||||
<symbol name="RST2" address="ram:0010" entry="false"/>
|
||||
<symbol name="RST3" address="ram:0018" entry="false"/>
|
||||
<symbol name="RST4" address="ram:0020" entry="false"/>
|
||||
<symbol name="RST5" address="ram:0028" entry="false"/>
|
||||
<symbol name="RST6" address="ram:0030" entry="false"/>
|
||||
<symbol name="RST7" address="ram:0038" entry="false"/>
|
||||
</default_symbols>
|
||||
</processor_spec>
|
220
03-Average1/A1-vscode/data/languages/skel.sinc
Executable file
220
03-Average1/A1-vscode/data/languages/skel.sinc
Executable file
@ -0,0 +1,220 @@
|
||||
# sleigh include file for Skeleton language instructions
|
||||
|
||||
define token opbyte (8)
|
||||
op0_8 = (0,7)
|
||||
op6_2 = (6,7)
|
||||
|
||||
dRegPair4_2 = (4,5)
|
||||
pRegPair4_2 = (4,5)
|
||||
sRegPair4_2 = (4,5)
|
||||
qRegPair4_2 = (4,5)
|
||||
qRegPair4_2a = (4,5)
|
||||
qRegPair4_2b = (4,5)
|
||||
rRegPair4_2 = (4,5)
|
||||
|
||||
reg3_3 = (3,5)
|
||||
bits3_3 = (3,5)
|
||||
|
||||
bits0_4 = (0,3)
|
||||
|
||||
reg0_3 = (0,2)
|
||||
bits0_3 = (0,2)
|
||||
;
|
||||
|
||||
define token data8 (8)
|
||||
imm8 = (0,7)
|
||||
sign8 = (7,7)
|
||||
simm8 = (0,7) signed
|
||||
;
|
||||
|
||||
define token data16 (16)
|
||||
timm4 = (12,15)
|
||||
imm16 = (0,15)
|
||||
sign16 = (15,15)
|
||||
simm16 = (0,15) signed
|
||||
;
|
||||
|
||||
attach variables [ reg0_3 reg3_3 ] [ B C D E H L _ A ];
|
||||
|
||||
attach variables [ sRegPair4_2 dRegPair4_2 ] [ BC DE HL SP ];
|
||||
|
||||
attach variables [ qRegPair4_2 ] [ BC DE HL AF ];
|
||||
attach variables [ qRegPair4_2a ] [ B D H A ];
|
||||
attach variables [ qRegPair4_2b ] [ C E L F ];
|
||||
|
||||
attach variables [ pRegPair4_2 ] [ BC DE IX SP ];
|
||||
attach variables [ rRegPair4_2 ] [ BC DE IY SP ];
|
||||
|
||||
################################################################
|
||||
# Macros
|
||||
################################################################
|
||||
|
||||
macro setResultFlags(result) {
|
||||
$(Z_flag) = (result == 0);
|
||||
$(S_flag) = (result s< 0);
|
||||
}
|
||||
|
||||
macro setAddCarryFlags(op1,op2) {
|
||||
$(C_flag) = (carry(op1,zext($(C_flag))) || carry(op2,op1 + zext($(C_flag))));
|
||||
}
|
||||
|
||||
macro setAddFlags(op1,op2) {
|
||||
$(C_flag) = carry(op1,op2);
|
||||
}
|
||||
|
||||
macro setSubtractCarryFlags(op1,op2) {
|
||||
notC = ~$(C_flag);
|
||||
$(C_flag) = ((op1 < sext(notC)) || (op2 < (op1 - sext(notC))));
|
||||
}
|
||||
|
||||
macro setSubtractFlags(op1,op2) {
|
||||
$(C_flag) = (op1 < op2);
|
||||
}
|
||||
|
||||
macro push16(val16) {
|
||||
SP = SP - 2;
|
||||
*:2 SP = val16;
|
||||
}
|
||||
|
||||
macro pop16(ret16) {
|
||||
ret16 = *:2 SP;
|
||||
SP = SP + 2;
|
||||
}
|
||||
|
||||
macro push8(val8) {
|
||||
SP = SP - 1;
|
||||
ptr:2 = SP;
|
||||
*:1 ptr = val8;
|
||||
}
|
||||
|
||||
macro pop8(ret8) {
|
||||
ptr:2 = SP;
|
||||
ret8 = *:1 ptr;
|
||||
SP = SP + 1;
|
||||
}
|
||||
|
||||
################################################################
|
||||
|
||||
ixMem8: (IX+simm8) is IX & simm8 { ptr:2 = IX + simm8; export *:1 ptr; }
|
||||
ixMem8: (IX-val) is IX & simm8 & sign8=1 [ val = -simm8; ] { ptr:2 = IX + simm8; export *:1 ptr; }
|
||||
|
||||
iyMem8: (IY+simm8) is IY & simm8 { ptr:2 = IY + simm8; export *:1 ptr; }
|
||||
iyMem8: (IY-val) is IY & simm8 & sign8=1 [ val = -simm8; ] { ptr:2 = IY + simm8; export *:1 ptr; }
|
||||
|
||||
Addr16: imm16 is imm16 { export *:1 imm16; }
|
||||
|
||||
Mem16: (imm16) is imm16 { export *:2 imm16; }
|
||||
|
||||
RelAddr8: loc is simm8 [ loc = inst_next + simm8; ] { export *:1 loc; }
|
||||
|
||||
cc: "NZ" is bits3_3=0x0 { c:1 = ($(Z_flag) == 0); export c; }
|
||||
cc: "Z" is bits3_3=0x1 { c:1 = $(Z_flag); export c; }
|
||||
cc: "NC" is bits3_3=0x2 { c:1 = ($(C_flag) == 0); export c; }
|
||||
cc: "C" is bits3_3=0x3 { c:1 = $(C_flag); export c; }
|
||||
cc: "PO" is bits3_3=0x4 { c:1 = ($(PV_flag) == 0); export c; }
|
||||
cc: "PE" is bits3_3=0x5 { c:1 = $(PV_flag); export c; }
|
||||
cc: "P" is bits3_3=0x6 { c:1 = ($(S_flag) == 0); export c; }
|
||||
cc: "M" is bits3_3=0x7 { c:1 = $(S_flag); export c; }
|
||||
|
||||
cc2: "NZ" is bits3_3=0x4 { c:1 = ($(Z_flag) == 0); export c; }
|
||||
cc2: "Z" is bits3_3=0x5 { c:1 = $(Z_flag); export c; }
|
||||
cc2: "NC" is bits3_3=0x6 { c:1 = ($(C_flag) == 0); export c; }
|
||||
cc2: "C" is bits3_3=0x7 { c:1 = $(C_flag); export c; }
|
||||
|
||||
################################################################
|
||||
|
||||
|
||||
:LD IX,Mem16 is op0_8=0xdd & IX; op0_8=0x2a; Mem16 {
|
||||
IX = Mem16;
|
||||
}
|
||||
|
||||
:LD IY,Mem16 is op0_8=0xfd & IY; op0_8=0x2a; Mem16 {
|
||||
IY = Mem16;
|
||||
}
|
||||
|
||||
:LD Mem16,HL is op0_8=0x22 & HL; Mem16 {
|
||||
Mem16 = HL;
|
||||
}
|
||||
|
||||
:LD Mem16,dRegPair4_2 is op0_8=0xed; op6_2=0x1 & dRegPair4_2 & bits0_4=0x3; Mem16 {
|
||||
Mem16 = dRegPair4_2;
|
||||
}
|
||||
|
||||
:LD Mem16,IX is op0_8=0xdd & IX; op0_8=0x22; Mem16 {
|
||||
Mem16 = IX;
|
||||
}
|
||||
|
||||
:LD Mem16,IY is op0_8=0xfd & IY; op0_8=0x22; Mem16 {
|
||||
Mem16 = IY;
|
||||
}
|
||||
|
||||
:NEG is op0_8=0xed; op0_8=0x44 {
|
||||
$(PV_flag) = (A == 0x80);
|
||||
$(C_flag) = (A != 0);
|
||||
A = -A;
|
||||
setResultFlags(A);
|
||||
}
|
||||
|
||||
:SET bits3_3,ixMem8 is op0_8=0xdd; op0_8=0xcb; ixMem8; op6_2=0x3 & bits3_3 & bits0_3=0x6 {
|
||||
mask:1 = (1 << bits3_3);
|
||||
val:1 = ixMem8;
|
||||
ixMem8 = val | mask;
|
||||
}
|
||||
|
||||
:SET bits3_3,iyMem8 is op0_8=0xfd; op0_8=0xcb; iyMem8; op6_2=0x3 & bits3_3 & bits0_3=0x6 {
|
||||
mask:1 = (1 << bits3_3);
|
||||
val:1 = iyMem8;
|
||||
iyMem8 = val | mask;
|
||||
}
|
||||
|
||||
:JP Addr16 is op0_8=0xc3; Addr16 {
|
||||
goto Addr16;
|
||||
}
|
||||
|
||||
:JP cc,Addr16 is op6_2=0x3 & cc & bits0_3=0x2; Addr16 {
|
||||
if (!cc) goto Addr16;
|
||||
}
|
||||
|
||||
:JR RelAddr8 is op0_8=0x18; RelAddr8 {
|
||||
goto RelAddr8;
|
||||
}
|
||||
|
||||
:JR cc2,RelAddr8 is op6_2=0x0 & cc2 & bits0_3=0x0; RelAddr8 {
|
||||
if (cc2) goto RelAddr8;
|
||||
}
|
||||
|
||||
:JP (HL) is op0_8=0xe9 & HL {
|
||||
goto [HL];
|
||||
}
|
||||
|
||||
:JP (IX) is op0_8=0xdd & IX; op0_8=0xe9 {
|
||||
goto [IX];
|
||||
}
|
||||
|
||||
:JP (IY) is op0_8=0xfd & IY; op0_8=0xe9 {
|
||||
goto [IY];
|
||||
}
|
||||
|
||||
:CALL Addr16 is op0_8=0xcd; Addr16 {
|
||||
push16(&:2 inst_next);
|
||||
call Addr16;
|
||||
}
|
||||
|
||||
:CALL cc,Addr16 is op6_2=0x3 & cc & bits0_3=0x4; Addr16 {
|
||||
if (!cc) goto inst_next;
|
||||
push16(&:2 inst_next);
|
||||
call Addr16;
|
||||
}
|
||||
|
||||
:RET is op0_8=0xc9 {
|
||||
pop16(PC);
|
||||
ptr:2 = zext(PC);
|
||||
return [ptr];
|
||||
}
|
||||
|
||||
:RET cc is op6_2=0x3 & cc & bits0_3=0x0 {
|
||||
if (!cc) goto inst_next;
|
||||
pop16(PC);
|
||||
ptr:2 = zext(PC);
|
||||
return [ptr];
|
||||
}
|
39
03-Average1/A1-vscode/data/languages/skel.slaspec
Executable file
39
03-Average1/A1-vscode/data/languages/skel.slaspec
Executable file
@ -0,0 +1,39 @@
|
||||
# sleigh specification file for Skeleton Processor
|
||||
# >> see docs/languages/sleigh.htm or sleigh.pdf for Sleigh syntax
|
||||
# Other language modules (see Ghidra/Processors) may provide better examples
|
||||
# when creating a new language module.
|
||||
|
||||
define endian=little;
|
||||
define alignment=1;
|
||||
|
||||
define space ram type=ram_space size=2 default;
|
||||
|
||||
define space io type=ram_space size=2;
|
||||
define space register type=register_space size=1;
|
||||
|
||||
define register offset=0x00 size=1 [ F A C B E D L H I R ];
|
||||
define register offset=0x00 size=2 [ AF BC DE HL ];
|
||||
define register offset=0x20 size=1 [ A_ F_ B_ C_ D_ E_ H_ L_ ]; # Alternate registers
|
||||
define register offset=0x20 size=2 [ AF_ BC_ DE_ HL_ ]; # Alternate registers
|
||||
|
||||
define register offset=0x40 size=2 [ _ PC SP IX IY ];
|
||||
|
||||
define register offset=0x50 size=1 [ rCBAR rCBR rBBR ];
|
||||
|
||||
# Define context bits (if defined, size must be multiple of 4-bytes)
|
||||
define register offset=0xf0 size=4 contextreg;
|
||||
|
||||
define context contextreg
|
||||
assume8bitIOSpace = (0,0)
|
||||
;
|
||||
|
||||
# Flag bits (?? manual is very confusing - could be typos!)
|
||||
@define C_flag "F[0,1]" # C: Carry
|
||||
@define N_flag "F[1,1]" # N: Add/Subtract
|
||||
@define PV_flag "F[2,1]" # PV: Parity/Overflow
|
||||
@define H_flag "F[4,1]" # H: Half Carry
|
||||
@define Z_flag "F[6,1]" # Z: Zero
|
||||
@define S_flag "F[7,1]" # S: Sign
|
||||
|
||||
# Include contents of skel.sinc file
|
||||
@include "skel.sinc"
|
6
03-Average1/A1-vscode/data/sleighArgs.txt
Executable file
6
03-Average1/A1-vscode/data/sleighArgs.txt
Executable file
@ -0,0 +1,6 @@
|
||||
# Add sleigh compiler options to this file (one per line) which will
|
||||
# be used when compiling each language within this module.
|
||||
# All options should start with a '-' character.
|
||||
#
|
||||
# IMPORTANT: The -a option should NOT be specified
|
||||
#
|
5
03-Average1/A1-vscode/extension.properties
Executable file
5
03-Average1/A1-vscode/extension.properties
Executable file
@ -0,0 +1,5 @@
|
||||
name=@extname@
|
||||
description=The extension description can be customized by editing the extension.properties file.
|
||||
author=
|
||||
createdOn=
|
||||
version=@extversion@
|
1
03-Average1/A1-vscode/ghidra_scripts/README.txt
Executable file
1
03-Average1/A1-vscode/ghidra_scripts/README.txt
Executable file
@ -0,0 +1 @@
|
||||
Java source directory to hold module-specific Ghidra scripts.
|
11
03-Average1/A1-vscode/ghidra_scripts/SampleScript.java
Normal file
11
03-Average1/A1-vscode/ghidra_scripts/SampleScript.java
Normal file
@ -0,0 +1,11 @@
|
||||
// Sample Java GhidraScript
|
||||
// @category Examples
|
||||
import ghidra.app.script.GhidraScript;
|
||||
|
||||
public class SampleScript extends GhidraScript {
|
||||
|
||||
@Override
|
||||
protected void run() throws Exception {
|
||||
println("Sample script!");
|
||||
}
|
||||
}
|
8
03-Average1/A1-vscode/ghidra_scripts/sample_script.py
Normal file
8
03-Average1/A1-vscode/ghidra_scripts/sample_script.py
Normal file
@ -0,0 +1,8 @@
|
||||
# Sample PyGhidra GhidraScript
|
||||
# @category Examples
|
||||
# @runtime PyGhidra
|
||||
|
||||
from java.util import LinkedList
|
||||
java_list = LinkedList([1,2,3])
|
||||
|
||||
block = currentProgram.memory.getBlock('.text')
|
3
03-Average1/A1-vscode/lib/README.txt
Executable file
3
03-Average1/A1-vscode/lib/README.txt
Executable file
@ -0,0 +1,3 @@
|
||||
The "lib" directory is intended to hold Jar files which this module is dependent upon. Jar files
|
||||
may be placed in this directory manually, or automatically by maven via the dependencies block
|
||||
of this module's build.gradle file.
|
3
03-Average1/A1-vscode/os/linux_x86_64/README.txt
Executable file
3
03-Average1/A1-vscode/os/linux_x86_64/README.txt
Executable file
@ -0,0 +1,3 @@
|
||||
The "os/linux_x86_64" directory is intended to hold Linux native binaries
|
||||
which this module is dependent upon. This directory may be eliminated for a specific
|
||||
module if native binaries are not provided for the corresponding platform.
|
3
03-Average1/A1-vscode/os/mac_x86_64/README.txt
Executable file
3
03-Average1/A1-vscode/os/mac_x86_64/README.txt
Executable file
@ -0,0 +1,3 @@
|
||||
The "os/mac_x86_64" directory is intended to hold macOS (OS X) native binaries
|
||||
which this module is dependent upon. This directory may be eliminated for a specific
|
||||
module if native binaries are not provided for the corresponding platform.
|
3
03-Average1/A1-vscode/os/win_x86_64/README.txt
Executable file
3
03-Average1/A1-vscode/os/win_x86_64/README.txt
Executable file
@ -0,0 +1,3 @@
|
||||
The "os/win_x86_64" directory is intended to hold MS Windows native binaries (.exe)
|
||||
which this module is dependent upon. This directory may be eliminated for a specific
|
||||
module if native binaries are not provided for the corresponding platform.
|
57
03-Average1/A1-vscode/src/main/help/help/TOC_Source.xml
Executable file
57
03-Average1/A1-vscode/src/main/help/help/TOC_Source.xml
Executable file
@ -0,0 +1,57 @@
|
||||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<!--
|
||||
|
||||
This is an XML file intended to be parsed by the Ghidra help system. It is loosely based
|
||||
upon the JavaHelp table of contents document format. The Ghidra help system uses a
|
||||
TOC_Source.xml file to allow a module with help to define how its contents appear in the
|
||||
Ghidra help viewer's table of contents. The main document (in the Base module)
|
||||
defines a basic structure for the
|
||||
Ghidra table of contents system. Other TOC_Source.xml files may use this structure to insert
|
||||
their files directly into this structure (and optionally define a substructure).
|
||||
|
||||
|
||||
In this document, a tag can be either a <tocdef> or a <tocref>. The former is a definition
|
||||
of an XML item that may have a link and may contain other <tocdef> and <tocref> children.
|
||||
<tocdef> items may be referred to in other documents by using a <tocref> tag with the
|
||||
appropriate id attribute value. Using these two tags allows any module to define a place
|
||||
in the table of contents system (<tocdef>), which also provides a place for
|
||||
other TOC_Source.xml files to insert content (<tocref>).
|
||||
|
||||
During the help build time, all TOC_Source.xml files will be parsed and validated to ensure
|
||||
that all <tocref> tags point to valid <tocdef> tags. From these files will be generated
|
||||
<module name>_TOC.xml files, which are table of contents files written in the format
|
||||
desired by the JavaHelp system. Additionally, the genated files will be merged together
|
||||
as they are loaded by the JavaHelp system. In the end, when displaying help in the Ghidra
|
||||
help GUI, there will be on table of contents that has been created from the definitions in
|
||||
all of the modules' TOC_Source.xml files.
|
||||
|
||||
|
||||
Tags and Attributes
|
||||
|
||||
<tocdef>
|
||||
-id - the name of the definition (this must be unique across all TOC_Source.xml files)
|
||||
-text - the display text of the node, as seen in the help GUI
|
||||
-target** - the file to display when the node is clicked in the GUI
|
||||
-sortgroup - this is a string that defines where a given node should appear under a given
|
||||
parent. The string values will be sorted by the JavaHelp system using
|
||||
a javax.text.RulesBasedCollator. If this attribute is not specified, then
|
||||
the text of attribute will be used.
|
||||
|
||||
<tocref>
|
||||
-id - The id of the <tocdef> that this reference points to
|
||||
|
||||
**The URL for the target is relative and should start with 'help/topics'. This text is
|
||||
used by the Ghidra help system to provide a universal starting point for all links so that
|
||||
they can be resolved at runtime, across modules.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<tocroot>
|
||||
<!-- Uncomment and adjust fields to add help topic to help system's Table of Contents
|
||||
<tocref id="Ghidra Functionality">
|
||||
<tocdef id="HelpAnchor" text="My Feature" target="help/topics/my_topic/help.html" />
|
||||
</tocref>
|
||||
-->
|
||||
</tocroot>
|
23
03-Average1/A1-vscode/src/main/help/help/topics/skeleton/help.html
Executable file
23
03-Average1/A1-vscode/src/main/help/help/topics/skeleton/help.html
Executable file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META name="generator" content=
|
||||
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">
|
||||
<META http-equiv="Content-Language" content="en-us">
|
||||
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
<META name="GENERATOR" content="Microsoft FrontPage 4.0">
|
||||
<META name="ProgId" content="FrontPage.Editor.Document">
|
||||
|
||||
<TITLE>Skeleton Help File for a Module</TITLE>
|
||||
<LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
<H1><a name="HelpAnchor"></a>Skeleton Help File for a Module</H1>
|
||||
|
||||
<P>This is a simple skeleton help topic. For a better description of what should and should not
|
||||
go in here, see the "sample" Ghidra extension in the Extensions/Ghidra directory, or see your
|
||||
favorite help topic. In general, language modules do not have their own help topics.</P>
|
||||
</BODY>
|
||||
</HTML>
|
74
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeAnalyzer.java
Executable file
74
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeAnalyzer.java
Executable file
@ -0,0 +1,74 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package a1-vscode;
|
||||
|
||||
import ghidra.app.services.AbstractAnalyzer;
|
||||
import ghidra.app.services.AnalyzerType;
|
||||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.framework.options.Options;
|
||||
import ghidra.program.model.address.AddressSetView;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
* Provide class-level documentation that describes what this analyzer does.
|
||||
*/
|
||||
public class A1-vscodeAnalyzer extends AbstractAnalyzer {
|
||||
|
||||
public A1-vscodeAnalyzer() {
|
||||
|
||||
// Name the analyzer and give it a description.
|
||||
|
||||
super("My Analyzer", "Analyzer description goes here", AnalyzerType.BYTE_ANALYZER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDefaultEnablement(Program program) {
|
||||
|
||||
// Return true if analyzer should be enabled by default
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAnalyze(Program program) {
|
||||
|
||||
// Examine 'program' to determine of this analyzer should analyze it. Return true
|
||||
// if it can.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerOptions(Options options, Program program) {
|
||||
|
||||
// If this analyzer has custom options, register them here
|
||||
|
||||
options.registerOption("Option name goes here", false, null,
|
||||
"Option description goes here");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log)
|
||||
throws CancelledException {
|
||||
|
||||
// Perform analysis when things get added to the 'program'. Return true if the
|
||||
// analysis succeeded.
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
77
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeExporter.java
Executable file
77
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeExporter.java
Executable file
@ -0,0 +1,77 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package a1-vscode;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.*;
|
||||
import ghidra.app.util.exporter.Exporter;
|
||||
import ghidra.app.util.exporter.ExporterException;
|
||||
import ghidra.framework.model.DomainObject;
|
||||
import ghidra.program.model.address.AddressSetView;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
* Provide class-level documentation that describes what this exporter does.
|
||||
*/
|
||||
public class A1-vscodeExporter extends Exporter {
|
||||
|
||||
/**
|
||||
* Exporter constructor.
|
||||
*/
|
||||
public A1-vscodeExporter() {
|
||||
|
||||
// Name the exporter and associate a file extension with it
|
||||
|
||||
super("My Exporter", "exp", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsAddressRestrictedExport() {
|
||||
|
||||
// Return true if addrSet export parameter can be used to restrict export
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean export(File file, DomainObject domainObj, AddressSetView addrSet,
|
||||
TaskMonitor monitor) throws ExporterException, IOException {
|
||||
|
||||
// Perform the export, and return true if it succeeded
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Option> getOptions(DomainObjectService domainObjectService) {
|
||||
List<Option> list = new ArrayList<>();
|
||||
|
||||
// If this exporter has custom options, add them to 'list'
|
||||
list.add(new Option("Option name goes here", "Default option value goes here"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOptions(List<Option> options) throws OptionException {
|
||||
|
||||
// If this exporter has custom options, assign their values to the exporter here
|
||||
}
|
||||
}
|
184
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeFileSystem.java
Executable file
184
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeFileSystem.java
Executable file
@ -0,0 +1,184 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package a1-vscode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.ByteProvider;
|
||||
import ghidra.app.util.bin.ByteProviderWrapper;
|
||||
import ghidra.formats.gfilesystem.*;
|
||||
import ghidra.formats.gfilesystem.annotations.FileSystemInfo;
|
||||
import ghidra.formats.gfilesystem.factory.GFileSystemFactoryByteProvider;
|
||||
import ghidra.formats.gfilesystem.factory.GFileSystemProbeByteProvider;
|
||||
import ghidra.formats.gfilesystem.fileinfo.FileAttributeType;
|
||||
import ghidra.formats.gfilesystem.fileinfo.FileAttributes;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
* Provide class-level documentation that describes what this file system does.
|
||||
*/
|
||||
@FileSystemInfo(type = "fstypegoeshere", // ([a-z0-9]+ only)
|
||||
description = "File system description goes here", factory = A1-vscodeFileSystem.MyFileSystemFactory.class)
|
||||
public class A1-vscodeFileSystem implements GFileSystem {
|
||||
|
||||
private final FSRLRoot fsFSRL;
|
||||
private FileSystemIndexHelper<MyMetadata> fsih;
|
||||
private FileSystemRefManager refManager = new FileSystemRefManager(this);
|
||||
|
||||
private ByteProvider provider;
|
||||
|
||||
/**
|
||||
* File system constructor.
|
||||
*
|
||||
* @param fsFSRL The root {@link FSRL} of the file system.
|
||||
* @param provider The file system provider.
|
||||
*/
|
||||
public A1-vscodeFileSystem(FSRLRoot fsFSRL, ByteProvider provider) {
|
||||
this.fsFSRL = fsFSRL;
|
||||
this.provider = provider;
|
||||
this.fsih = new FileSystemIndexHelper<>(this, fsFSRL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mounts (opens) the file system.
|
||||
*
|
||||
* @param monitor A cancellable task monitor.
|
||||
*/
|
||||
public void mount(TaskMonitor monitor) {
|
||||
monitor.setMessage("Opening " + A1-vscodeFileSystem.class.getSimpleName() + "...");
|
||||
|
||||
// Customize how things in the file system are stored. The following should be
|
||||
// treated as pseudo-code.
|
||||
for (MyMetadata metadata : new MyMetadata[10]) {
|
||||
if (monitor.isCancelled()) {
|
||||
break;
|
||||
}
|
||||
fsih.storeFile(metadata.path, fsih.getFileCount(), false, metadata.size, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
refManager.onClose();
|
||||
if (provider != null) {
|
||||
provider.close();
|
||||
provider = null;
|
||||
}
|
||||
fsih.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return fsFSRL.getContainer().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FSRLRoot getFSRL() {
|
||||
return fsFSRL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return provider == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFileCount() {
|
||||
return fsih.getFileCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileSystemRefManager getRefManager() {
|
||||
return refManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GFile lookup(String path) throws IOException {
|
||||
return fsih.lookup(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GFile lookup(String path, Comparator<String> nameComp) throws IOException {
|
||||
return fsih.lookup(null, path, nameComp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteProvider getByteProvider(GFile file, TaskMonitor monitor)
|
||||
throws IOException, CancelledException {
|
||||
|
||||
// Get an ByteProvider for a file. The following is an example of how the metadata
|
||||
// might be used to get an sub-ByteProvider from a stored provider offset.
|
||||
MyMetadata metadata = fsih.getMetadata(file);
|
||||
return (metadata != null)
|
||||
? new ByteProviderWrapper(provider, metadata.offset, metadata.size, file.getFSRL())
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GFile> getListing(GFile directory) throws IOException {
|
||||
return fsih.getListing(directory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileAttributes getFileAttributes(GFile file, TaskMonitor monitor) {
|
||||
MyMetadata metadata = fsih.getMetadata(file);
|
||||
FileAttributes result = new FileAttributes();
|
||||
if (metadata != null) {
|
||||
result.add(FileAttributeType.NAME_ATTR, metadata.name);
|
||||
result.add(FileAttributeType.SIZE_ATTR, metadata.size);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Customize for the real file system.
|
||||
public static class MyFileSystemFactory
|
||||
implements GFileSystemFactoryByteProvider<A1-vscodeFileSystem>,
|
||||
GFileSystemProbeByteProvider {
|
||||
|
||||
@Override
|
||||
public A1-vscodeFileSystem create(FSRLRoot targetFSRL,
|
||||
ByteProvider byteProvider, FileSystemService fsService, TaskMonitor monitor)
|
||||
throws IOException, CancelledException {
|
||||
|
||||
A1-vscodeFileSystem fs = new A1-vscodeFileSystem(targetFSRL, byteProvider);
|
||||
fs.mount(monitor);
|
||||
return fs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean probe(ByteProvider byteProvider, FileSystemService fsService,
|
||||
TaskMonitor monitor) throws IOException, CancelledException {
|
||||
|
||||
// Quickly and efficiently examine the bytes in 'byteProvider' to determine if
|
||||
// it's a valid file system. If it is, return true.
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Customize with metadata from files in the real file system. This is just a stub.
|
||||
// The elements of the file system will most likely be modeled by Java classes external to this
|
||||
// file.
|
||||
private static class MyMetadata {
|
||||
private String name;
|
||||
private String path;
|
||||
private long offset;
|
||||
private long size;
|
||||
}
|
||||
}
|
82
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeLoader.java
Executable file
82
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodeLoader.java
Executable file
@ -0,0 +1,82 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package a1-vscode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import ghidra.app.util.Option;
|
||||
import ghidra.app.util.bin.ByteProvider;
|
||||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.app.util.opinion.AbstractProgramWrapperLoader;
|
||||
import ghidra.app.util.opinion.LoadSpec;
|
||||
import ghidra.framework.model.DomainObject;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
* Provide class-level documentation that describes what this loader does.
|
||||
*/
|
||||
public class A1-vscodeLoader extends AbstractProgramWrapperLoader {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
// Name the loader. This name must match the name of the loader in the .opinion files.
|
||||
|
||||
return "My loader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<LoadSpec> findSupportedLoadSpecs(ByteProvider provider) throws IOException {
|
||||
List<LoadSpec> loadSpecs = new ArrayList<>();
|
||||
|
||||
// Examine the bytes in 'provider' to determine if this loader can load it. If it
|
||||
// can load it, return the appropriate load specifications.
|
||||
|
||||
return loadSpecs;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options,
|
||||
Program program, TaskMonitor monitor, MessageLog log)
|
||||
throws CancelledException, IOException {
|
||||
|
||||
// Load the bytes from 'provider' into the 'program'.
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec,
|
||||
DomainObject domainObject, boolean isLoadIntoProgram) {
|
||||
List<Option> list =
|
||||
super.getDefaultOptions(provider, loadSpec, domainObject, isLoadIntoProgram);
|
||||
|
||||
// If this loader has custom options, add them to 'list'
|
||||
list.add(new Option("Option name goes here", "Default option value goes here"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateOptions(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program) {
|
||||
|
||||
// If this loader has custom options, validate them here. Not all options require
|
||||
// validation.
|
||||
|
||||
return super.validateOptions(provider, loadSpec, options, program);
|
||||
}
|
||||
}
|
116
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodePlugin.java
Executable file
116
03-Average1/A1-vscode/src/main/java/a1-vscode/A1-vscodePlugin.java
Executable file
@ -0,0 +1,116 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package a1-vscode;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToolBarData;
|
||||
import ghidra.app.ExamplesPluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.ProgramPlugin;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import resources.Icons;
|
||||
|
||||
/**
|
||||
* Provide class-level documentation that describes what this plugin does.
|
||||
*/
|
||||
//@formatter:off
|
||||
@PluginInfo(
|
||||
status = PluginStatus.STABLE,
|
||||
packageName = ExamplesPluginPackage.NAME,
|
||||
category = PluginCategoryNames.EXAMPLES,
|
||||
shortDescription = "Plugin short description goes here.",
|
||||
description = "Plugin long description goes here."
|
||||
)
|
||||
//@formatter:on
|
||||
public class A1-vscodePlugin extends ProgramPlugin {
|
||||
|
||||
MyProvider provider;
|
||||
|
||||
/**
|
||||
* Plugin constructor.
|
||||
*
|
||||
* @param tool The plugin tool that this plugin is added to.
|
||||
*/
|
||||
public A1-vscodePlugin(PluginTool tool) {
|
||||
super(tool);
|
||||
|
||||
// Customize provider (or remove if a provider is not desired)
|
||||
String pluginName = getName();
|
||||
provider = new MyProvider(this, pluginName);
|
||||
|
||||
// Customize help (or remove if help is not desired)
|
||||
String topicName = this.getClass().getPackage().getName();
|
||||
String anchorName = "HelpAnchor";
|
||||
provider.setHelpLocation(new HelpLocation(topicName, anchorName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
// Acquire services if necessary
|
||||
}
|
||||
|
||||
// If provider is desired, it is recommended to move it to its own file
|
||||
private static class MyProvider extends ComponentProvider {
|
||||
|
||||
private JPanel panel;
|
||||
private DockingAction action;
|
||||
|
||||
public MyProvider(Plugin plugin, String owner) {
|
||||
super(plugin.getTool(), "A1-vscode Provider", owner);
|
||||
buildPanel();
|
||||
createActions();
|
||||
}
|
||||
|
||||
// Customize GUI
|
||||
private void buildPanel() {
|
||||
panel = new JPanel(new BorderLayout());
|
||||
JTextArea textArea = new JTextArea(5, 25);
|
||||
textArea.setEditable(false);
|
||||
panel.add(new JScrollPane(textArea));
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
// Customize actions
|
||||
private void createActions() {
|
||||
action = new DockingAction("My Action", getOwner()) {
|
||||
@Override
|
||||
public void actionPerformed(ActionContext context) {
|
||||
Msg.showInfo(getClass(), panel, "Custom Action", "Hello!");
|
||||
}
|
||||
};
|
||||
action.setToolBarData(new ToolBarData(Icons.ADD_ICON, null));
|
||||
action.setEnabled(true);
|
||||
action.markHelpUnnecessary();
|
||||
dockingTool.addLocalAction(this, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
}
|
2
03-Average1/A1-vscode/src/main/resources/images/README.txt
Executable file
2
03-Average1/A1-vscode/src/main/resources/images/README.txt
Executable file
@ -0,0 +1,2 @@
|
||||
The "src/resources/images" directory is intended to hold all image/icon files used by
|
||||
this module.
|
22
03-Average1/A1.txt
Normal file
22
03-Average1/A1.txt
Normal file
@ -0,0 +1,22 @@
|
||||
1. What is the programming language used to write this program?
|
||||
Rust
|
||||
|
||||
2. What is the algorithm used to check the validity of a password?
|
||||
|
||||
3. Can you break this password checker, i.e., implementing a generator of valid passwords? You must send1 16 different valid passwords by email to pascal+sre25@mod-p.ch before Mar. 24th, 2025, 12h00 CET to validate this lab and get 10 points.
|
||||
remipasswohn
|
||||
remipasswepg
|
||||
remipasswpwg
|
||||
remipasswad0
|
||||
remipasswtga
|
||||
remipassweMf
|
||||
remipasswsev
|
||||
remipasswnGl
|
||||
remipassw862
|
||||
remipasswtgs
|
||||
remipasswOed
|
||||
remipassw6sg
|
||||
remipasswdOe
|
||||
remipasswgta
|
||||
remipasswNlg
|
||||
remipasswGdm
|
7
03-Average1/HelloRust/Cargo.lock
generated
Normal file
7
03-Average1/HelloRust/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "HelloRust"
|
||||
version = "0.1.0"
|
4
03-Average1/HelloRust/Cargo.toml
Normal file
4
03-Average1/HelloRust/Cargo.toml
Normal file
@ -0,0 +1,4 @@
|
||||
[package]
|
||||
name = "HelloRust"
|
||||
version = "0.1.0"
|
||||
authors = ["Rémi Heredero <remi@heredero.ch>"]
|
3
03-Average1/HelloRust/src/main.rs
Normal file
3
03-Average1/HelloRust/src/main.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello World!");
|
||||
}
|
1
03-Average1/HelloRust/target/.rustc_info.json
Normal file
1
03-Average1/HelloRust/target/.rustc_info.json
Normal file
@ -0,0 +1 @@
|
||||
{"rustc_fingerprint":1915322691296562077,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/remi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.83.0 (90b35a623 2024-11-26)\nbinary: rustc\ncommit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\ncommit-date: 2024-11-26\nhost: x86_64-unknown-linux-gnu\nrelease: 1.83.0\nLLVM version: 19.1.1\n","stderr":""},"14371922958718593042":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/remi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
|
3
03-Average1/HelloRust/target/CACHEDIR.TAG
Normal file
3
03-Average1/HelloRust/target/CACHEDIR.TAG
Normal file
@ -0,0 +1,3 @@
|
||||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
0
03-Average1/HelloRust/target/debug/.cargo-lock
Normal file
0
03-Average1/HelloRust/target/debug/.cargo-lock
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
||||
9f1d6244274f8d37
|
@ -0,0 +1 @@
|
||||
{"rustc":11594289678289209806,"features":"[]","declared_features":"[]","target":12926390548556111244,"profile":11983525691607113661,"path":10602529704205407992,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/HelloRust-4606ee5058f9e07c/dep-test-bin-HelloRust","checksum":false}}],"rustflags":[],"metadata":7030489489977606076,"config":2202906307356721367,"compile_kind":0}
|
@ -0,0 +1 @@
|
||||
224b9d48e59a6e9f
|
@ -0,0 +1 @@
|
||||
{"rustc":11594289678289209806,"features":"[]","declared_features":"[]","target":12926390548556111244,"profile":5601947868832436996,"path":10602529704205407992,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/HelloRust-781492c6dfff71a9/dep-bin-HelloRust","checksum":false}}],"rustflags":[],"metadata":7030489489977606076,"config":2202906307356721367,"compile_kind":0}
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
||||
4314b46acf402cb2
|
@ -0,0 +1 @@
|
||||
{"rustc":11594289678289209806,"features":"[]","declared_features":"[]","target":12926390548556111244,"profile":11597332650809196192,"path":10602529704205407992,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/HelloRust-dbf85e7dab9689f1/dep-bin-HelloRust","checksum":false}}],"rustflags":[],"metadata":7030489489977606076,"config":2202906307356721367,"compile_kind":0}
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
BIN
03-Average1/HelloRust/target/debug/HelloRust
Executable file
BIN
03-Average1/HelloRust/target/debug/HelloRust
Executable file
Binary file not shown.
1
03-Average1/HelloRust/target/debug/HelloRust.d
Normal file
1
03-Average1/HelloRust/target/debug/HelloRust.d
Normal file
@ -0,0 +1 @@
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/HelloRust: /home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/src/main.rs
|
@ -0,0 +1,5 @@
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/libHelloRust-4606ee5058f9e07c.rmeta: src/main.rs
|
||||
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/HelloRust-4606ee5058f9e07c.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
@ -0,0 +1,5 @@
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/libHelloRust-781492c6dfff71a9.rmeta: src/main.rs
|
||||
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/HelloRust-781492c6dfff71a9.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
BIN
03-Average1/HelloRust/target/debug/deps/HelloRust-dbf85e7dab9689f1
Executable file
BIN
03-Average1/HelloRust/target/debug/deps/HelloRust-dbf85e7dab9689f1
Executable file
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/HelloRust-dbf85e7dab9689f1: src/main.rs
|
||||
|
||||
/home/remi/GIT/00-MSE/02-SRE/03-Average1/HelloRust/target/debug/deps/HelloRust-dbf85e7dab9689f1.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
248
03-Average1/code.c
Normal file
248
03-Average1/code.c
Normal file
@ -0,0 +1,248 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
char* STR_CONGR = "Congratulations ! A right password is indeed";
|
||||
char** PTR_STR_CONGR = &STR_CONGR;
|
||||
|
||||
char* STR_WRONG = "Wrong password ! Try again...";
|
||||
char** PTR_STR_WRONG = &STR_WRONG;
|
||||
|
||||
char* STR_WHAT = "What I need is 1024 passwords passing the check";
|
||||
char** PTR_STR_WHAT = &STR_WHAT;
|
||||
|
||||
char* STR_USAGE = "Usage: <password>";
|
||||
char** PTR_STR_USAGE = &STR_USAGE;
|
||||
|
||||
char* STR_CHALLENGE = "MSE-SRE Challenge A1 --- Enjoy !";
|
||||
char** PTR_STR_CHALLENGE = &STR_CHALLENGE;
|
||||
|
||||
uint8_t DAT_00154450[24];
|
||||
|
||||
void FUN_00107c80(void);
|
||||
long FUN_00122620(void* param_1,uint8_t* param_2,long param_3,char** param_4,uint8_t param_5)
|
||||
|
||||
uint64_t main(int param_1, char** param_2) {
|
||||
void* local_8 = FUN_00107c80;
|
||||
return FUN_00122620(&local_8, DAT_00154450, (long)param_1, param_2,0);
|
||||
}
|
||||
|
||||
void FUN_00107c80(void) {
|
||||
uint8_t bVar1;
|
||||
uint8_t bVar2;
|
||||
uint8_t bVar3;
|
||||
undefined1 auVar4 [16];
|
||||
long lVar5;
|
||||
ulong uVar6;
|
||||
long *plVar7;
|
||||
int iVar8;
|
||||
undefined1 *puVar9;
|
||||
uint8_t *pbVar10;
|
||||
uint8_t *pbVar11;
|
||||
undefined8 uVar12;
|
||||
long lVar13;
|
||||
long *plVar14;
|
||||
undefined8 *puVar15;
|
||||
char** tmp_string;
|
||||
undefined8 uStack_e0;
|
||||
long **local_d8;
|
||||
long lStack_d0;
|
||||
undefined8 uStack_c8;
|
||||
code *local_b0;
|
||||
undefined4 local_a8;
|
||||
undefined4 uStack_a4;
|
||||
undefined4 uStack_a0;
|
||||
undefined4 uStack_9c;
|
||||
uint8_t *local_98;
|
||||
undefined8 local_90;
|
||||
undefined8 uStack_88;
|
||||
uint8_t *local_80;
|
||||
long *local_78;
|
||||
code *local_70;
|
||||
long local_68;
|
||||
undefined4 local_60;
|
||||
undefined4 uStack_5c;
|
||||
undefined4 uStack_58;
|
||||
undefined4 uStack_54;
|
||||
long local_50;
|
||||
long lStack_48;
|
||||
ulong local_40;
|
||||
ulong local_38;
|
||||
|
||||
FUN_001234c0(&local_60);
|
||||
/* try { // try from 00107ca2 to 00107cb5 has its CatchHandler @ 001082b2 */
|
||||
FUN_00123700(&local_78,&local_60);
|
||||
plVar14 = local_78;
|
||||
local_b0 = local_70;
|
||||
/* try { // try from 00107d68 to 00107d7a has its CatchHandler @ 001082ca */
|
||||
FUN_001237e0(&tmp_string,&local_60);
|
||||
pbVar11 = (uint8_t *)0xffffffffffffffff; // 0x ff ff ff ff ff ff ff ff
|
||||
if ((uint8_t *)((long)tmp_string + 1) != (uint8_t *)0x0) {
|
||||
pbVar11 = (uint8_t *)((long)tmp_string + 1);
|
||||
}
|
||||
pbVar10 = (uint8_t *)0x4;
|
||||
if ((uint8_t *)0x4 < pbVar11) {
|
||||
pbVar10 = pbVar11;
|
||||
}
|
||||
uVar12 = 0;
|
||||
auVar4._8_8_ = 0;
|
||||
auVar4._0_8_ = pbVar10;
|
||||
uVar6 = SUB168(auVar4 * ZEXT816(0x18),0);
|
||||
if ((SUB168(auVar4 * ZEXT816(0x18),8) == 0) && (uVar6 < 0x7ffffffffffffff9)) {
|
||||
if (uVar6 == 0) {
|
||||
plVar7 = (long *)&DAT_00000008;
|
||||
pbVar10 = (uint8_t *)0x0;
|
||||
} else {
|
||||
uVar12 = 8;
|
||||
plVar7 = (long *)thunk_FUN_00127f80(uVar6,8);
|
||||
if (plVar7 == (long *)0x0) goto LAB_00108291;
|
||||
}
|
||||
*plVar7 = (long)plVar14;
|
||||
plVar7[1] = (long)local_b0;
|
||||
plVar7[2] = local_68;
|
||||
local_80 = &DAT_00000001;
|
||||
local_d8 = (long **)local_50;
|
||||
lStack_d0 = lStack_48;
|
||||
tmp_string = (undefined **)CONCAT44(uStack_5c,local_60);
|
||||
uStack_e0 = CONCAT44(uStack_54,uStack_58);
|
||||
lVar13 = 0x28;
|
||||
local_90 = pbVar10;
|
||||
uStack_88 = plVar7;
|
||||
|
||||
while( true ) {
|
||||
/* try { // try from 00107e9f to 00107eae has its CatchHandler @ 0010832a */
|
||||
pbVar10 = local_80;
|
||||
FUN_00123700(&local_a8,&tmp_string);
|
||||
pbVar11 = local_98;
|
||||
lVar5 = CONCAT44(uStack_a4,local_a8);
|
||||
if (lVar5 == -0x8000000000000000) break;
|
||||
uVar12 = CONCAT44(uStack_9c,uStack_a0);
|
||||
if (pbVar10 == local_90) {
|
||||
/* try { // try from 00107ed4 to 00107f09 has its CatchHandler @ 0010830f */
|
||||
FUN_001237e0(&local_78,&tmp_string);
|
||||
puVar9 = (undefined1 *)((long)local_78 + 1);
|
||||
if (puVar9 == (undefined1 *)0x0) {
|
||||
puVar9 = (undefined1 *)0xffffffffffffffff;
|
||||
}
|
||||
FUN_00106090(&local_90,pbVar10,puVar9);
|
||||
plVar7 = uStack_88;
|
||||
}
|
||||
*(long *)((long)plVar7 + lVar13 + -0x10) = lVar5;
|
||||
*(undefined8 *)((long)plVar7 + lVar13 + -8) = uVar12;
|
||||
*(uint8_t **)((long)plVar7 + lVar13) = pbVar11;
|
||||
local_80 = pbVar10 + 1;
|
||||
lVar13 = lVar13 + 0x18;
|
||||
}
|
||||
|
||||
if (lStack_d0 != uStack_e0) {
|
||||
uVar6 = (ulong)(lStack_d0 - uStack_e0) / 0x18;
|
||||
puVar15 = (undefined8 *)(uStack_e0 + 8);
|
||||
do {
|
||||
if (puVar15[-1] != 0) {
|
||||
thunk_FUN_00127fe0(*puVar15,puVar15[-1],1);
|
||||
}
|
||||
puVar15 = puVar15 + 3;
|
||||
uVar6 = uVar6 - 1;
|
||||
} while (uVar6 != 0);
|
||||
}
|
||||
if (local_d8 != (long **)0x0) {
|
||||
thunk_FUN_00127fe0(tmp_string,(long)local_d8 * 0x18,8);
|
||||
}
|
||||
pbVar11 = local_80;
|
||||
plVar14 = uStack_88;
|
||||
local_a8 = (undefined4)local_90;
|
||||
uStack_a4 = local_90._4_4_;
|
||||
uStack_a0 = (undefined4)uStack_88;
|
||||
uStack_9c = uStack_88._4_4_;
|
||||
local_98 = local_80;
|
||||
if (local_80 == (uint8_t *)0x2) {
|
||||
if (uStack_88[5] == 0xc) {
|
||||
local_90 = (uint8_t *)uStack_88[4];
|
||||
bVar1 = local_90[3];
|
||||
local_38 = (ulong)bVar1;
|
||||
bVar2 = local_90[5];
|
||||
local_40 = (ulong)bVar2;
|
||||
bVar3 = local_90[11];
|
||||
local_b0 = (code *)CONCAT71(local_b0._1_7_,bVar3);
|
||||
uStack_88 = (long *)12;
|
||||
iVar8 = (uint)(uint8_t)(local_90[7] ^ local_90[8] ^ local_90[9] ^ local_90[10] ^ local_90[4] ^ bVar2 ^ local_90[6] ^ local_90[2] ^ bVar1 ^ local_90[0] ^ local_90[1] ^ bVar3 ^ 0xd6) +
|
||||
(uint)(uint8_t)((local_90[7] + local_90[8] + local_90[9] + local_90[10] +
|
||||
local_90[4] + bVar2 + local_90[6] +
|
||||
local_90[2] + bVar1 + *local_90 + local_90[1] + bVar3) - 0x3a) * 0x73;
|
||||
if ((char)((char)iVar8 - (char)((uint)(iVar8 * 0x7f81) >> 0x17)) == -0x4b) {
|
||||
local_78 = &local_90;
|
||||
local_70 = FUN_00107a80;
|
||||
tmp_string = &PTR_STR_CONGR; // Congratulations ! A right password is indeed
|
||||
uStack_e0 = 2;
|
||||
uStack_c8 = 0;
|
||||
local_d8 = &local_78;
|
||||
lStack_d0 = 1;
|
||||
/* try { // try from 001080f5 to 00108228 has its CatchHandler @ 001082fa */
|
||||
FUN_00124d60(&tmp_string);
|
||||
} else { // Wrong password
|
||||
tmp_string = &PTR_STR_WRONG; // Wrong password ! Try again...
|
||||
uStack_e0 = 1;
|
||||
local_d8 = (long **)&DAT_00000008;
|
||||
lStack_d0 = 0;
|
||||
uStack_c8 = 0;
|
||||
printf(&tmp_string);
|
||||
}
|
||||
} else { // Wrong password
|
||||
tmp_string = &PTR_STR_WRONG; // Wrong password ! Try again...
|
||||
uStack_e0 = 1;
|
||||
local_d8 = (long **)&DAT_00000008;
|
||||
lStack_d0 = 0;
|
||||
uStack_c8 = 0;
|
||||
printf(&tmp_string);
|
||||
}
|
||||
pbVar11 = (uint8_t *)0x2;
|
||||
} else {
|
||||
tmp_string = &PTR_STR_CHALLENGE; // MSE-SRE Challenge A1 --- Enjoy !
|
||||
uStack_e0 = 1;
|
||||
local_d8 = (long **)0x8;
|
||||
lStack_d0 = 0;
|
||||
uStack_c8 = 0;
|
||||
printf(&tmp_string);
|
||||
tmp_string = &PTR_STR_WHAT; // What I need is 1024 passwords passing the check
|
||||
uStack_e0 = 1;
|
||||
local_d8 = (long **)0x8;
|
||||
lStack_d0 = 0;
|
||||
uStack_c8 = 0;
|
||||
printf(&tmp_string);
|
||||
if (pbVar11 == (uint8_t *)0x0) {
|
||||
/* try { // try from 0010829f to 001082af has its CatchHandler @ 001082fa */
|
||||
/* WARNING: Subroutine does not return */
|
||||
FUN_00107435(0,0,&PTR_DAT_001544d0);
|
||||
}
|
||||
plVar14 = (long *)CONCAT44(uStack_9c,uStack_a0);
|
||||
local_70 = FUN_00107c60;
|
||||
tmp_string = &PTR_STR_USAGE; // Usage: <password>
|
||||
uStack_e0 = 2;
|
||||
uStack_c8 = 0;
|
||||
lStack_d0 = 1;
|
||||
local_d8 = &local_78;
|
||||
local_78 = plVar14;
|
||||
printf(&tmp_string);
|
||||
}
|
||||
plVar7 = plVar14 + 1;
|
||||
do {
|
||||
if (plVar7[-1] != 0) {
|
||||
thunk_FUN_00127fe0(*plVar7,plVar7[-1],1);
|
||||
}
|
||||
plVar7 = plVar7 + 3;
|
||||
pbVar11 = pbVar11 + -1;
|
||||
} while (pbVar11 != (uint8_t *)0x0);
|
||||
if (CONCAT44(uStack_a4,local_a8) != 0) {
|
||||
thunk_FUN_00127fe0(plVar14,CONCAT44(uStack_a4,local_a8) * 0x18,8);
|
||||
}
|
||||
return;
|
||||
}
|
||||
LAB_00108291:
|
||||
/* try { // try from 00108291 to 0010829c has its CatchHandler @ 001082ca */
|
||||
/* WARNING: Subroutine does not return */
|
||||
FUN_001071d7(uVar12,uVar6);
|
||||
}
|
51
03-Average1/code2.c
Normal file
51
03-Average1/code2.c
Normal file
@ -0,0 +1,51 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
bool test(char* input_str) {
|
||||
int iVar8;
|
||||
|
||||
iVar8 = (uint)(uint8_t)(
|
||||
input_str[0] ^
|
||||
input_str[1] ^
|
||||
input_str[2] ^
|
||||
input_str[3] ^
|
||||
input_str[4] ^
|
||||
input_str[5] ^
|
||||
input_str[6] ^
|
||||
input_str[7] ^
|
||||
input_str[8] ^
|
||||
input_str[9] ^
|
||||
input_str[10] ^
|
||||
input_str[11] ^
|
||||
0xd6 // 214
|
||||
) + (uint)(uint8_t)(
|
||||
(
|
||||
input_str[0] +
|
||||
input_str[1] +
|
||||
input_str[2] +
|
||||
input_str[3] +
|
||||
input_str[4] +
|
||||
input_str[5] +
|
||||
input_str[6] +
|
||||
input_str[7] +
|
||||
input_str[8] +
|
||||
input_str[9] +
|
||||
input_str[10] +
|
||||
input_str[11]
|
||||
) - 0x3a // 58 ':'
|
||||
) * 0x73;
|
||||
|
||||
if (
|
||||
(char)(
|
||||
(char)iVar8 - (char)(
|
||||
(uint)(
|
||||
iVar8 * 0x7f81
|
||||
) >> 0x17 // 23
|
||||
)
|
||||
) == -0x4b) { // -75 | -'K' | 18'446'744'073'709'551'541
|
||||
|
||||
}
|
78
03-Average1/genKey.c
Normal file
78
03-Average1/genKey.c
Normal file
@ -0,0 +1,78 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
const uint16_t NBR_PASSWORDS_REQUESTED = 16;
|
||||
|
||||
const char list[] = {
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'/', '+'
|
||||
};
|
||||
char give_char(uint8_t index){
|
||||
if (index >= sizeof(list)) {
|
||||
printf("Error: Index out of bounds, max %zu\n", sizeof(list));
|
||||
exit(1);
|
||||
}
|
||||
return list[index];
|
||||
}
|
||||
|
||||
bool check_pw(char *pw) {
|
||||
int64_t xor = pw[0]^pw[1]^pw[2]^pw[3]^pw[4]^pw[5]^pw[6]^pw[7]^pw[8]^pw[9]^pw[10]^pw[11];
|
||||
int64_t sum = pw[0]+pw[1]+pw[2]+pw[3]+pw[4]+pw[5]+pw[6]+pw[7]+pw[8]+pw[9]+pw[10]+pw[11];
|
||||
int64_t iVar1 = (int64_t)(uint8_t)(xor^0xD6);
|
||||
int64_t iVar2 = (int64_t)(uint8_t)(sum-0x3a);
|
||||
int64_t iVar8 = iVar1 + iVar2 * 0x73;
|
||||
|
||||
int64_t diff = (char)(
|
||||
(char)iVar8 - (char)( (int64_t)(iVar8 * 0x7f81) >> 0x17 )
|
||||
);
|
||||
// printf("XOR: %d\tSUM: %d\n", xor, sum);
|
||||
// printf("iVar1: %d\tiVar2: %d\tiVar8: %d\n", iVar1, iVar2, iVar8);
|
||||
// printf("Diff is: %d\n", diff);
|
||||
if (diff == -0x4b) { // -75 | -'K' | 18'446'744'073'709'551'541
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
srand(time(NULL));
|
||||
|
||||
char password[13];
|
||||
const uint8_t max_char = sizeof(list);
|
||||
|
||||
password[0] = 'r';
|
||||
password[1] = 'e';
|
||||
password[2] = 'm';
|
||||
password[3] = 'i';
|
||||
password[4] = 'p';
|
||||
password[5] = 'a';
|
||||
password[6] = 's';
|
||||
password[7] = 's';
|
||||
password[8] = 'w';
|
||||
|
||||
password[12] = '\0';
|
||||
|
||||
for(uint16_t n = 0; n < NBR_PASSWORDS_REQUESTED; n++) {
|
||||
|
||||
do{
|
||||
password[9] = give_char(rand() % max_char);
|
||||
password[10] = give_char(rand() % max_char);
|
||||
password[11] = give_char(rand() % max_char);
|
||||
}while(!check_pw(password));
|
||||
|
||||
if (check_pw(password)) {
|
||||
printf("%s\n", password);
|
||||
} else {
|
||||
printf("Fuck\n");
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
11
SRE.rep/idata/00/00000000.prp
Normal file
11
SRE.rep/idata/00/00000000.prp
Normal 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="a801f6f84bf5726727918611" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="E4" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
11
SRE.rep/idata/00/00000001.prp
Normal file
11
SRE.rep/idata/00/00000001.prp
Normal 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="a801f6f89b95769364193802" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="A1" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
11
SRE.rep/idata/00/00000002.prp
Normal file
11
SRE.rep/idata/00/00000002.prp
Normal 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="c0a82f6ac5f11262297970056" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="HelloRust" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
11
SRE.rep/idata/00/00000004.prp
Normal file
11
SRE.rep/idata/00/00000004.prp
Normal 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="/E5.apk" />
|
||||
<STATE NAME="FILE_ID" TYPE="string" VALUE="a947c5a05d160355288677079" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="DebugProbesKt.bin" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
11
SRE.rep/idata/00/00000005.prp
Normal file
11
SRE.rep/idata/00/00000005.prp
Normal 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="c0a82678bad57470710627698" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="liba2.so" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
11
SRE.rep/idata/00/00000006.prp
Normal file
11
SRE.rep/idata/00/00000006.prp
Normal 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="a801f56ab658487152928151" />
|
||||
<STATE NAME="FILE_TYPE" TYPE="int" VALUE="0" />
|
||||
<STATE NAME="READ_ONLY" TYPE="boolean" VALUE="false" />
|
||||
<STATE NAME="NAME" TYPE="string" VALUE="A3" />
|
||||
</BASIC_INFO>
|
||||
</FILE_INFO>
|
BIN
SRE.rep/idata/00/~00000000.db/db.2.gbf
Normal file
BIN
SRE.rep/idata/00/~00000000.db/db.2.gbf
Normal file
Binary file not shown.
BIN
SRE.rep/idata/00/~00000001.db/db.3.gbf
Normal file
BIN
SRE.rep/idata/00/~00000001.db/db.3.gbf
Normal file
Binary file not shown.
BIN
SRE.rep/idata/00/~00000002.db/db.1.gbf
Normal file
BIN
SRE.rep/idata/00/~00000002.db/db.1.gbf
Normal file
Binary file not shown.
BIN
SRE.rep/idata/00/~00000004.db/db.2.gbf
Normal file
BIN
SRE.rep/idata/00/~00000004.db/db.2.gbf
Normal file
Binary file not shown.
BIN
SRE.rep/idata/00/~00000005.db/db.2.gbf
Normal file
BIN
SRE.rep/idata/00/~00000005.db/db.2.gbf
Normal file
Binary file not shown.
BIN
SRE.rep/idata/00/~00000006.db/db.1.gbf
Normal file
BIN
SRE.rep/idata/00/~00000006.db/db.1.gbf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user