进程中dll模块的隐藏

DELPHI隐藏进程源代码 隐藏自己的进程,在资源管理器隐藏,可以支持WIN10 立即下载
http://netroc682.spaces.live.com/          为了避免自己的某个dll模块被别人检测出来,有时候希望在自己加载一个dll之后,或者将dll注入到他人进程之后避免被检查出来。这就需要想办法抹掉 这个dll的模块信息,使得Toolhelp、psapi等枚举模块的API无法枚举它。
         我们可以先简单看看Windows枚举进程内模块的办法吧:
         首先是BOOL EnumProcessModules( HANDLE hProcess, HMODULE* lphModule, DWORD cb, LPDWORD lpcbNeeded);
         EnumProcessModules实际调用EnumProcessModulesInternal进行枚举。下面是vista下psapi的代码片断:
.text:514024B8                  push     ebx
.text:514024B9                  push     18h
.text:514024BB                  lea      eax, [ebp+stProcessBasicInfo]
.text:514024BE                  push     eax
.text:514024BF                  push     ebx   ;ebx=0
.text:514024C0                  push     [ebp+hProcess]
.text:514024C3                  call     ds:__imp__NtQueryInformationProcess@20 ; NtQueryInformationProcess(x,x,x,x,x)
.text:514024C9                  cmp      eax, ebx
.text:514024CB                  jge      short loc_514024E0
         调用NtQueryInformationProcess获得ProcessBasicInformation,在 PROCESS_BASIC_INFORMATION结构中取得PEB地址。然后读取指定进程PEB中的数据
text:514024E0 loc_514024E0:                            ; CODE XREF: EnumProcessModulesInternal(x,x,x,x,x)+24 j
.text:514024E0                  mov      eax, [ebp+stProcessBasicInfo.PebBaseAddress]
.text:514024E3                  cmp      eax, ebx
.text:514024E5                  jnz      short loc_514024EE
.text:514024E7                  push     8000000Dh
.text:514024EC                  jmp      short loc_514024CE
.text:514024EE ; ---------------------------------------------------------------------------
.text:514024EE
.text:514024EE loc_514024EE:                            ; CODE XREF: EnumProcessModulesInternal(x,x,x,x,x)+3E j
.text:514024EE                  push     ebx              ; lpNumberOfBytesRead
.text:514024EF                  push     4                ; nSize
.text:514024F1                  lea      ecx, [ebp+Ldr]
.text:514024F4                  push     ecx              ; lpBuffer
.text:514024F5                  add      eax, 0Ch
.text:514024F8                  push     eax              ; lpBaseAddress
.text:514024F9                  push     [ebp+hProcess]   ; hProcess
.text:514024FC                  mov      edi, ds:__imp__ReadProcessMemory@20 ; ReadProcessMemory(x,x,x,x,x)
.text:51402502                  call     edi ; ReadProcessMemory(x,x,x,x,x) ; ReadProcessMemory(x,x,x,x,x)
这里读取的是PEB地址+0C处的四个字节。
通过WinDbg我们可以看看nt!_PEB的结构
0: kd> dt nt!_PEB
    +0x000 InheritedAddressSpace : UChar
    +0x001 ReadImageFileExecOptions : UChar
    +0x002 BeingDebugged     : UChar
    +0x003 SpareBool         : UChar
    +0x004 Mutant            : Ptr32 Void
    +0x008 ImageBaseAddress : Ptr32 Void
    +0x00c Ldr               : Ptr32 _PEB_LDR_DATA
    +0x010 ProcessParameters : Ptr32 _RTL_USER_PROCESS_PARAMETERS
……
+0C处是一个_PEB_LDR_DATA结构指针,里面包含了和LDR相关的一些数据,进程的模块链表就保存在Ldr中。下面是_PEB_LDR_DATA的结构:
0: kd> dt nt!_PEB_LDR_DATA
    +0x000 Length            : Uint4B
    +0x004 Initialized       : UChar
    +0x008 SsHandle          : Ptr32 Void
    +0x00c InLoadOrderModuleList : _LIST_ENTRY
    +0x014 InMemoryOrderModuleList : _LIST_ENTRY
    +0x01c InInitializationOrderModuleList : _LIST_ENTRY
    +0x024 EntryInProgress   : Ptr32 Void
