I have some varaibles im defineing by doing like

myvar equ 012h

ect..
and i was wondering
I want to make them random.. but i know they are constants.. or somthing.. and i tried to make them dd's instead of equ.. and that made some like size conflicts with registers.. ect and i tried db and that did stuff like that too? is there any way i can make them random ? :) im havi0ng a hard time figuring out how to convert them or whatever... or however u do that? im not sure..
Posted on 2004-02-09 00:06:25 by DevSpartacus
By definition a constant cannot be random. If you want to generate a set of randon equates you can use a Mersenne Twister or some other randomizer and output a source file like this:

This is designed to stress test a compilers symbol table so you might not want to use the equates it generates but it will give you an idea how to do it.
Posted on 2004-02-09 00:23:12 by donkey
yea its really driving me nuts mainly the whole correct size of register thing >.<
Posted on 2004-02-09 00:30:38 by DevSpartacus
keeps turning into MOV EAX,DWORD PTR DS:[4012AC]
and I dont want a DWORD ptr.. i just want a simple value :(
Posted on 2004-02-09 16:28:36 by DevSpartacus
As long as you DD the value, the value is in the memory and it is natural (though not transparently visible in some assmeblers) to have DWORD PTR when you disassemble. If that is not what you intended, then use equates.
Posted on 2004-02-09 17:20:54 by Starless

keeps turning into MOV EAX,DWORD PTR DS:[4012AC]
and I dont want a DWORD ptr.. i just want a simple value :(


A constant defined with equ is a symbol that is replaced by its value.
blah equ 01h
mov eax, blah
assembles to the instruction
mov eax, Imediate32
the value you specified after equ is inserted as the 32 bit imedate value.
If you define a dword
blah dd 0
then that value is initialized data and so when you use
mov eax, blah
you are accessing a dword variable wich assembles to the
mov eax, mem32
instruction.
Posted on 2004-02-09 17:26:09 by ENF