Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array elements
#1
1.How to i can populate a binary array or string with multiple values more easiest way?

ARRAY(byte) a
a[]=0x1C;a[]=0x2C;a[]=0x3C;a[]=0x4C;a[]=0x5C;a[]=0x6C;a[]=0x7C;a[]=0x8C;
etc.

2.Explain me please, how used suffix letter U (unsigned int) to change current type of int?
Thanks
#2
Macro Macro1599
Code:
Copy      Help
;this can be use to create string of constant byte values
lpstr s="[0x1C][0x2C][0x3C][0x4C][0x5C][0x6C][0x7C][0x8C]"

;this can be used to create ARRAY(byte) from string
ARRAY(byte) a.create(8)
memcpy &a[0] s a.len

;results
int i
for(i 0 a.len) out "0x%X" a[i]
;or
outb &a[0] a.len

other way
Macro Macro1600
Code:
Copy      Help
str s="1C 2C 3C 4C 5C 6C 7C 8C"
s.decrypt(8)

;results
outb s s.len 1

------------------------
unsigned int
Macro Macro1598
Code:
Copy      Help
out -1
out -1U

int i=-1
out i
out i+0U

out ConvertSignedUnsigned(i)
#3
Can I put int value into a string of bytes, may be through the point?
Something like this:

str s="-test-"
int i=0x54534554
s[1]=i
out s
#4
yes, through pointer
Macro Macro1634
Code:
Copy      Help
str s="-test-"
int i=0x54534554
int* p=s+1; p[0]=i
out s
or memcpy
Macro Macro1635
Code:
Copy      Help
str s="-testtest-"
int i0(0x54534554) i1(0x54534554)
memcpy s+1 &i0 8
out s


Forum Jump:


Users browsing this thread: 1 Guest(s)