Could someone please tell me the how to write zero in Hex to be used under a registry key. All of the other numbers will set under key but the 0 will not. My list gives me 01 02 03 and so on but z_0 should give 00 but it don't. What am im missing.

Thanks in advance


z_0 BYTE 00h
z_1 BYTE 01h
z_2 BYTE 02h
z_3 BYTE 03h
z_4 BYTE 04h
z_5 BYTE 05h
z_6 BYTE 06h
z_7 BYTE 07h
z_8 BYTE 08h
z_9 BYTE 09h
Posted on 2003-07-13 14:45:32 by cmax
Your data definition could be like this:


z_0 db 00h
z_1 db 01h
z_2 db 02h
z_3 db 03h
z_4 db 04h
z_5 db 05h
z_6 db 06h
z_7 db 07h
z_8 db 08h
z_9 db 09h

It's the "standard" way... nobody uses that BYTE type at all ;)

However your code should work just the same... so there must be a problem in the code that saves the data into the registry. Are you using RegSetValueEx with the REG_BINARY type? Or are you trying to write an hex string with the REG_SZ type? Remember that ASCIIZ strings are zero terminated, so if you're using lstrlen or a similar proc, the trailing zero will not be saved to the registry.
Posted on 2003-07-15 09:25:05 by QvasiModo
Yes i try strlen but i dumped the whole idea because executing the .reg file is proved more convienent for me. But i'm still glad i was shown how to code it. The standard way works. So at lease i can use it when needed.
Funny, after trying so long only to find my old way had it place as it was. It's like being happy with the old 76 Cutlass instead of a new S U V in my case.

Thanks QvasiModo

Now i know how to do it all.

PS: I write BYTE, DWORD, instead of db or dd. Im sure they mean the same. I got that from Erine. (execue maybe mis-spell name... The reg com guy) He said more or less write the whole word when you're coding.

I ended up using x-dream style of setreg for the few thing i needed to do and the others stay as .reg file so that i will not forget how thing are done. And of course i got ROBOT laid of by NAME. I use the name of people in my code so i don't forget where i came from.

; ........................ bitRAKE cleanbuff

; ........................ Cage cleanbuff

; ........................ ROBOT SetReg

; ........................ x-dream SetReg

; ........................ Qweezy FindFile



mov eax, etc
Posted on 2003-07-15 17:37:32 by cmax
I use byte for a single byte, and db for 'strings'. :P

Example:
exFlag BYTE FALSE
exString db "Example String",0


Weird.

Cheers.

I know I can probably just look it up, and I by no means need anyone to answer this, but I always thought BOOLEAN were actually a single byte, but for one reason or another, was told that a BOOLEAN in VB wasn't a byte. SO I guess instead of doing BOOLEAN as a type, I always used a byte. :\
Posted on 2003-07-16 03:14:29 by xkardisx
o ... my bad. I got that wrong . I really forgot how to write to the .data section. Accually Never had.... since day 20

I use .data? and styker's invoke style macro for nearly everything.

Thats where i write the whole word and made a habit of it. Now i see what you mean QvasiModo. Sorry ...

Got to try that now...

I had my data above written under the .const sections. Always was trying to aviod .data

This is probley why most of my code give me so much hell... My crazy idea and not so great habits.

but come to think again it seem that BYTE can replace db as the word under .data sections. I want to to see right now...
Posted on 2003-07-16 06:38:14 by cmax
How I found this thread :confused:
But I prefer to use BYTE instead of DB, DWORD instead of DW, just not to do typo errors :)


I always thought BOOLEAN were actually a single byte, but for one reason or another, was told that a BOOLEAN in VB wasn't a byte. SO I guess instead of doing BOOLEAN as a type, I always used a byte. :\
I think "boolean" is just a single bit.
On i86-32 boolean often becomes a DWORD, because it's faster (in most cases faster than byte, too)
Posted on 2003-09-14 21:00:24 by S.T.A.S.