Author Topic: Security  (Read 3053 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Security
« Reply #15 on: February 05, 2021, 09:46:37 PM »

Last chance for those who have an old version of VS.
inline functions are recents (some years),verify that there is none doing this:
put " includelib  \sdkrc100\crt_lib\IX86\release\crt10_32.lib"  in comment (in the sdk32.inc) ,it is the inlines functions in a library.
add "inludelib msvcrt.lib" if necessary

And if it work,you have a version with no inlines functions.
Fa is a musical note to play with CL

LiaoMi

  • Member
  • ****
  • Posts: 922
Re: Security
« Reply #16 on: February 05, 2021, 10:14:27 PM »
You have an old version of VS

It's not that old, actually :tongue:

Quote
Stay with the paths of your first test and add the includelib (original lib not those of the forum package lib).
You can also try to use LINK instead of polink

Doesn't help. Did anybody else succeed in building something with Yves' SDK?

Hi jj2007,

the SDK from TouEnMasm is my favorite over the years, I've compiled the example with no problem:

Lucky you... it seems that it requires a pretty special setup including that behemoth of M$ C compiler. Too complicated for my taste :cool:

Hi jj2007,

no, this is not necessary, you just need to prepare the environment, as elsewhere, you need to correct the file with your default inclusions - "include sdk32.inc", I excluded this file and added my own set of options, this is my habit.

It was before>
Code: [Select]
include sdk32.inc
include stdio.sdk
include conio.sdk
;include ntifs.sdk
include accCtrl.sdk
include aclapi.sdk
;SdkDdkVer.sdk
;winnt.sdk
;include H:\sdkrc100\um\dbghelp.sdk NTDDI_WIN10_RS5
;include perso32.inc
;includelib perso32.lib
;includelib libucrt.lib
;includelib libcmt.lib

;includelib libcmt.lib

turned into (Add to the header of the source code (Security.asm))

Code: [Select]
    .686P
    .XMM
    .model flat,stdcall
    option casemap:none

option LITERALS:ON

OPTION FIELDALIGN:16; 1|2|4|8|16|32 - The default value is 1 or the value set by cmdline switch -Zp

        include translate32.inc
        include windows.inc
        include WinUser.inc
        include ShlObj.inc
        include WinBase.inc
        include stdio.inc
        include sysinfoapi.inc
        include timezoneapi.inc

include stdio.inc
include conio.inc
include accCtrl.inc
include aclapi.inc

includelib crt10_32.lib
       
        includelib ntdll.lib
        includelib ntdllp.lib
       
        includelib kernel32.Lib
        includelib User32.Lib
        includelib ntoskrnl.lib
        includelib Advapi32.lib
       
        includelib ucrt.lib

.nolist
.nocref


Next, you need a basic set of lib files, I use from visual studio 2017. After that, define the paths to all this data, I do this through the script (Can be downloaded from the attachment.)

Variables are defined in the Bat script.
Code: [Select]
REM ************* The following lines can be customized:
set UASM=C:\masm64\bin
set MASM=C:\masm64\bin\HostX64\x64
set INCLUDE=C:\masm64\sdkrc100\um;C:\masm64\sdkrc100\shared;C:\masm64\sdkrc100\VC;
set LIB=C:\masm64\VS2017\Lib\10.0.18362.0\um\x86\;C:\masm64\sdkrc100\crt_lib\IX86\release;C:\masm64\VS2017\Lib\10.0.18362.0\km\x86\;C:\masm64\VC2015CompSDK\lib;C:\masm64\VS2017\Lib\10.0.18362.0\ucrt\x86
REM **************************** End of customized lines

And, of course, you need linkers from Microsoft  :thumbsup:

I forgot to say that I renamed all *.sdk to *.inc extensions, and then through notepad++ corrected the internal links to *.inc file extension.

P.S> Attachments don't work
« Last Edit: February 05, 2021, 11:31:15 PM by LiaoMi »

LiaoMi

  • Member
  • ****
  • Posts: 922
Re: Sécurité
« Reply #17 on: February 05, 2021, 10:26:32 PM »
For those who don't find the official msvcrt functions who are in msvcrt.lib and ucrt.lib ,I can do nothing.
Take care also if you don't use the sdk32.inc that there is need of the inlines functions (printf..) with numerous sub proc in
\sdkrc100\crt_lib\IX86\release\crt10_32.lib
With those three lib in 32 bits,link is happy.

The complete build envirronnement is here.

Quote
EditMasmIni
Pour les variables d'environnements:
-* l'ancienne variable,si elle existe,est remplacé entièrement
-* chaque chemin s'ajoute,le ; est ajouté
Par défaut,le mot suivant EditMasmIni (en début de ligne) est considéré comme une variable
d'environnement,à moins qu'il ne fasse partie de la liste de mots réservés


EditMasmIni RESERVELISTE
;rien pour l'instant , éventuel futur


EditMasmIni PATH
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
H:\uasm64
EditMasmIni PROCESSEUR
IX86

EditMasmIni LIB
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86
H:\sdkrc100\crt_lib\IX86\release




EditMasmIni INCLUDE
H:\sdkrc100\shared
H:\sdkrc100\um
H:\sdkrc100\VC
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt


EditMasmIni UASM
/c /coff /nologo /Zp4
EditMasmIni LINK
/NOLOGO  /SUBSYSTEM:WINDOWS

EditMasmIni FindeEditMasmIni



For the version of the sdk,It is difficult to answer because I have added some new files that was not on the original and update some others.
With translation,the translated sdk is easy to update partially without problem.
I have keep the originals .h files but there is no version of sdk in them.

Wich file is so large ?
The sample, exe file with added is 12k.
And if it is the include files you find too big,here the size of the include files in the windows sdk 10.0.19041.0 : 323 Mo

security.exe = 38,0 KB (38 912 bytes)
My security_20210205_004650 = 10,0 KB (10 240 bytes)

jj2007

  • Member
  • *****
  • Posts: 11550
  • Assembler is fun ;-)
    • MasmBasic
Re: Security
« Reply #18 on: February 06, 2021, 12:07:41 AM »
you just need to prepare the environment

The SDK is three times the size of the Masm32 SDK, plus it requires some GB of Visual X? With comments in French?

Way too complicated for my taste, folks. Enjoy what you are doing, but I am not eager to run in circles around Visual Studio to program in Assembly :thumbsup:

LiaoMi

  • Member
  • ****
  • Posts: 922
Re: Security
« Reply #19 on: February 06, 2021, 02:03:30 AM »
you just need to prepare the environment

The SDK is three times the size of the Masm32 SDK, plus it requires some GB of Visual X? With comments in French?

Way too complicated for my taste, folks. Enjoy what you are doing, but I am not eager to run in circles around Visual Studio to program in Assembly :thumbsup:

 :tongue: This SDK has support for 64 bit systems and unicode encoding out of the box. You can take the old lib files, but they probably won't cover the modern requirements of Windows 10. And here you can see a huge plus that this SDK has full compatibility with the visual studio. Imagine it's like French flirting with a girl  :biggrin: , don't give up, compile with us  :eusa_boohoo:

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Security
« Reply #20 on: February 08, 2021, 08:17:21 PM »
I have added a 64 bits version,in the first post, who allow a choice beetween admin or everyone group (console mode).
+ detection "key already exist"
Only the admin allow to delet the key.
Good play with rights and group.Failed for not enough rights are all reported.
« Last Edit: February 09, 2021, 07:10:00 PM by TouEnMasm »
Fa is a musical note to play with CL