Etichetă: windows registry functions

Registry Functions M-Asm (snippet)

This article has been written before more than 24months, information might old.

M am gandit sa imi public unele din sinppeturile mele poate va ajuta , acest snippet contine cateva protos ( proceduri (functii pentru cei care „vin” din c si altceva bazat pe c ) ) legate de registry ( windows de la 98 pana la windows 7 ar trebui sa functioneze )

Snippet :


.486                      ; force 32 bit code
.model flat, stdcall      ; memory model & calling convention
option casemap :none      ; case sensitive

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\shell32.inc
include \masm32\include\advapi32.inc
include \masm32\include\gdi32.inc
include \masm32\include\comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\masm32.inc
include \masm32\include\ole32.inc
include \masm32\macros\macros.asm

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\ole32.lib
includelib \masm32\lib\masm32.lib


SetRegString    	PROTO :dword, :dword, :dword, :dword
GetRegString    	PROTO :dword, :dword, :dword, :dword
SetRegDword     	PROTO :dword, :dword, :dword, :dword
GetRegDword     	PROTO :dword, :dword, :dword, :dword
Reg_Delete_Value 	PROTO :dword, :dword, :dword

.code
align 4
SetRegString  proc reg_HKEY:dword, lpszKeyName:dword, lpszValueName:dword, lpszString:dword
    local Disp: dword
    local pKey: dword
    local dwSize: dword
    invoke RegCreateKeyEx, reg_HKEY,
        lpszKeyName, NULL, NULL,