其中,InLoadOrderModuleList、InMemoryOrderModuleList、 InInitializationOrderModuleList就是进程当前已加载模块的链表,只是按照不同的方式排序。 EnumProcessModules是通过InMemoryOrderModuleList链表枚举的,而根据Win2k代码,ToolHelp32函 数是通过InLoadOrderModuleList枚举。这三个_LIST_ENTRY都是在一个 RTL_PROCESS_MODULE_INFORMATION结构中的成员。这个结构在2k代码中有引用,不过没有确切的定义,下面是ReactOS中 的定义,不过看起来我的vista PSAPI中使用的结构已经有所变化了,这里只作参考。
//
// Loader Data Table Entry
//
typedef struct _LDR_DATA_TABLE_ENTRY
{
     LIST_ENTRY InLoadOrderLinks;
     LIST_ENTRY InMemoryOrderModuleList;
     LIST_ENTRY InInitializationOrderModuleList;
     PVOID DllBase;
     PVOID EntryPoint;
     ULONG SizeOfImage;
     UNICODE_STRING FullDllName;
     UNICODE_STRING BaseDllName;
     ULONG Flags;
     USHORT LoadCount;
     USHORT TlsIndex;
     union
     {
         LIST_ENTRY HashLinks;
         PVOID SectionPointer;
     };
     ULONG CheckSum;
     union
     {
         ULONG TimeDateStamp;
         PVOID LoadedImports;
     };
     PVOID EntryPointActivationContext;
     PVOID PatchInformation;
} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
到这里,隐藏模块的方法就已经明了了:通过PEB取得Ldr数据,拿到三个模块链表,并将要隐藏的模块断链即可。下面是主要代码实现:
BOOL HideMyself()
{
   HMODULE hMod = GetModuleHandle( _T( "ntdll.dll"));
   HMODULE hModMyself = GetModuleHandle( _T("dll.dll"));
   pfnNtQueryInformationProcess p = (pfnNtQueryInformationProcess)::GetProcAddress( hMod, "NtQueryInformationProcess");

   PROCESS_BASIC_INFORMATION stInfo = {0};
   DWORD dwRetnLen = 0;
   DWORD dw = p( GetCurrentProcess(), 0, &stInfo, sizeof(stInfo), &dwRetnLen);

   PPEB pPeb = stInfo.PebBaseAddress;
   PLIST_ENTRY ListHead, Current;
   PLDR_DATA_TABLE_ENTRY pstEntry = NULL;

   ListHead = &( stInfo.PebBaseAddress->Ldr->InLoadOrderModuleList);
   Current = ListHead->Flink;
   while ( Current != ListHead)
   {
     pstEntry = CONTAINING_RECORD( Current, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
     //DebugOutW( L"Module:%s, base:0x%X/r/n", pstEntry->FullDllName.Buffer, pstEntry->EntryPoint);
     if ( pstEntry->DllBase == hModMyself)
     {
       pstEntry->InLoadOrderLinks.Flink->Blink = pstEntry->InLoadOrderLinks.Blink;
       pstEntry->InLoadOrderLinks.Blink->Flink = pstEntry->InLoadOrderLinks.Flink;
       DebugOut( _T( "Hide injected dll."));
       break;
     }
     Current = pstEntry->InLoadOrderLinks.Flink;
   }

   ListHead = &( stInfo.PebBaseAddress->Ldr->InMemoryOrderModuleList);
   Current = ListHead->Flink;
   while ( Current != ListHead)
   {
     pstEntry = CONTAINING_RECORD( Current, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList);
     DebugOutW( L"Module:%s, base:0x%X/r/n", pstEntry->FullDllName.Buffer, pstEntry->EntryPoint);
     if ( pstEntry->DllBase == hModMyself)
     {
       pstEntry->InMemoryOrderModuleList.Flink->Blink = pstEntry->InMemoryOrderModuleList.Blink;
       pstEntry->InMemoryOrderModuleList.Blink->Flink = pstEntry->InMemoryOrderModuleList.Flink;
       DebugOut( _T( "Hide injected dll."));
       break;
     }
     Current = pstEntry->InMemoryOrderModuleList.Flink;
   }
   DebugOutW( L"/r/n");

   ListHead = &( stInfo.PebBaseAddress->Ldr->InInitializationOrderModuleList);
   Current = ListHead->Flink;
   while ( Current != ListHead)
   {
     pstEntry = CONTAINING_RECORD( Current, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
     DebugOutW( L"Module:%s, base:0x%X/r/n", pstEntry->FullDllName.Buffer, pstEntry->EntryPoint);
     if ( pstEntry->DllBase == hModMyself)
     {
       pstEntry->InInitializationOrderModuleList.Flink->Blink = pstEntry->InInitializationOrderModuleList.Blink;
       pstEntry->InInitializationOrderModuleList.Blink->Flink = pstEntry->InInitializationOrderModuleList.Flink;
       DebugOut( _T( "Hide injected dll."));
       break;
     }
     Current = pstEntry->InInitializationOrderModuleList.Flink;
   }
   //DebugOut( _T("Out HideMyself/r/n"));
   return TRUE;
}
         这样处理之后,通过常规的枚举进程方式已经枚举不到隐藏模块,ProcessExplorer也无法枚举。但是,通过枚举进程内存空间等非常规方法,仍然 是可以找到的。关于PSAPI和Toolhelp函数枚举模块的原理,可以逆向Windows代码,或者查找网上的代码看看就明白了。

author:forget

HideModuleFromPEB proc hInstDLL:DWORD
         assume   fs:nothing
         mov      esi,hInstDLL
         xor      eax,eax
         mov      eax,fs:[eax].TEB.Peb
         mov      eax,[eax].PEB.Ldr
         lea      eax,[eax].PEB_LDR_DATA.InLoadOrderModuleList
         @@:
         mov      eax,[eax].LDR_MODULE.InLoadOrderModuleList.Flink
         cmp      esi,[eax].LDR_MODULE.BaseAddress
         jnz      @B
         mov      esi,[eax].LIST_ENTRY.Flink
         mov      ebx,[eax].LIST_ENTRY.Blink
         mov      [ebx].LIST_ENTRY.Flink,esi
         mov      esi,[eax].LIST_ENTRY.Blink
         mov      ebx,[eax].LIST_ENTRY.Flink
         mov      [ebx].LIST_ENTRY.Blink,esi
         lea      eax,[eax].LDR_MODULE.InMemoryOrderModuleList
         mov      esi,[eax].LIST_ENTRY.Flink
         mov      ebx,[eax].LIST_ENTRY.Blink
         mov      [ebx].LIST_ENTRY.Flink,esi
         mov      esi,[eax].LIST_ENTRY.Blink
         mov      ebx,[eax].LIST_ENTRY.Flink
         mov      [ebx].LIST_ENTRY.Blink,esi
         ret
HideModuleFromPEB endp

我也来段 占内存用的,其中testdll是隐式连接。

   void *PEB = NULL;
   void *Ldr = NULL;
   _LIST_ENTRY *Flink = NULL;
   _LIST_ENTRY *p = NULL;
   BYTE   *BaseAddress = NULL;
   BYTE   *FullDllName = NULL;
   __asm
   {
     mov eax,fs:[0x30]
     mov PEB,eax
   }
   Ldr = *( ( void ** )( ( unsigned char * )PEB+0x0c ) );
   Flink = (_LIST_ENTRY*)*( ( void ** )( ( unsigned char * )Ldr+ 0x0c ) );
   p = Flink;
   do
   {
     BaseAddress = *( ( BYTE ** )( ( unsigned char * )p+ 0x18 ) );
     FullDllName = *( ( BYTE ** )( ( unsigned char * )p+ 0x28 ) );
     LPSTR strFullDllName;
     UnicodeToAnsi((LPCOLESTR)FullDllName,&strFullDllName);
     if( strFullDllName )
     {
       if( strstr(strFullDllName,"testdll") )
       {
         *(LPDWORD)((LPBYTE)p + 0x38) = 1;
       }
     }
     CO_SAFE_DELETE(strFullDllName);
     p = p->Flink;
   }
   while ( Flink != p );

   FreeLibrary(GetModuleHandle("testdll.dll"));

   LPVOID lpdata = VirtualAlloc((LPVOID)NULL,1024*1024*6,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
   if( lpdata != (LPVOID)0x400000 )
   {
     return FALSE;
   }

都发代码片段,我也来一个

     while(modulo->BaseAddress != 0)
   {
        if( (ULONG_PTR)modulo->BaseAddress == DllHandle)
      {
           if(modulo->InInitializationOrderModuleList.Blink == NULL) return FALSE;

           prec = (LDR_MODULE*)(ULONG_PTR)((ULONG_PTR)modulo->InInitializationOrderModuleList.Blink - 16);
           next = (LDR_MODULE*)(ULONG_PTR)((ULONG_PTR)modulo->InInitializationOrderModuleList.Flink - 16);

           prec->InInitializationOrderModuleList.Flink = modulo->InInitializationOrderModuleList.Flink;
           next->InInitializationOrderModuleList.Blink = modulo->InInitializationOrderModuleList.Blink;  

           prec = (LDR_MODULE*)modulo->InLoadOrderModuleList.Blink;
           next = (LDR_MODULE*)modulo->InLoadOrderModuleList.Flink;

           prec->InLoadOrderModuleList.Flink = modulo->InLoadOrderModuleList.Flink;
           prec->InMemoryOrderModuleList.Flink = modulo->InMemoryOrderModuleList.Flink;

           next->InLoadOrderModuleList.Blink = modulo->InLoadOrderModuleList.Blink;
           next->InMemoryOrderModuleList.Blink = modulo->InMemoryOrderModuleList.Blink;
          
           return TRUE;
      }
           modulo = (LDR_MODULE*)modulo->InLoadOrderModuleList.Flink;
   }

通过VirtualQueryEx函数列举出进程内虚拟内存的段,然后根据PE结构和内存属性来定位Image文件的映像基地址,即可确认以下三项数据,     该数据是连续的,
PVOID DllBase;
PVOID EntryPoint;
ULONG SizeOfImage;
在内存中搜索这个三个数据,即可定位LDR。

iceword 可能查出

from pediy

 
枚举进程/子进程 立即下载

相关推荐

C#和Halcon二次开发如何隐藏dll引用库,如何隐藏Debug或Release目录下的dll

C#和Halcon二次开发如何隐藏dll引用库,如何隐藏Debug或Release目录下的dll

delphi LDR断链 隐藏DLL

unit UHideModule; interface uses windows; type UNICODE_STRING = packed record Len:Cardinal; Max:Cardinal; Buffer:PWideChar end; PLIST_ENTRY = ^LIST_ENTRY; LIST_ENTRY = Packed r...

Shirley068的博客 625

小鹏P7车载以太网诊断实战:从OBD口定义到DoIP协议验证

本文详细解析了小鹏P7车载以太网诊断的实战过程。从OBD接口的针脚定义入手,依据ISO13400标准,确认了以太网线对位置,并指导制作专用的RJ45转OBD线束。通过搭建测试环境,使用Ping、端口扫描及Wireshark抓包,最终成功验证了车辆对DoIP协议的支持,为基于以太网的高速诊断与刷写提供了完整的技术路径。

CAT789的专栏 522

DLL隐藏和逆向

DLL注入新手详解示例

m0_75243362的博客 2964

深入解析SSD报错“READ FPDMA QUEUED”:从诊断到修复全流程

本文深入解析了SSD报错“READ FPDMA QUEUED”的含义、成因与全流程解决方案。该错误通常指示硬盘硬件或健康状态问题。文章详细介绍了如何通过系统日志定位错误、解读关键的S.M.A.R.T.健康报告(重点关注重分配扇区计数等指标),并逐步进行硬件排查(如更换SATA数据线)、软件修复与数据抢救,最终指导用户根据诊断结果做出维修或更换SSD的决策。

weixin_29233333的博客 399

Shopee App加密算法逆向实战:从抓包到libshpssdk.so的深度解析

本文详细解析了Shopee App加密算法的逆向过程,从网络抓包发现加密参数入手,通过Frida动态Hook定位到Java层关键方法,并深入追踪至Native层的libshpssdk.so核心函数。文章结合实战演示了如何利用Unidbg模拟执行环境进行算法分析与验证,并探讨了核心参数生成逻辑及风控规避要点,为移动安全与逆向工程研究提供了完整的技术路径。

weixin_28347369的博客 527

无痕注入dll_R0级驱动注入与隐藏注入dll

' ,sX95r:.' s&@@@@@@@@@@@@@G;' i@@@@@@@@@@@@@@@@@@@&,' r@@@@@@@@@@...

weixin_39856803的博客 2656

kettle实验十一:没有数据流入时停止操作

【实验目的】 1.利用Kettle的“阻塞数据直到步骤都完成”,“检测空流”,“中止”等组件,实现Kettle转换流程的控制。 2.熟练掌握“阻塞数据直到步骤都完成”,“检测空流”,“中止”等组件的使用,实现Kettle转换流程的控制。 【实验原理】 “检测空流”组件可以检测所在转换的输入数据,如果整个转换没有输入数据,通过“中止”组件终止整个转换的流程。在存在数据输入的情况,为了能让数据输出,需要和“阻塞数据直到步骤都完成”配合使用。当所有数据都已经从上个步骤“字段选择”读取完毕后,通过“阻塞数据直到步骤

weixin_44727274的博客 3848

结构体 WIN7_LDR_DATA_TABLE_ENTRY结构(x86 x64)

typedef struct _LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderLinks; LIST_ENTRY InMemoryOrderLinks; LIST_ENTRY InInitializationOrderLinks; PVOID      DllBase; PVOID      EntryPoint; ULONG32    SizeOfIm...

3362

电磁场仿真软件:Sonnet_(3).Sonnet用户界面与操作

Sonnet支持用户通过二次开发自定义工具,例如:编写Python脚本,实现自定义功能。将脚本保存为工具插件。在Sonnet中加载并使用自定义工具。# 示例:自定义工具 import sonnet def custom_tool(design , object , parameter , value) : """自定义工具示例,设置对象的指定参数。

kkchenjj的博客 1523

1篇1章3节:R 语言的产生与发展轨迹(更新2024/08/14)

药物的研究阶段包括靶标确定、生物学模型建立、新化学实体的发现和优化新化学实体四个关键环节。每个环节都在药物研发过程中发挥着至关重要的作用。通过科学严谨的方法和技术手段,研究人员能够在药物研发过程中不断探索和优化,从而发现和开发出具有高效、安全性的候选药物,为疾病治疗提供更多的选择和希望。

MD Code 2665

再谈隐藏进程中的DLL模块/黑月教主

 http://hi.baidu.com/_achillis/blog/item/59bf732623fbe509918f9d87.html 相当老的话题,大约一年前就写过这个东西了,不过那时候知识比较有限,也不了解内核,因此实现得很粗浅,现在再写一下,权当是对这个老问题的总结吧。先谈谈正规DLL的隐藏方法,这里说的正规DLL,是指用LoadLibrary以正常方式加载的DLL。一

lookWang的专栏 6409

【Visual Assist X助手安装问题】Visual Assist X无法安装(双击安装包没反应) | Visual Assist X安装后在Visual Studio中找不到(亲测有效)

本文分享了Visual Assisant X助手的安装与使用问题的详细解决办法,因为网上搜集的信息比较少,所以有一定的参考价值。考虑到很多开发新手会遇到上述问题,可能对Windows系统不熟悉,所以相关操作步骤讲解的很详细!

dvlinker的技术专栏 6万+

【旧文章搬运】再谈隐藏进程中的DLL模块

原文发表于百度空间,2009-09-17========================================================================== 相当老的话题,大约一年前就写过这个东西了,不过那时候知识比较有限,也不了解内核,因此实现得很粗浅,现在再写一下,权当是对这个老问题的总结吧。先谈谈正规DLL的隐藏方法,这里说的正规DLL,是指用LoadLib...

weixin_30407099的博客 289

【ACP】2025-最新-疑难题解析- 练习二汇总

全球加速是优化公网访问的,负载均衡是分发流量的,公网 NAT 网关是处理公网 IP 的,高速通道是建私网连接但不直接提供固定私网地址功能。C 是客户端加密方式,D 是 ECS 云盘加密,都不属于 OSS 服务器端加密。某企业想使用云服务器 ECS + 负载均衡 SLB + 弹性伸缩 (Auto Scaling) 的架构搭建一个企业级门户网站,技术负责人对于负载均衡和弹性伸缩配合使用没有经验,于是将他理解的两种产品配合使用的一些技术细节列成了一个表单,并请作为架构师的您帮他做一下鉴别,以下哪些项是正确的?

jundao1997的专栏 294

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

VC隐藏DLL模块函数

VC隐藏DLL模块函数 以前写的一个隐藏DLL模块函数,记录下来,免得以后需要时难找。 隐藏的方法是把DLL模块的路径从进程的内存中清除掉,不过,还是有方法可以把隐藏的DLL路径找出来的,比如内存暴力搜索等。 隐藏DLL模块的路径后,会存在一些问题,比如你后面想拿DLL的路径,拿不到了,所以在隐藏之前需要把路径保存起来;还有,当程序要Load你隐藏的DLL时,会重新加...

weixin_34408717的博客 110

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

易语言编程-x64驱动强制隐藏DLL模块技术(过第三方dll检测)

这个功能呢可以让易语言隐藏64位进程里任何dll模块,包括自己注入的dll也可以隐藏,而且是驱动级别隐藏。所以很大写DLL方式辅助的一注入DLL到游戏就被发现检测,提示第三方DLL程序,关闭后再进行游戏。并且隐藏后,任何驱动工具(包括CE工具)都无法查看枚举被隐藏的DLL文件以及找不到DLL内存区域,就算是有保护的游戏比如 dxf ,用这个功能也一样可以隐藏进程中任意DLL模块不被发现。.参数 模块句柄, 长整数型, , 要隐藏的dll或exe模块句柄。第三方DLL检测,是很多游戏都会做的,

hzw320的博客 2721

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

上一篇: 检测隐藏DLL
下一篇: Vista System Restore Rootkit
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值