Cleaned up some trash, renamed project

This commit is contained in:
2025-08-03 20:58:02 +02:00
parent f7d91d55b0
commit cced101379
4 changed files with 72 additions and 234 deletions
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.20 (Windows - x64)">
<section name="config">
<options closefiles="1" openmode="0" name="PB-DllWrapperMaker"/>
</section>
<section name="data">
<explorer view="C:\ProgramData\PureBasic\Examples\" pattern="0"/>
<log show="1"/>
<lastopen date="2025-08-03 16:40" user="Herwin" host="DESKTOP-FND9TQS"/>
</section>
<section name="files"/>
<section name="targets">
<target name="Default Target" enabled="1" default="1">
<inputfile value=""/>
<outputfile value=""/>
<options xpskin="1" dpiaware="1" debug="1" optimizer="0"/>
</target>
</section>
</project>
+72
View File
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.21 (Windows - x64)">
<section name="config">
<options closefiles="1" openmode="0" name="PB-PEArch"/>
</section>
<section name="data">
<explorer view="C:\ProgramData\PureBasic\Examples\" pattern="0"/>
<log show="1"/>
<lastopen date="2025-08-03 20:57" user="Herwin" host="DESKTOP-15GVDJD"/>
</section>
<section name="files">
<file name="Main_PEArch.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="+"/>
<fingerprint md5="0ae927874ebb9b5f278ab868cd2eaad6"/>
</file>
<file name="Includes\ImageNtHeaderHelper.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="++"/>
<fingerprint md5="a5b4cef967764153f8aed5a0ed6474c8"/>
</file>
<file name="Includes\WinApi_GetConsoleProcessList.pbi">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" sortindex="999" panelstate="++"/>
<fingerprint md5="4ac133fc47ad2e720131876fa54f876c"/>
</file>
</section>
<section name="targets">
<target name="PEArch - x64" enabled="1" default="1">
<inputfile value="Main_PEArch.pb"/>
<outputfile value="Build\x64\pearch.exe"/>
<compiler version="PureBasic 5.73 LTS (Windows - x64)"/>
<commandline value="I:\Projects\PureBasic\PB-DllWrapperMaker\PureBasic_Compilation0.exe"/>
<executable value="Build\x64\pearch.exe"/>
<options debug="1" optimizer="1"/>
<temporaryexe value="source"/>
<format exe="console" cpu="0"/>
<compilecount enable="1" value="46"/>
<buildcount enable="1" value="15"/>
<versioninfo enable="1">
<field0 value="1,0,%BUILDCOUNT,%COMPILECOUNT"/>
<field1 value="1,0,%BUILDCOUNT,%COMPILECOUNT"/>
<field2 value="NibblePoker"/>
<field3 value="PEArch"/>
<field4 value="1.0.%BUILDCOUNT"/>
<field5 value="1.0.%BUILDCOUNT"/>
<field7 value="PEArch.exe"/>
<field8 value="pearch.exe"/>
</versioninfo>
</target>
<target name="PEArch - x86" enabled="1" default="0">
<inputfile value="Main_PEArch.pb"/>
<outputfile value="Build\x86\pearch.exe"/>
<compiler version="PureBasic 5.73 LTS (Windows - x86)"/>
<commandline value="I:\Projects\PureBasic\PB-DllWrapperMaker\PureBasic_Compilation0.exe"/>
<executable value="Build\x86\pearch.exe"/>
<options debug="1" optimizer="1"/>
<temporaryexe value="source"/>
<format exe="console" cpu="0"/>
<compilecount enable="1" value="45"/>
<buildcount enable="1" value="14"/>
<versioninfo enable="1">
<field0 value="1,0,%BUILDCOUNT,%COMPILECOUNT"/>
<field1 value="1,0,%BUILDCOUNT,%COMPILECOUNT"/>
<field2 value="NibblePoker"/>
<field3 value="PEArch"/>
<field4 value="1.0.%BUILDCOUNT"/>
<field5 value="1.0.%BUILDCOUNT"/>
<field7 value="PEArch.exe"/>
<field8 value="pearch.exe"/>
</versioninfo>
</target>
</section>
</project>
-105
View File
@@ -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 <DLL> <Output>")
; 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
-109
View File
@@ -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 <DLL> <Output>")
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