starzboy Posted November 30, 2006 Posted November 30, 2006 (edited) grr .... i have a weird problem here ... i was trying to enter a userinput into registry ... .data REG_PATH db 'SOFTWARE\xxx\xxxx\xxxxx\',0 REG_SUB_KEY0 db 'UserName',0 REG_SUB_KEY1 db 'UserCompany',0 REG_VAL0 db ' starzboy',0 REG_VAL1 db ' starzboy',0 .data? hKey PHKEY ? buffer db 512 dup(?) buffer1 db 512 dup(?) invoke GetDlgItemText,hwnd,10021,ADDR buffer,512 ----> copy to 1st buffer invoke GetDlgItemText,hwnd,10022,ADDR buffer1,512 ----> copy to 2nd buffer invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr REG_PATH,addr hKey ----> make the key invoke RegSetValueEx,hKey,addr REG_SUB_KEY0,0,REG_SZ,addr buffer,SIZEOF buffer ----> save 1st input invoke RegSetValueEx,hKey,addr REG_SUB_KEY1,0,REG_SZ,addr buffer1,SIZEOF buffer1 ----> save 2nd input invoke RegCloseKey, hKey ------> close key the values are succesfully written to the registry .... but the appz dosent detect it untill i write it manually ... and when the values are written in registry[for eg. starzboyj] they are seen as "starzboyj..." so i was wondering what could be the problem .... Edited November 30, 2006 by starzboy
Angel-55 Posted November 30, 2006 Posted November 30, 2006 (edited) listen this is the right way but the problem could be that the keys should be created in the HKEY_LOCAL_MACHINE key File in most apps and you didn't notice that ? but some other apps needs them in other keys like HKEY_CURRENT_USER so perhaps you should be careful for this important situation and one more thing check please the Key File (For User And Name) and see what is it's kind ? like String Value Binary Value DWORD Value.......ect Edited November 30, 2006 by Angel-55
starzboy Posted November 30, 2006 Author Posted November 30, 2006 (edited) nah ... i tested em all ...the place where i pyt them is right place in HKEY_LOCAL_MACHINE and its a string value ...anyways thanks for seeing Edited November 30, 2006 by starzboy
Angel-55 Posted November 30, 2006 Posted November 30, 2006 (edited) that's ok but listen i got another thing perhaps this application doesn't search for the Registration at startup ??this could be the Problem there are some apps that doesn't check the registry for registrationit might check it in another file like *ini files or *.dat files that where created after you've registred the app ...........!! Edited November 30, 2006 by Angel-55
revert Posted November 30, 2006 Posted November 30, 2006 Hi starz,I think you have to give the exact length of the string and not the total size of the buffer invoke GetDlgItemText,hwnd,10021,ADDR buffer,512 ----> copy to 1st bufferinvoke GetDlgItemText,hwnd,10022,ADDR buffer1,512 ----> copy to 2nd bufferinvoke RegCreateKey,HKEY_LOCAL_MACHINE,addr REG_PATH,addr hKey ----> make the keyinvoke strlen, addr bufferadd eax, 1; To take in account the terminater '\0'invoke RegSetValueEx,hKey,addr REG_SUB_KEY0,0,REG_SZ,addr buffer, eax <- change to eaxinvoke strlen, addr buffer1add eax, 1 invoke RegSetValueEx,hKey,addr REG_SUB_KEY1,0,REG_SZ,addr buffer1,eax <- change to eaxinvoke RegCloseKey, hKey ------> close key
starzboy Posted November 30, 2006 Author Posted November 30, 2006 (edited) @angel ...the app has to be "cracked to run " .... it reads key to say "Registered to: xyz"@jstorme dosent work ...but i think i needs the exact lenght of string ...lemme try again ... Edited November 30, 2006 by starzboy
starzboy Posted November 30, 2006 Author Posted November 30, 2006 @jstormehi bro ... thanc for tip ... got it working ...invoke GetDlgItemText,hwnd,10021,ADDR buffer,512invoke GetDlgItemText,hwnd,10022,ADDR buffer1,512invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr REG_PATH,addr hKeyadd buffer,1invoke RegSetValueEx,hKey,addr REG_SUB_KEY0,0,REG_SZ,addr buffer, bufferadd buffer,1invoke RegSetValueEx,hKey,addr REG_SUB_KEY1,0,REG_SZ,addr buffer1,bufferinvoke RegCloseKey, hKeytahnx angel alsocya
diablo2oo2 Posted December 1, 2006 Posted December 1, 2006 here are some usefull registry funtions for masmmasm.registry.functions.rar
antrobs Posted December 2, 2006 Posted December 2, 2006 This is a nice info diablo2oo2, who knows i need this someday.... aNtRoBs
PuNkDuDe Posted December 9, 2006 Posted December 9, 2006 when using SIZEOF BUFFER you must always do SIZEOF BUFFER-1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now