您的位置:程序门 -> vb -> 基础类



vb遍历内存,这样行吗?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


vb遍历内存,这样行吗?
发表于:2007-09-01 20:18:35 楼主
dim   memstart   as   long
        dim   memend   as   long,   realyxymem   as   long
        dim   i   as   single,   j   as   single,   x   as   integer
        dim   seekflag1   as   string,   seekflag2   as   string
        memstart   =   &h10000
        memend   =   &h77c33ff0
              if   realyxymem   =   0   then
                    for   i   =   memstart   to   memend   step   &h1
                            seekflag1   =   chr(clng(readmem(clng( "&h "   &   i))))
                            if   seekflag1   =   "[ "   then
                                  seekflag2   =   " "
                                  for   x   =   1   to   9
                                          seekflag2   =   seekflag2   &   chr(readmem(clng( "&h "   &   i)   +   clng( "&h "   &   x   -   1)))
                                  next   x
                                  '分析得到的 "[ "号后面的字串
                                  '特征: "[ "   +   数字   +   ". "   +   数字   +   "] "
                                  y   =   instr(seekflag2,   ". ")
                                  if   y   <>   0   then
                                        if   left(seekflag2,   1)   =   "[ "   and   right(seekflag2,   1)   =   "] "   and   y   <>   0   _
                                              and   instr( "0123456789 ",   mid(seekflag2,   y   -   1))   <>   0   and   _
                                              instr( "0123456789 ",   mid(seekflag2,   len(seekflag2)   -   2,   1))   <>   0   then
                                              realyxymem   =   clng( "&h "   &   i)
                                              goto   seekmemend
                                        end   if
                                  end   if
                            end   if
                    next   i
              end   if
seekmemend:
              if   realyxymem   <>   0   then
                    label17.caption   =   " "
                    for   i   =   1   to   9
                            label17.caption   =   label17.caption   &   chr(clng(readmem(realyxymem   +   clng( "&h "   &   i   -   1))))
                    next   i
              end   if


'以上是我的代码..可是不对头..有达人帮我讲下吗???怎么样才行..
发表于:2007-09-01 20:21:141楼 得分:0
readmem这个函数我是写好了的.可以说绝对没有问题..关键就是这上面的对指定内存区域的扫描.我不会..上面是写错了的..请问有人知错在哪儿吗?偶实在是蠢才..请教得详细点儿..谢谢...
发表于:2007-09-01 22:42:282楼 得分:0
chr(clng(readmem(clng( "&h "   &   i))))
--->
chr(readmem(i))
发表于:2007-09-01 23:28:503楼 得分:0
代码有点搞笑^_^
readmem每次只能读一个字节,效率太低了!
简单改一下:

        dim   i   as   long,   x   as   integer
        dim   seekflag(8)   as   byte,   s   as   string
        for   i   =   &h10000   to   &h77c33ff0
                if   readmem(i)   =   91   then
                        for   x   =   0   to   8
                                seekflag(x)   =   readmem(i   +   x)
                        next
                        s   =   strconv(seekflag,   vbunicode)
                        if   s   like   "[[]#*#.#*#[]] "   then
                                    label17.caption   =   s
                                    exit   for
                        end   if
                end   if
        next


快速检索

最新资讯
热门点击