From f7d91d55b068b42053522c537f972bfbfbaf3ec2 Mon Sep 17 00:00:00 2001 From: Herwin Bozet Date: Sun, 3 Aug 2025 20:55:12 +0200 Subject: [PATCH] Initial commit --- .gitignore | 3 + DllWrapperMaker.pbp | 20 ++ Includes/ImageNtHeaderHelper.pbi | 174 ++++++++++ Includes/WinApi_GetConsoleProcessList.pbi | 35 ++ LICENSE | 24 ++ Libs/0_config.cmd | 7 + Libs/3_make_lib.cmd | 43 +++ Libs/ARM64/kernel32.exp | Bin 0 -> 914 bytes Libs/ARM64/kernel32.lib | Bin 0 -> 1756 bytes Libs/X64/kernel32.exp | Bin 0 -> 914 bytes Libs/X64/kernel32.lib | Bin 0 -> 1756 bytes Libs/X86/kernel32.exp | Bin 0 -> 915 bytes Libs/X86/kernel32.lib | Bin 0 -> 1752 bytes Libs/kernel32.def | 4 + Main_PEArch.pb | 385 ++++++++++++++++++++++ Trash/Main.pb | 105 ++++++ Trash/MainOld.pb | 109 ++++++ readme.md | 9 + 18 files changed, 918 insertions(+) create mode 100644 .gitignore create mode 100644 DllWrapperMaker.pbp create mode 100644 Includes/ImageNtHeaderHelper.pbi create mode 100644 Includes/WinApi_GetConsoleProcessList.pbi create mode 100644 LICENSE create mode 100644 Libs/0_config.cmd create mode 100644 Libs/3_make_lib.cmd create mode 100644 Libs/ARM64/kernel32.exp create mode 100644 Libs/ARM64/kernel32.lib create mode 100644 Libs/X64/kernel32.exp create mode 100644 Libs/X64/kernel32.lib create mode 100644 Libs/X86/kernel32.exp create mode 100644 Libs/X86/kernel32.lib create mode 100644 Libs/kernel32.def create mode 100644 Main_PEArch.pb create mode 100644 Trash/Main.pb create mode 100644 Trash/MainOld.pb create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8ac2d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.dll +*.exe +*.cfg diff --git a/DllWrapperMaker.pbp b/DllWrapperMaker.pbp new file mode 100644 index 0000000..c85d60e --- /dev/null +++ b/DllWrapperMaker.pbp @@ -0,0 +1,20 @@ + + + +
+ +
+
+ + + +
+
+
+ + + + + +
+ diff --git a/Includes/ImageNtHeaderHelper.pbi b/Includes/ImageNtHeaderHelper.pbi new file mode 100644 index 0000000..d4745fd --- /dev/null +++ b/Includes/ImageNtHeaderHelper.pbi @@ -0,0 +1,174 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: ImageNtHeaderHelper.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Compiler version: +; * PureBasic 6.0 LTS +; * PureBasic 6.0 LTS - C Backend +; +; ==- Links & License -=========================== +; License: Unlicense +; GitHub: ??? +;} + + +;- Module declaration +DeclareModule ImageNtHeaderHelper + + Enumeration INHH_ErrorCodes + #INHH_ERROR_None = 0 + #INHH_ERROR_IdAlreadyUsed + #INHH_ERROR_IdNotfound + #INHH_ERROR_CannotOpenFile + #INHH_ERROR_CannotCreateFileMapping + #INHH_ERROR_CannotMapViewOfFile + #INHH_ERROR_CannotRetrieveHeaders + EndEnumeration + + ; Loads the given file into memory, maps a view of it into memory and attempts to retrieve the IMAGE_NT_HEADERS32 structure. + Declare.i GetImageNtHeader32(ImageNtHeaderId.i, FilePath$) + + ; + Declare.i FreeImageNtHeader32(ImageNtHeaderId.i) + + ; + Declare.i GetLastError() + Declare ClearLastError() +EndDeclareModule + + +;- Module definition +Module ImageNtHeaderHelper + EnableExplicit + + CompilerIf Not Defined(SEC_IMAGE_NO_EXECUTE, #PB_Constant) + #SEC_IMAGE_NO_EXECUTE = $11000000 + CompilerEndIf + + Structure OpenImageNtHeader + FileId.i + *ViewAddress + *RetrievedNtHeaders + EndStructure + + Global LastErrorCode.i = 0 + + Global NewMap OpenImageNtHeaders.OpenImageNtHeader() + + + Procedure.i GetImageNtHeader32(ImageNtHeaderId.i, FilePath$) + ; Handling the ID and the map + Define ImageNtHeaderId$ + + If ImageNtHeaderId = #PB_Any + Repeat + RandomData(@ImageNtHeaderId, SizeOf(ImageNtHeaderId)) + ImageNtHeaderId$ = Str(ImageNtHeaderId) + Until FindMapElement(OpenImageNtHeaders(), ImageNtHeaderId$) = #Null + Else + ImageNtHeaderId$ = Str(ImageNtHeaderId) + If FindMapElement(OpenImageNtHeaders(), ImageNtHeaderId$) <> #Null + Debug "The value used for 'ImageNtHeaderId' was already in use ! (" + ImageNtHeaderId$ + ")" + LastErrorCode = #INHH_ERROR_IdAlreadyUsed + ProcedureReturn #Null + EndIf + EndIf + + AddMapElement(OpenImageNtHeaders(), ImageNtHeaderId$) + + ; Opening the file + Define InputFileHandle = ReadFile(#PB_Any, FilePath$) + + If InputFileHandle = 0 + Debug "Unable to open input file !" + LastErrorCode = #INHH_ERROR_CannotOpenFile + Goto INHH_GetImageNtHeader32_BadEnding + EndIf + + OpenImageNtHeaders()\FileId = InputFileHandle + + ; Mapping the file into memory + Define InputFileMappingHandle = CreateFileMapping_(FileID(InputFileHandle), #Null, #PAGE_READONLY | #SEC_IMAGE_NO_EXECUTE, 0, 0, #Null) + + If InputFileMappingHandle = #ERROR_ALREADY_EXISTS Or InputFileMappingHandle = 0 + Debug "Unable to create a file mapping !" + LastErrorCode = #INHH_ERROR_CannotCreateFileMapping + Goto INHH_GetImageNtHeader32_CloseInputFileHandle + EndIf + + Define InputFileViewPtr.i = MapViewOfFile_(InputFileMappingHandle, #FILE_MAP_READ, 0, 0, 0) + If InputFileViewPtr = #Null + Debug "Unable to map the input file into memory !" + LastErrorCode = #INHH_ERROR_CannotMapViewOfFile + Goto INHH_GetImageNtHeader32_CloseInputFileHandle + EndIf + + OpenImageNtHeaders()\ViewAddress = InputFileViewPtr + + ; Retrieving the NT headers + Define *RetrievedNtHeaders.IMAGE_NT_HEADERS32 = ImageNtHeader_(InputFileViewPtr) + If *RetrievedNtHeaders = #Null + Debug "Unable to retrieve the NT headers !" + LastErrorCode = #INHH_ERROR_CannotRetrieveHeaders + Goto INHH_GetImageNtHeader32_UnmapFileView + EndIf + + OpenImageNtHeaders()\RetrievedNtHeaders = *RetrievedNtHeaders + + ProcedureReturn *RetrievedNtHeaders + + ; Error cases + INHH_GetImageNtHeader32_UnmapFileView: + UnmapViewOfFile_(InputFileViewPtr) + + INHH_GetImageNtHeader32_CloseInputFileHandle: + CloseFile(InputFileHandle) + + INHH_GetImageNtHeader32_BadEnding: + DeleteMapElement(OpenImageNtHeaders(), ImageNtHeaderId$) + ProcedureReturn #Null + EndProcedure + + + Procedure.i FreeImageNtHeader32(ImageNtHeaderId.i) + Define ImageNtHeaderId$ = Str(ImageNtHeaderId) + + Define *HeaderInternalData.OpenImageNtHeader = FindMapElement(OpenImageNtHeaders(), ImageNtHeaderId$) + If *HeaderInternalData = #Null + ProcedureReturn #INHH_ERROR_IdNotfound + EndIf + + UnmapViewOfFile_(*HeaderInternalData\ViewAddress) + CloseFile(*HeaderInternalData\FileId) + + ProcedureReturn #Null + EndProcedure + + + Procedure.i GetLastError() + ProcedureReturn LastErrorCode + EndProcedure + + + Procedure ClearLastError() + LastErrorCode = 0 + EndProcedure +EndModule + + +;- Tests +CompilerIf #PB_Compiler_IsMainFile + + + +CompilerEndIf + +; IDE Options = PureBasic 6.21 (Windows - x64) +; CursorPosition = 120 +; FirstLine = 102 +; Folding = -- +; EnableXP +; DPIAware \ No newline at end of file diff --git a/Includes/WinApi_GetConsoleProcessList.pbi b/Includes/WinApi_GetConsoleProcessList.pbi new file mode 100644 index 0000000..6692d3b --- /dev/null +++ b/Includes/WinApi_GetConsoleProcessList.pbi @@ -0,0 +1,35 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: WinApi_GetConsoleProcessList.pbi +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Compiler version: +; * PureBasic 6.0 LTS +; * PureBasic 6.0 LTS - C Backend +; +; ==- Links & License -=========================== +; License: Unlicense +; GitHub: ??? +;} + +EnableExplicit + +CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 + #WinApi_GetConsoleProcessList_LibPath$ = "../Libs/X86/kernel32.lib" +CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64 + #WinApi_GetConsoleProcessList_LibPath$ = "../Libs/X64/kernel32.lib" +CompilerElse + CompilerError "Please use x64 or x86 compilers for this include !" +CompilerEndIf + +Import #WinApi_GetConsoleProcessList_LibPath$ + GetConsoleProcessList_.l(*lpdwProcessList, dwProcessCount.l) As "GetConsoleProcessList" +EndImport + +; IDE Options = PureBasic 6.21 (Windows - x64) +; CursorPosition = 27 +; Folding = - +; EnableXP +; DPIAware \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/Libs/0_config.cmd b/Libs/0_config.cmd new file mode 100644 index 0000000..1d3e7da --- /dev/null +++ b/Libs/0_config.cmd @@ -0,0 +1,7 @@ +@echo off + +:: These variables should point to '.exe' files. +set MSVC_DUMPBIN="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\dumpbin.exe" +set MSVC_LIB="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\lib.exe" + +exit /b diff --git a/Libs/3_make_lib.cmd b/Libs/3_make_lib.cmd new file mode 100644 index 0000000..ee8f91a --- /dev/null +++ b/Libs/3_make_lib.cmd @@ -0,0 +1,43 @@ +@echo off +setlocal + +pushd %CD% +cd /D "%~dp0" + +call "%~dp0\0_config.cmd" + +echo Checking the PATH +IF NOT EXIST %MSVC_LIB% ( + echo ^> Unable to find 'lib.exe' as indicated in '%%MSVC_DUMPBIN%%' ! + echo ^> Please check the '0_config.cmd' script ! + goto end +) +echo ^> Found 'lib.exe' at the given location ! + +echo Removing old '.lib' files +del /S /Q .\*.lib 2> nul + +echo Iterating over all '.def' files in 'libs/' for 'x64', 'x86' and 'arm64'... +for /R ".\" %%i in (*.def) do call :sub-make-lib X64 %%i +for /R ".\" %%i in (*.def) do call :sub-make-lib X86 %%i +for /R ".\" %%i in (*.def) do call :sub-make-lib ARM64 %%i +echo Done ! + +:end +popd +endlocal +pause +exit /b + + +:sub-make-lib +echo ^> %2 +pushd %~dp2 +::set _RAW_DEF_NAME=%~nx2 +::set _RAW_DEF_NAME=%_RAW_DEF_NAME:.raw.def=% +::echo lib.exe /nologo /def:%_RAW_DEF_NAME%.raw.def /out:%_RAW_DEF_NAME%.lib /machine:%1 +::%MSVC_LIB% /nologo /def:%_RAW_DEF_NAME%.raw.def /out:%_RAW_DEF_NAME%.lib /machine:%1 +mkdir .\%1 +%MSVC_LIB% /nologo /def:%~nx2 /out:.\%1\%~n2.lib /machine:%1 +popd +exit /b diff --git a/Libs/ARM64/kernel32.exp b/Libs/ARM64/kernel32.exp new file mode 100644 index 0000000000000000000000000000000000000000..bffe59a14216da50f0bb35096cd571bcbc8c9ac4 GIT binary patch literal 914 zcmb7C&2G~`5T3+90U>BE6@myXltU5Vx=B<;RV#(K0xFy|YT6>iUL1RqZfkp^UFQcR zq~3Y~$^&raf_MSc0~f@NcR+CD00_i^OPO_=pGt6Guh0M1~*F+>v5sE@}?N3Ci| zLI(9j%%)MFirID4Cu64Kz9Y_I5*HznLJ9`CxmupflWi(O>gTcs?X}<K3*}l4@Jfk|UW*s-+uCzJE_R ztrit!2meECR+m6~6s$O+DV#vR#e6Es==u#N+m5f-qPE94$(q?Lv3L-)Ll!+G8x~pP z+(-W!(%HO`&l$OV!7PwE3&|ZWqaK!|;InWWOTwp0Lm{P_|Bt@@#3R)+<)UkIFCHXw z)~64TsXKLf{ptN@J+i;EbLq?H@|$m4-S<}jexTn1;{U21wb`Q$_`3gApINePeP(5S zZGQCjMVALHgL&BS#K8f82E_(-BEvK%@ge(`@tIaRYcM{&YWOsek19@prDt*1_Yuuj s2RFk?H4x3dmzt7+Pj^Ll0Ort=shB9UusF0JiKkGlN|JB^_1|0j2ijuCH~;_u literal 0 HcmV?d00001 diff --git a/Libs/ARM64/kernel32.lib b/Libs/ARM64/kernel32.lib new file mode 100644 index 0000000000000000000000000000000000000000..c4ed5e49f2797f1f65fad50f5d0f17ad94e72993 GIT binary patch literal 1756 zcmcIlPj3=I6#wlmR^1qb=usn0ny4|s0=q~PW45+NNhu|ip0{)tg$CS)MXw&YnDk3{ z;sZ1u`2Ze0_Rvq^p$F@GJ2Ngss5HSzcHZBadA~RB%`U%a^t{$f^I3XwWS`qsE?+2S z?MeNr6tlMC_DulS0PO@YPKiwcONacqZfU!^Q>(k1uXi_UrD}br=61tRUat?=t?ZS{ zf7|g{I0$q7?OtWe-CVD)<4v=_5qt=PPP5tzyk;1d+aYh$?jE_*ZC6HAh!G_S(uoF~ z8bFG$9WF%>k$?uBW@BbNS4VsqhFRGVNy_-0jzIaZ+p^YTZ2r)|@!+^+622RRlSjsH z9(;VivMVIOA?Aw`Bz2H{m1+Bpeq$x4O!tWSPT!eSP`YUC>PY$(q#Cz~`9kgwNtQcyG{M zF_)y7u93L-5Ww+*?h%E0KG3v_3$aS9AlGQU4u#kOM!aK7X(DWVj-fOb`;a2`v11ME zAMzxJh_0waqB^QHFS2K1tn*b#&RUb*y>I$MJ*tv#QDh>_X;tD2)1P^)O7cp{Rq|B{ zl5&;&kK3Q;P9IPVGasO_GMqDOMQbc;qPOT7jOvHMPRrUQy=C(n9^9MUTjRrlqk79y udiMLF1WDO%(b=6Rv-j!zMZH;eUj2Fa55xWG5Bc3%jxZ)>yufkI!~6}q^;U@h literal 0 HcmV?d00001 diff --git a/Libs/X64/kernel32.exp b/Libs/X64/kernel32.exp new file mode 100644 index 0000000000000000000000000000000000000000..9c6c583b972738d13376e6628163450ccc67e0d3 GIT binary patch literal 914 zcmb7COK;Oa5T3+90Rd_*6`%+#ltU5Vx=vI@RVzhF1ym$yMA}lsUL1Q9wza+1uJZs1 zsV8~?$`9bmjX!{T;DWdz@e>dnIRJtamon=#k4kXp$lvVD?96&z?o$nRcXl7XPXe5V zJ{i=tBl|$XqmFon_>53=0#U%vaA~96%Bbs@UM2w2h;b^wWYKU1b)pU(*w3Tz2LE@6 z4s?~vz^6Z`m*DQ$Z$OmZqca31IayF6WpOvmYIwI&S1bXga&Ek$74xHu4>RA zgM1>ErjehDrR&H~#*&Kri8zZ%T!2IhMKH+5T#jr}5l}B{8MGI|HCRYZV8|zRAJaLs z{n-JiFh_97n~^?!_o`lAuHJ#yu$Tg;>%#Ip!9+K)F_P5Uf);Jb98xRZSn|Ak!VW_! zDmMOylvzUp?NKPj5iMc+`c39hNk-4FGugI1y&kn)#))NG7AbMxZwD-TMAl1Wm2(gM z>nP6Vj9k{p=JIBqG+01xa~bupBn6KJTUZhfDh>IRYW;t@3h)~*RnL@@uFbuAkj$38 ze0)Nksmp86@4x7gz3uHw-@aDf{@Cn(xB~DC{T2{Mt9#UFmp0-1-aCC}sa)1)R@PSM zN3$VGwYpie%4DbntiwZ(s-U3AGuY_%omEK zoHZ_Ak=vZ5xP1e_4L~~q5@*DwfrUe!j#J*Q?bI92=Ih;!db!rvsXM*kliMG_ajJWj z%Ab0C76wAyc)M5KayHi+>v+=|Z1^7nzuT(yeYX_^l}^B)>GY1A>vc0DDn^Ks1nEQr z&JsYHupKUh5Rrrioz}!ee`ZJgHw=@aA%c|kx?O?tU)eI(B5d9;f#cC}+aP?m2q%xM z*E;z4etB2y0GpUEY9pzQ)T?aAYYv*rd8K+l%y*jSQb6INvn!|4t|-O0L(DIl=So1- zM&?u}dJnflsS$yCjQgpZB>WL7fV+5xi&1*JccHsXxtB%GE8YA0vDh`@s{G zE9O$PQW}YiE+G$Gzjs8gUW_#D@-lvcOu@eCP>5|H^tP=eAvST3v@zL+4&lniiX<$5 z#ETsKb)Y17Omx&}ooCNPSf{I!ytyX3d*ASedRQgjLeJR0>#M{Qs;f0tB?TqqD*385 zl5&;&kL*vA(}(24#0Mx=hEqnZWX7TVvWs;8yxuIUp#D7khvEM8hWu_Vg&30)Uf`(aVf+SMZB>c@ literal 0 HcmV?d00001 diff --git a/Libs/X86/kernel32.exp b/Libs/X86/kernel32.exp new file mode 100644 index 0000000000000000000000000000000000000000..764dc2baef28fb66aec6a7499b89b1ea1888f883 GIT binary patch literal 915 zcmb7C&2G~`5T3+90HLb6pjH&HP!2_a>n2eYRjm{y6;R=%5orsEm5^g^!nStS+I4kv^HxSPepAm{qAxiieE^T((8Fd}es|3ItVvycbNyYs{OkonUkVvBl2Dx7>kR2*I)XQZJItbtzET>Z#qN)3crqK3h z51`5%!6k2n`uyFiy0uoj18-m@4Nl*MwIzayZewF4sdoh}+mbn?UcRyFdG~}J1XNUQ z{135MQvw}Os6-KMVf*?`=21z;&u=l=wLQHNc3s9v*34!}h5LTD!@?(It3oz7_t3wA z;$q&&=ZsvwXckG6b;xZl!$BcW6g<}1!IE%L7onI|t$%b(Tj4ies-7t)T`RnPn9Nna ze0oNm^OrYYJa{=E2fMqMzJ0B}`?1~scm?1W`Yj{=ukLZ9UD|^02k-TTRm;*B);Bkn z#g5!;)!O^A2R!Iu9i@Vm`Q-}jn9;C2E&r_(zUDaspjD#V;-h}5YD zj0|9r*tKRul9+)8oq8kPqMMVxmPMLJB1dH#-EPG5UlFr6RO}8-S2J)jJZYQ6aE_Q# z)3S}`hvSdS`_U9AlJHecprXc!Bfb{BFnV`+?sYSkJ1@Ew@zOiPYmg-^CmG z08q48%1}>%Bq_dxEb#o^5t({E)U=BWbsg{E#7^!oThgt@#qrWJFU0Mv86jL{=0Bpx*ES%PeN{UX>V_w?DzwB7gBNn literal 0 HcmV?d00001 diff --git a/Libs/kernel32.def b/Libs/kernel32.def new file mode 100644 index 0000000..20b472e --- /dev/null +++ b/Libs/kernel32.def @@ -0,0 +1,4 @@ +LIBRARY msvcrt.dll + +EXPORTS +GetConsoleProcessList diff --git a/Main_PEArch.pb b/Main_PEArch.pb new file mode 100644 index 0000000..3720a2d --- /dev/null +++ b/Main_PEArch.pb @@ -0,0 +1,385 @@ +;{- Code Header +; ==- Basic Info -================================ +; Name: Main_PEArch.pb +; Version: 0.0.1 +; Author: Herwin Bozet (NibblePoker) +; +; ==- Compatibility -============================= +; Compiler version: +; * PureBasic 6.0 LTS +; * PureBasic 6.0 LTS - C Backend +; +; ==- Links & License -=========================== +; License: Unlicense +; GitHub: ??? +;} + +;- Compiler directive +EnableExplicit + +XIncludeFile "./Includes/ImageNtHeaderHelper.pbi" +XIncludeFile "./Includes/WinApi_GetConsoleProcessList.pbi" + + +;- Constants +#IMAGE_FILE_MACHINE_UNKNOWN = $0 +#IMAGE_FILE_MACHINE_ALPHA = $184 +#IMAGE_FILE_MACHINE_ALPHA64 = $284 +#IMAGE_FILE_MACHINE_AM33 = $1d3 +#IMAGE_FILE_MACHINE_AMD64 = $8664 +#IMAGE_FILE_MACHINE_ARM = $1c0 +#IMAGE_FILE_MACHINE_ARM64 = $aa64 +#IMAGE_FILE_MACHINE_ARM64EC = $A641 +#IMAGE_FILE_MACHINE_ARM64X = $A64E +#IMAGE_FILE_MACHINE_ARMNT = $1c4 +#IMAGE_FILE_MACHINE_AXP64 = $284 +#IMAGE_FILE_MACHINE_EBC = $ebc +#IMAGE_FILE_MACHINE_I386 = $14c +#IMAGE_FILE_MACHINE_IA64 = $200 +#IMAGE_FILE_MACHINE_LOONGARCH32 = $6232 +#IMAGE_FILE_MACHINE_LOONGARCH64 = $6264 +#IMAGE_FILE_MACHINE_M32R = $9041 +#IMAGE_FILE_MACHINE_MIPS16 = $266 +#IMAGE_FILE_MACHINE_MIPSFPU = $366 +#IMAGE_FILE_MACHINE_MIPSFPU16 = $466 +#IMAGE_FILE_MACHINE_POWERPC = $1f0 +#IMAGE_FILE_MACHINE_POWERPCFP = $1f1 +#IMAGE_FILE_MACHINE_R3000BE = $160 +#IMAGE_FILE_MACHINE_R3000 = $162 +#IMAGE_FILE_MACHINE_R4000 = $166 +#IMAGE_FILE_MACHINE_R10000 = $168 +#IMAGE_FILE_MACHINE_RISCV32 = $5032 +#IMAGE_FILE_MACHINE_RISCV64 = $5064 +#IMAGE_FILE_MACHINE_RISCV128 = $5128 +#IMAGE_FILE_MACHINE_SH3 = $1a2 +#IMAGE_FILE_MACHINE_SH3DSP = $1a3 +#IMAGE_FILE_MACHINE_SH4 = $1a6 +#IMAGE_FILE_MACHINE_SH5 = $1a8 +#IMAGE_FILE_MACHINE_THUMB = $1c2 +#IMAGE_FILE_MACHINE_WCEMIPSV2 = $169 + + +;- Enumerations +Enumeration PEARCH_ErrorCodes + #PEARCH_ERROR_None = 0 + + #PEARCH_ERROR_ConsoleError = 1 + #PEARCH_ERROR_UnknownError = 2 + + ;#PEARCH_ERROR_INHH_ERROR_IdAlreadyUsed = 10 + ;#PEARCH_ERROR_INHH_ERROR_IdNotfound = 11 + #PEARCH_ERROR_INHH_ERROR_CannotOpenFile = 12 + #PEARCH_ERROR_INHH_ERROR_CannotCreateFileMapping = 13 + #PEARCH_ERROR_INHH_ERROR_CannotMapViewOfFile = 14 + #PEARCH_ERROR_INHH_ERROR_CannotRetrieveHeaders = 15 + + #PEARCH_ERROR_UnknownArgument = 20 + #PEARCH_ERROR_MissingFileArgument = 21 + #PEARCH_ERROR_TooManyFileArguments = 22 + + #PEARCH_ERROR_UnknownAchitecture = 30 +EndEnumeration + + +;- Globals +Global ExitCode.i = #PEARCH_ERROR_None + +Global OptionAsHex.b = #False +Global OptionAsError.b = #False +Global OptionFullText.b = #False + +Global InputFile$ = #Null$ + + +;- Macros +Macro HandlePeArch(ShortText, FullText, Code) + If OptionAsHex + PrintN(Hex(Code, #PB_Word)) + Else + If OptionFullText + PrintN(FullText) + Else + PrintN(ShortText) + EndIf + EndIf + If OptionAsError + ExitCode = Code + EndIf +EndMacro + + +;- Procedures +Procedure PrintUsageText(PrintFull.b = #False) + Define UsageText$ + + Restore UsageText + + Read.s UsageText$ + PrintN(UsageText$) + + If PrintFull + Read.s UsageText$ + PrintN(UsageText$) + EndIf +EndProcedure + +; Checks if the current process was started via another process (CMD), or not. +Procedure.b IsProgramRunDirectly() + ; Will act as a DWORD[2] + Define ProcessListBuffer.q + ProcedureReturn Bool(GetConsoleProcessList_(@ProcessListBuffer, 2) <= 1) +EndProcedure + + +;- App's code +If Not OpenConsole("PEArch") + ExitCode = #PEARCH_ERROR_ConsoleError + Goto PEArch_End +EndIf + + +Define IParam.i +For IParam = 0 To CountProgramParameters() + Define CurrentParam$ = ProgramParameter(IParam) + + If Len(CurrentParam$) > 0 + If Left(CurrentParam$, 1) <> "/" + If InputFile$ = #Null$ + InputFile$ = CurrentParam$ + Else + ConsoleError("More than one input file was given !") + ExitCode = #PEARCH_ERROR_TooManyFileArguments + PrintUsageText() + Goto PEArch_End + EndIf + Else + CurrentParam$ = UCase(CurrentParam$) + + If CurrentParam$ = "/ASHEX" Or CurrentParam$ = "/H" + OptionAsHex = #True + ElseIf CurrentParam$ = "/?" + PrintUsageText(#True) + Goto PEArch_End + ElseIf CurrentParam$ = "/ASERROR" Or CurrentParam$ = "/E" + OptionAsError = #True + ElseIf CurrentParam$ = "/FULLTEXT" Or CurrentParam$ = "/F" + OptionFullText = #True + Else + ConsoleError("Unknown argument: '" + CurrentParam$ + "'") + ExitCode = #PEARCH_ERROR_UnknownArgument + PrintUsageText() + Goto PEArch_End + EndIf + EndIf + EndIf + +Next + + +If InputFile$ = #Null$ + ConsoleError("No input file given !") + ExitCode = #PEARCH_ERROR_MissingFileArgument + PrintUsageText() + Goto PEArch_End +EndIf + + +Define *Headers.IMAGE_NT_HEADERS32 = ImageNtHeaderHelper::GetImageNtHeader32(0, InputFile$) +If *Headers = #Null + Define HelperErrorCode.i = ImageNtHeaderHelper::GetLastError() + + Select HelperErrorCode + Case ImageNtHeaderHelper::#INHH_ERROR_CannotOpenFile + ConsoleError("Cannot open file !") + ExitCode = #PEARCH_ERROR_INHH_ERROR_CannotOpenFile + + Case ImageNtHeaderHelper::#INHH_ERROR_CannotCreateFileMapping + ConsoleError("Cannot create file mapping !") + ExitCode = #PEARCH_ERROR_INHH_ERROR_CannotCreateFileMapping + + Case ImageNtHeaderHelper::#INHH_ERROR_CannotMapViewOfFile + ConsoleError("Cannot map view of file into memory !") + ExitCode = #PEARCH_ERROR_INHH_ERROR_CannotMapViewOfFile + + Case ImageNtHeaderHelper::#INHH_ERROR_CannotRetrieveHeaders + ConsoleError("Cannot retrieve PE headers !") + ExitCode = #PEARCH_ERROR_INHH_ERROR_CannotRetrieveHeaders + + Default + ConsoleError("Unknown 'ImageNtHeaderHelper' error ! ("+Str(HelperErrorCode)+")") + ExitCode = #PEARCH_ERROR_UnknownError + EndSelect + + If OptionAsError + ExitCode = 0 + EndIf + + Goto PEArch_End +EndIf + + +Define PeArchId.u = *Headers\FileHeader\Machine + +Select PeArchId + Case #IMAGE_FILE_MACHINE_UNKNOWN + HandlePeArch("UNKNOWN", "The content of this field is assumed To be applicable To any machine type", PeArchId) + Case #IMAGE_FILE_MACHINE_ALPHA + HandlePeArch("ALPHA", "Alpha AXP, 32-bit address space", PeArchId) + Case #IMAGE_FILE_MACHINE_ALPHA64 + HandlePeArch("ALPHA64", "Alpha 64, 64-bit address space", PeArchId) + Case #IMAGE_FILE_MACHINE_AM33 + HandlePeArch("AM33", "Matsushita AM33", PeArchId) + Case #IMAGE_FILE_MACHINE_AMD64 + HandlePeArch("AMD64", "x64", PeArchId) + Case #IMAGE_FILE_MACHINE_ARM + HandlePeArch("ARM", "ARM little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_ARM64 + HandlePeArch("ARM64", "ARM64 little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_ARM64EC + HandlePeArch("ARM64EC", "ABI that enables interoperability between native ARM64 And emulated x64 code.", PeArchId) + Case #IMAGE_FILE_MACHINE_ARM64X + HandlePeArch("ARM64X", "Binary format that allows both native ARM64 And ARM64EC code To coexist in the same file.", PeArchId) + Case #IMAGE_FILE_MACHINE_ARMNT + HandlePeArch("ARMNT", "ARM Thumb-2 little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_AXP64 + HandlePeArch("AXP64", "AXP 64 (Same As Alpha 64)", PeArchId) + Case #IMAGE_FILE_MACHINE_EBC + HandlePeArch("EBC", "EFI byte code", PeArchId) + Case #IMAGE_FILE_MACHINE_I386 + HandlePeArch("I386", "Intel 386 Or later processors And compatible processors", PeArchId) + Case #IMAGE_FILE_MACHINE_IA64 + HandlePeArch("IA64", "Intel Itanium processor family", PeArchId) + Case #IMAGE_FILE_MACHINE_LOONGARCH32 + HandlePeArch("LOONGARCH32", "LoongArch 32-bit processor family", PeArchId) + Case #IMAGE_FILE_MACHINE_LOONGARCH64 + HandlePeArch("LOONGARCH64", "LoongArch 64-bit processor family", PeArchId) + Case #IMAGE_FILE_MACHINE_M32R + HandlePeArch("M32R", "Mitsubishi M32R little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_MIPS16 + HandlePeArch("MIPS16", "MIPS16", PeArchId) + Case #IMAGE_FILE_MACHINE_MIPSFPU + HandlePeArch("MIPSFPU", "MIPS With FPU", PeArchId) + Case #IMAGE_FILE_MACHINE_MIPSFPU16 + HandlePeArch("MIPSFPU16", "MIPS16 With FPU", PeArchId) + Case #IMAGE_FILE_MACHINE_POWERPC + HandlePeArch("POWERPC", "Power PC little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_POWERPCFP + HandlePeArch("POWERPCFP", "Power PC With floating point support", PeArchId) + Case #IMAGE_FILE_MACHINE_R3000BE + HandlePeArch("R3000BE", "MIPS I compatible 32-bit big endian", PeArchId) + Case #IMAGE_FILE_MACHINE_R3000 + HandlePeArch("R3000", "MIPS I compatible 32-bit little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_R4000 + HandlePeArch("R4000", "MIPS III compatible 64-bit little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_R10000 + HandlePeArch("R10000", "MIPS IV compatible 64-bit little endian", PeArchId) + Case #IMAGE_FILE_MACHINE_RISCV32 + HandlePeArch("RISCV32", "RISC-V 32-bit address space", PeArchId) + Case #IMAGE_FILE_MACHINE_RISCV64 + HandlePeArch("RISCV64", "RISC-V 64-bit address space", PeArchId) + Case #IMAGE_FILE_MACHINE_RISCV128 + HandlePeArch("RISCV128", "RISC-V 128-bit address space", PeArchId) + Case #IMAGE_FILE_MACHINE_SH3 + HandlePeArch("SH3", "Hitachi SH3", PeArchId) + Case #IMAGE_FILE_MACHINE_SH3DSP + HandlePeArch("SH3DSP", "Hitachi SH3 DSP", PeArchId) + Case #IMAGE_FILE_MACHINE_SH4 + HandlePeArch("SH4", "Hitachi SH4", PeArchId) + Case #IMAGE_FILE_MACHINE_SH5 + HandlePeArch("SH5", "Hitachi SH5", PeArchId) + Case #IMAGE_FILE_MACHINE_THUMB + HandlePeArch("THUMB", "Thumb", PeArchId) + Case #IMAGE_FILE_MACHINE_WCEMIPSV2 + HandlePeArch("WCEMIPSV2", "MIPS little-endian WCE v2", PeArchId) + Default + If OptionAsHex + HandlePeArch("WCEMIPSV2", "MIPS little-endian WCE v2", PeArchId) + Else + If OptionAsError + ExitCode = 0 + Else + ExitCode = #PEARCH_ERROR_UnknownAchitecture + EndIf + EndIf +EndSelect + + +ImageNtHeaderHelper::FreeImageNtHeader32(0) + + +PEArch_End: +If IsProgramRunDirectly() + PrintN("Press enter to exit...") + Input() +EndIf + +End ExitCode + + +;- Data section +DataSection + UsageText: + Data.s "PEArch.exe [/?] [/E|/AsError] [/H|/AsHex] [/F|/FullText] " + #CRLF$ + + "" + #CRLF$ + + "Options:" + #CRLF$ + + " /? Prints this help text." + #CRLF$ + + " /E, /AsError Gives out the result as an error code." + #CRLF$ + + " /H, /AsHex Prints the architecture as a hex number." + #CRLF$ + + " /F, /FullText Prints a longer description of the architecture." + #CRLF$ + Data.s "Errors:" + #CRLF$ + + " 0 - No error" + #CRLF$ + + " 1 - Console error" + #CRLF$ + + " 1 - Unknown error" + #CRLF$ + + " 12 - Unable to open the file" + #CRLF$ + + " 13 - Cannot create a file mapping" + #CRLF$ + + " 14 - Cannot map the file into memory" + #CRLF$ + + " 15 - Unable to retrieve the NT headers" + #CRLF$ + + " 20 - Unknown argument" + #CRLF$ + + " 21 - Missing file argument" + #CRLF$ + + " 22 - Too many file arguments" + #CRLF$ + + " 30 - The architecture is unknown, '/AsHex' will bypass it" + #CRLF$ + + #CRLF$ + + "Architectures:" + #CRLF$ + + " 0x0 - UNKNOWN - The content of this field is assumed To be applicable To any machine type" + #CRLF$ + + " 0x184 - ALPHA - Alpha AXP, 32-bit address space" + #CRLF$ + + " 0x284 - ALPHA64 - Alpha 64, 64-bit address space" + #CRLF$ + + " 0x1d3 - AM33 - Matsushita AM33" + #CRLF$ + + " 0x8664 - AMD64 - x64" + #CRLF$ + + " 0x1c0 - ARM - ARM little endian" + #CRLF$ + + " 0xaa64 - ARM64 - ARM64 little endian" + #CRLF$ + + " 0xA641 - ARM64EC - ABI that enables interoperability between native ARM64 And emulated x64 code." + #CRLF$ + + " 0xA64E - ARM64X - Binary format that allows both native ARM64 And ARM64EC code To coexist in the same file." + #CRLF$ + + " 0x1c4 - ARMNT - ARM Thumb-2 little endian" + #CRLF$ + + " 0x284 - AXP64 - AXP 64 (Same As Alpha 64)" + #CRLF$ + + " 0xebc - EBC - EFI byte code" + #CRLF$ + + " 0x14c - I386 - Intel 386 Or later processors And compatible processors" + #CRLF$ + + " 0x200 - IA64 - Intel Itanium processor family" + #CRLF$ + + " 0x6232 - LOONGARCH32 - LoongArch 32-bit processor family" + #CRLF$ + + " 0x6264 - LOONGARCH64 - LoongArch 64-bit processor family" + #CRLF$ + + " 0x9041 - M32R - Mitsubishi M32R little endian" + #CRLF$ + + " 0x266 - MIPS16 - MIPS16" + #CRLF$ + + " 0x366 - MIPSFPU - MIPS With FPU" + #CRLF$ + + " 0x466 - MIPSFPU16 - MIPS16 With FPU" + #CRLF$ + + " 0x1f0 - POWERPC - Power PC little endian" + #CRLF$ + + " 0x1f1 - POWERPCFP - Power PC With floating point support" + #CRLF$ + + " 0x160 - R3000BE - MIPS I compatible 32-bit big endian" + #CRLF$ + + " 0x162 - R3000 - MIPS I compatible 32-bit little endian" + #CRLF$ + + " 0x166 - R4000 - MIPS III compatible 64-bit little endian" + #CRLF$ + + " 0x168 - R10000 - MIPS IV compatible 64-bit little endian" + #CRLF$ + + " 0x5032 - RISCV32 - RISC-V 32-bit address space" + #CRLF$ + + " 0x5064 - RISCV64 - RISC-V 64-bit address space" + #CRLF$ + + " 0x5128 - RISCV128 - RISC-V 128-bit address space" + #CRLF$ + + " 0x1a2 - SH3 - Hitachi SH3" + #CRLF$ + + " 0x1a3 - SH3DSP - Hitachi SH3 DSP" + #CRLF$ + + " 0x1a6 - SH4 - Hitachi SH4" + #CRLF$ + + " 0x1a8 - SH5 - Hitachi SH5" + #CRLF$ + + " 0x1c2 - THUMB - Thumb" + #CRLF$ + + " 0x169 - WCEMIPSV2 - MIPS little-endian WCE v2" + #CRLF$ +EndDataSection + +; IDE Options = PureBasic 6.21 (Windows - x64) +; CursorPosition = 220 +; FirstLine = 212 +; Folding = - +; EnableXP +; DPIAware \ No newline at end of file diff --git a/Trash/Main.pb b/Trash/Main.pb new file mode 100644 index 0000000..e2cf44d --- /dev/null +++ b/Trash/Main.pb @@ -0,0 +1,105 @@ +;{- 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 new file mode 100644 index 0000000..6a799ad --- /dev/null +++ b/Trash/MainOld.pb @@ -0,0 +1,109 @@ +;{- 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 diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..4679d36 --- /dev/null +++ b/readme.md @@ -0,0 +1,9 @@ +# PB-PEArch +A small tool that tells you which [CPU architecture](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types) +a given [Windows PE](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format) is made for. + +## Usage +TODO + +## License +All the code in this repo is released in the [Public Domain](LICENSE).