Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1054009
  • 博文数量: 50
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 2037
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-05 08:03
文章分类
文章存档

2011年(1)

2010年(3)

2009年(17)

2008年(29)

我的朋友

分类: WINDOWS

2009-05-18 14:22:46

dll主程序:

.386
.model flat, stdcall
option casemap:none

include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib

RY2_Move proto    :DWORD ,  :DWORD

.data 
       hInstance  dd ?
       Buffer1    db "network#standard" ,0
       Buffer2    db "c2VsZWN0ICogZnJvbSB1c2Vycw==" ,0

            
.data?
       hWnd       DD ?
.code
                                      
Main proc hinstdll:DWORD , reason:DWORD , reserved1:DWORD
      
     .if reason == DLL_PROCESS_ATTACH
               mov eax,TRUE                                        
     .elseif reason == DLL_PROCESS_DETACH
               invoke CloseHandle,hinstdll
     .elseif reason == DLL_THREAD_ATTACH
          
     .endif
     ret
@@Exit:
     popad
     mov  eax,TRUE
     ret
     
Main    endp

RY2_Close Proc @@handle : DWORD
          xor eax,eax
          ret
RY2_Close Endp

RY2_Find Proc
         mov al,1
         ret
RY2_Find Endp
                
RY2_GenUID Proc  @@handle:DWORD , @@uid : DWORD , @@seed:DWORD , @@isProtect:DWORD
           xor eax , eax
           ret
RY2_GenUID Endp                                 

RY2_GetVersion Proc @@ver:DWORD
               xor eax,eax
               ret
RY2_GetVersion Endp                
                
RY2_Open Proc @@mode:DWORD , @uid:DWORD, @@hid:DWORD
         or al,1
         ret
RY2_Open Endp
                
RY2_Read Proc @@handle:DWORD , @@block_index:DWORD , @@buffer512:DWORD
         .if      @@block_index == 3
                   mov eax,offset Buffer1
                   mov @@buffer512,eax
         .elseif  @@block_index == 4
                   mov eax,offset Buffer2
                   mov @@buffer512,eax               
         .endif
         or al,1
         ret
RY2_Read Endp               

RY2_Write Proc @@handle:DWORD , @@block_index:DWORD , @@buffer512:DWORD
          .if      @@block_index == 3
                   mov eax,offset Buffer1
                   mov @@buffer512,eax
         
          .elseif  @@block_index == 4
                   mov eax,offset Buffer2
                   mov @@buffer512,eax
        
          .endif
          or al,1
          ret
RY2_Write Endp               

RY2_Move PROC @@edi:DWORD , @@esi:DWORD
         pushad
         cld
         mov ecx , 512
         mov esi , @@esi
         mov edi , @@edi
         rep movsb
         popad
         ret
RY2_Move Endp             
END  Main 

inc文件:

RY2_Close       PROTO
RY2_Find        PROTO
RY2_GenUID      PROTO 
RY2_GetVersion  PROTO 
RY2_Open        PROTO  
RY2_Read        PROTO
RY2_Write       PROTO 
RY2_Move        PROTO

 

Def函数声明:

EXPORTS  RY2_Close       @   01
         RY2_Find        @   02
         RY2_GenUID      @   03
         RY2_GetVersion  @   04
         RY2_Open        @   05 
         RY2_Read        @   06
         RY2_Write       @   07
         RY2_Move        @   08


 

阅读(5354) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~