Heya,
I'd like to have some sentences defined in data referenced by a table for faster acces... Erm... Let's see:
So I can just use a variable and multiply it by 4 to get the offset instead of having like a huge table of IF's...
Anyone knows how to do this?
TIA,
JimmyC
I'd like to have some sentences defined in data referenced by a table for faster acces... Erm... Let's see:
.data
Text1 db "hello",0
Text2 db "wassup",0
Text3 db "welcome",0
TextTable dd <insert here addr/offset of Text1>,
dd <insert here addr/offset of Text2>,
etc
So I can just use a variable and multiply it by 4 to get the offset instead of having like a huge table of IF's...
Anyone knows how to do this?
TIA,
JimmyC
Yup is As Simple as that :
A note:
offsets will not be the same on all OS/boxes just do not save the on file and reload later...ok?
.data
Text1 db "hello",0
Text2 db "wassup",0
Text3 db "welcome",0
TextTable dd offset Text1
dd offset Text2
dd offset Text3
...etc...
A note:
offsets will not be the same on all OS/boxes just do not save the on file and reload later...ok?
(This thread) shows a more compact way using a macro - easier to edit, IMO.
Alright, I see...
but what about that Offsets who aren't the same on all OS/boxes mentionned by Bogdan ?
Doesn't that imply that I should compute the Offsets at Runtime just to make it compatible for every system?
but what about that Offsets who aren't the same on all OS/boxes mentionned by Bogdan ?
Doesn't that imply that I should compute the Offsets at Runtime just to make it compatible for every system?
Relocation information stored in the PE file does that for you.
heya BitRake,
I used Bogdan's suggestion in .data and it seems to work fine,
I tested it on WinME and 98SE...
Well, I use it as I couldn't figure out how your macro works... I just pasted that thing inside my macros file and called it from .data and then the error messages flood began...
Anyway... thanks a lot both of you.. :)
JClif
(PipeDreams v1.0 will be released in approx 1-2 week)
I used Bogdan's suggestion in .data and it seems to work fine,
I tested it on WinME and 98SE...
Well, I use it as I couldn't figure out how your macro works... I just pasted that thing inside my macros file and called it from .data and then the error messages flood began...
Anyway... thanks a lot both of you.. :)
JClif
(PipeDreams v1.0 will be released in approx 1-2 week)