| 发表于:2007-04-05 02:04:47 楼主 |
我将内存中一段数据memorycopy到下面的一个type类型中时 bc be bd da 00 00 00 00 00 6c 01 6f 11 6e 01 67 11 6a 11 00 63 02 00 00 61 32 32 32 32 32 00 0e 0d 00 00 02 35 44 15 03 77 2f 01 be 4f ff ff d4 c0 b7 c9 00 00 00 00 00 00 00 00 00 00 00 00 00 01 10 01 00 01 00 00 00 00 变成了: bc be bd da 00 00 00 00 00 01 6f 11 6e 01 67 11 6a 11 00 63 02 00 00 61 32 32 32 32 32 00 0e 0d 00 00 02 35 44 15 03 77 2f 01 be 4f ff ff d4 c0 b7 c9 00 00 00 00 00 00 00 00 00 00 00 00 00 01 10 01 00 01 00 00 00 00 00 用readprcocessmemory也一样,奇怪 6c不见了,后面多了个00 public type demo_struct lpname as string *9 a1 as integer a2 as integer a3 as integer a4 as integer a5 as integer reserved1(5) as byte b1 as byte b2 as byte b3 as byte b4 as byte b5 as byte reserved2(4) as byte c1 as byte c2 as byte c3 as byte reserved3(33) as byte end type public ds as demo_struct 结构有问题吗?改成lpname as string *8或*7都没用; 6c出来了但是调用3个都有问题,ds.a1=&h6f01 或ds.a1=&h6c00 也就是偏移了1byte,我们要得到的是ds.a1=&h016c. 但是象下面一样改成byte没问题: public type demo_struct lpname as string *9 a1(1 to 2) as byte a2(1 to 2) as byte a3(1 to 2) as byte a4(1 to 2) as byte a5(1 to 2) as byte reserved1(5) as byte b1 as byte b2 as byte b3 as byte b4 as byte b5 as byte reserved2(4) as byte c1 as byte c2 as byte c3 as byte reserved3(33) as byte end type 这样只是分别得到了a1的高低2个字节,多不方便啊,为什么不能一下安全的得到他的int值或long值 而不发生偏移,这在vc里没问题,vb里不知怎么做? |
|
|
|
|