From cced101379f40415194d4b05da313d46e8f39449 Mon Sep 17 00:00:00 2001 From: Herwin Bozet Date: Sun, 3 Aug 2025 20:58:02 +0200 Subject: [PATCH] Cleaned up some trash, renamed project --- DllWrapperMaker.pbp | 20 -------- Project_PEarch.pbp | 72 +++++++++++++++++++++++++++++ Trash/Main.pb | 105 ------------------------------------------ Trash/MainOld.pb | 109 -------------------------------------------- 4 files changed, 72 insertions(+), 234 deletions(-) delete mode 100644 DllWrapperMaker.pbp create mode 100644 Project_PEarch.pbp delete mode 100644 Trash/Main.pb delete mode 100644 Trash/MainOld.pb diff --git a/DllWrapperMaker.pbp b/DllWrapperMaker.pbp deleted file mode 100644 index c85d60e..0000000 --- a/DllWrapperMaker.pbp +++ /dev/null @@ -1,20 +0,0 @@ - - - -
- -
-
- - - -
-
-
- - - - - -
- diff --git a/Project_PEarch.pbp b/Project_PEarch.pbp new file mode 100644 index 0000000..8e5b36d --- /dev/null +++ b/Project_PEarch.pbp @@ -0,0 +1,72 @@ + + + +
+ +
+
+ + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/Trash/Main.pb b/Trash/Main.pb deleted file mode 100644 index e2cf44d..0000000 --- a/Trash/Main.pb +++ /dev/null @@ -1,105 +0,0 @@ -;{- Code Header -; ==- Basic Info -================================ -; Name: PB-CTypes.pbi -; Version: 0.0.1 -; Author: Herwin Bozet -; -; ==- Compatibility -============================= -; Compiler version: -; * PureBasic 6.0 LTS -; * PureBasic 6.0 LTS - C Backend -; -; ==- Links & License -=========================== -; License: Unlicense -; GitHub: https://github.com/aziascreations/PB-CTypes -; Private Repo: https://git.nibblepoker.lu/aziascreations/PB-CTypes -;} - - -;- Compiler Directives -EnableExplicit - - -;- Constants -; SEC_IMAGE_NO_EXECUTE -; 0x11000000 -CompilerIf Not Defined(SEC_IMAGE_NO_EXECUTE, #PB_Constant) - #SEC_IMAGE_NO_EXECUTE = $11000000 -CompilerEndIf - - -If Not OpenConsole("DllWrapperMaker") - End 1 -EndIf - -; If CountProgramParameters() <> 2 -; PrintN("DllWrap ") -; EndIf -; -; Define DllPath$ = ProgramParameter() -; Define OutputPath$ = ProgramParameter() - -Define DllPath1$ = "C:\Program Files\7-Zip\7-zip32.dll" -Define DllPath2$ = "C:\Program Files\7-Zip\7-zip.dll" - -; Debug DllPath$ -; Debug OutputPath$ - -Procedure GetImageCpuArch(ImagePath$) - ; Mapping the file into memory - Define InputFileHandle = ReadFile(#PB_Any, ImagePath$) - - If InputFileHandle = 0 - PrintN("Unable to open input file !") - ProcedureReturn - EndIf - - Define InputFileMappingHandle = CreateFileMapping_(FileID(InputFileHandle), #Null, #PAGE_READONLY | #SEC_IMAGE_NO_EXECUTE, 0, 0, #Null) - - If InputFileMappingHandle = #ERROR_ALREADY_EXISTS Or InputFileMappingHandle = 0 - PrintN("Unable to create a file mapping !") - Goto GetImageCpuArch_CloseInputFileHandle - EndIf - - Define InputFileViewPtr.i = MapViewOfFile_(InputFileMappingHandle, #FILE_MAP_READ, 0, 0, 0) - If InputFileViewPtr = #Null - PrintN("Unable to map the input file into memory !") - Goto GetImageCpuArch_CloseInputFileHandle - EndIf - - ; Retrieving the NT headers - Define *RetrievedNtHeaders.IMAGE_NT_HEADERS32 = ImageNtHeader_(InputFileViewPtr) - If *RetrievedNtHeaders = #Null - PrintN("Unable to retrieve the NT headers !") - Goto GetImageCpuArch_UnmapFileView - EndIf - - Debug *RetrievedNtHeaders\FileHeader\ Machine - - ; Do not do this ! - ;FreeMemory(*RetrievedNtHeaders) - - ; Cleaning up - GetImageCpuArch_UnmapFileView: - UnmapViewOfFile_(InputFileViewPtr) - - GetImageCpuArch_CloseInputFileHandle: - CloseFile(InputFileHandle) -EndProcedure - -GetImageCpuArch(DllPath1$) - -GetImageCpuArch(DllPath2$) - -Input() - -; IDE Options = PureBasic 6.21 (Windows - x64) -; CursorPosition = 78 -; FirstLine = 44 -; Folding = - -; EnableXP -; DPIAware -; CommandLine = "C:\Program Files (x86)\PureBasic\Compilers\Engine3D.dll" "./test.pb" -; CompileSourceDirectory -; EnableCompileCount = 21 -; EnableBuildCount = 0 \ No newline at end of file diff --git a/Trash/MainOld.pb b/Trash/MainOld.pb deleted file mode 100644 index 6a799ad..0000000 --- a/Trash/MainOld.pb +++ /dev/null @@ -1,109 +0,0 @@ -;{- Code Header -; ==- Basic Info -================================ -; Name: PB-CTypes.pbi -; Version: 0.0.1 -; Author: Herwin Bozet -; -; ==- Compatibility -============================= -; Compiler version: -; * PureBasic 6.0 LTS -; * PureBasic 6.0 LTS - C Backend -; -; ==- Links & License -=========================== -; License: Unlicense -; GitHub: https://github.com/aziascreations/PB-CTypes -; Private Repo: https://git.nibblepoker.lu/aziascreations/PB-CTypes -;} - - -;- Compiler Directives -EnableExplicit - - -;- Constants -; SEC_IMAGE_NO_EXECUTE -; 0x11000000 -CompilerIf Not Defined(SEC_IMAGE_NO_EXECUTE, #PB_Constant) - #SEC_IMAGE_NO_EXECUTE = $11000000 -CompilerEndIf - - -If Not OpenConsole("DllWrapperMaker") - End 1 -EndIf - -If CountProgramParameters() <> 2 - PrintN("DllWrap ") -EndIf - -Define DllPath$ = ProgramParameter() -Define OutputPath$ = ProgramParameter() - -DllPath$ = "C:\Program Files\7-Zip\7-zip32.dll" -DllPath$ = "C:\Program Files\7-Zip\7-zip.dll" - -; Debug DllPath$ -; Debug OutputPath$ - -Procedure GetImageCpuArch(ImagePath$) - ; Mapping the file into memory - Define InputFileHandle = ReadFile(#PB_Any, ImagePath$) - - If InputFileHandle = 0 - PrintN("Unable to open input file !") - ProcedureReturn - EndIf - - Define InputFileMappingHandle = CreateFileMapping_(FileID(InputFileHandle), #Null, #PAGE_READONLY | #SEC_IMAGE_NO_EXECUTE, 0, 0, #Null) - - If InputFileMappingHandle = #ERROR_ALREADY_EXISTS Or InputFileMappingHandle = 0 - PrintN("Unable to create a file mapping !") - Goto GetImageCpuArch_CloseInputFileHandle - EndIf - - Define InputFileViewPtr.i = MapViewOfFile_(InputFileMappingHandle, #FILE_MAP_READ, 0, 0, 0) - If InputFileViewPtr = #Null - PrintN("Unable to map the input file into memory !") - Goto GetImageCpuArch_CloseInputFileHandle - EndIf - - ; Retrieving the NT headers - Define *RetrievedNtHeaders.IMAGE_NT_HEADERS32 = ImageNtHeader_(InputFileViewPtr) - If *RetrievedNtHeaders = #Null - PrintN("Unable to retrieve the NT headers !") - Goto GetImageCpuArch_UnmapFileView - EndIf - - Debug *RetrievedNtHeaders\FileHeader\ Machine - - ;FreeMemory(*RetrievedNtHeaders) - - ; Cleaning up - GetImageCpuArch_UnmapFileView: - UnmapViewOfFile_(InputFileViewPtr) - - GetImageCpuArch_CloseInputFileHandle: - CloseFile(InputFileHandle) -EndProcedure - - - -GetImageCpuArch(DllPath$) - -GetImageCpuArch(DllPath$) - -GetImageCpuArch(DllPath$) - -GetImageCpuArch(DllPath$) - -Input() - -; IDE Options = PureBasic 6.21 (Windows - x64) -; CursorPosition = 8 -; Folding = - -; EnableXP -; DPIAware -; CommandLine = "C:\Program Files (x86)\PureBasic\Compilers\Engine3D.dll" "./test.pb" -; CompileSourceDirectory -; EnableCompileCount = 20 -; EnableBuildCount = 0 \ No newline at end of file