Jump to content
Tuts 4 You

Reg Entry


starzboy

Recommended Posts

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..."

ttv4.png

so i was wondering what could be the problem ....

Edited by starzboy
Link to comment

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 by Angel-55
Link to comment

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 by starzboy
Link to comment

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 registration

it might check it in another file like *ini files or *.dat files that where

created after you've registred the app ...........!!

Edited by Angel-55
Link to comment

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 buffer
invoke GetDlgItemText,hwnd,10022,ADDR buffer1,512 ----> copy to 2nd buffer
invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr REG_PATH,addr hKey ----> make the keyinvoke strlen, addr buffer
add 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 buffer1
add eax, 1
invoke RegSetValueEx,hKey,addr REG_SUB_KEY1,0,REG_SZ,addr buffer1,eax <- change to eaxinvoke RegCloseKey, hKey ------> close key
Link to comment

@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 by starzboy
Link to comment

@jstorme

hi bro ... thanc for tip ... got it working ...

invoke GetDlgItemText,hwnd,10021,ADDR buffer,512

invoke GetDlgItemText,hwnd,10022,ADDR buffer1,512

invoke RegCreateKey,HKEY_LOCAL_MACHINE,addr REG_PATH,addr hKey

add buffer,1

invoke RegSetValueEx,hKey,addr REG_SUB_KEY0,0,REG_SZ,addr buffer, buffer

add buffer,1

invoke RegSetValueEx,hKey,addr REG_SUB_KEY1,0,REG_SZ,addr buffer1,buffer

invoke RegCloseKey, hKey

tahnx angel also

cya

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...