Every programmer has, at least once, thought to themselves that "it's not me, it's the compiler!". Usually, we're wrong, but this is the story of the time I was actually right.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Dword Ptr
Write string.h functions using string instructions in asm x86-64
Introduction The C standard library offers a bunch of functions (whose declarations can be found in the string.h header) to manage NULL-terminated strings and arrays. These are some of the most used C functions, often implemented as builtin by the C compiler, as they are crucial to the speed of programs. On the other hand, the x86 architecture contains “string instructions”, aimed at implementing operations on strings at the hardware level.
Aliasing - Matt Godbolt’s blog
This example is taken from something similar that actually bit me in my job a few years ago. I was bewildered until I worked out that it was aliasing! ↩ Try making the change in the Compiler Explorer window above. You’ll see the total update move outside of the loop. If you’re not scared to jump ahead a bit, make it -O3 and you’ll see the vectorised code, but only with the __restrict. ↩ Aliasing is particularly bad in C and C++.
shared_ptr: the (not always) atomic reference counted smart pointer
This is a write-up of the “behavioral analysis” of shared_ptr<T> reference count in GNU’s libstdc++. This smart pointer is used to share references to the same underlaying pointer. The mechanism beneath works by tracking the amount of references through a reference count so the pointer gets freed only after the last reference is destructed. It is usually used in multi-threaded programs (in conjunction with other types) because of the guarantees of having its reference count tracked atomically.
a very occasional diary @ Nikita Danilov
Zero-cost statics in C++ "Усердие все превозмогает!" К. Прутков, Мысли и афоризмы, I, 84 In C and C++ a static variable can be defined in a function scope: int foo() { static int counter = 1; printf("foo() has been called %i times.\n", counter++); ... } Technically, this defines counter as an object of static storage duration that is allocated not within the function activation frame (which is typically on the stack, but can be on the heap for a coroutine), but as a global object.
Safe array handling? Never heard of it
Sooner or later, any developer working with C-like languages gets the idea of treating a two-dimensional array as a one-dimensional one. The reasons vary, but the result is usually the same. In this short post, we'll talk about this dubious approach and explore the potential problems it could bring to your program. What's this about? Developers have already discussed array indexing many times, but today, we dive deeper.
S2S Compilers: Understanding Switch Case Statements
This blog is sponsored and supported by Voxgig. Motivated and inspired by Decl. In development and soon to be open-sourced.
memory and ILP handling in 2D convolutions
memory and ILP handling in 2D convolutions a convolution is defined as an integral that expresses the amount of overlap two signals represented by functions of time \(f(t)\) and \(g(t)\) have as one is reflected and shifted on top of the other. It is usually denoted by the convolution operator \(f * g\) : \[ (f * g)(t) = \int_{-\infty}^{\infty} f(t-\tau)g(\tau) d\tau \] where \(f(t)\) is a one-dimensional signal and \(g(t)\) is the response of a filter.
记一次 .NET某工业设计软件崩溃分析
一、背景 前些天有位朋友找到我,说他的软件在客户那边不知道什么原因崩掉了,从windows事件日志看崩溃在 clr 里,让我能否帮忙定位下,dump 也抓到了,既然dump有了,接下来就上 windbg 分析吧。 二、WinDbg 分析 一般来说崩溃在clr里都不是什么好事情,这预示着 clr 在执行自身代码的时候抛了异常,即灾难的 ExecutionEngineException,可以用 !t 验证下。 0:000> !t ThreadCount: 18 UnstartedThread: 0 BackgroundThread: 7 PendingThread: 0 DeadThread: 11 Hosted Runtime: no Lock ID OSID ThreadOBJ State GC Mode GC Alloc Context Domain Count Apt Exception 0 1 52e8 18998d50 24220 Preemptive 639B0D58:00000000 18c361f0 0 STA...
记一次 .NET某工业设计软件 崩溃分析
一:背景 前些天有位朋友找到我,说他的软件在客户那边不知道什么原因崩掉了,从windows事件日志看崩溃在 clr 里,让我能否帮忙定位下,dump 也抓到了,既然dump有了,接下来就上 windbg 分析吧。 二:WinDbg 分析 一般来说崩溃在clr里都不是什么好事情,这预示着 clr 在执行自身代码的时候抛了异常,即灾难的 ExecutionEngineException,可以用 !t 验证下。 0:000> !t ThreadCount: 18 UnstartedThread: 0 BackgroundThread: 7 PendingThread: 0 DeadThread: 11 Hosted Runtime: no Lock ID OSID ThreadOBJ State GC Mode GC Alloc Context Domain Count Apt Exception 0 1 52e8 18998d50 24220 Preemptive 639B0D58:00000000 18c361f0 0 STA...
【c++】全面理解C++多态:虚函数表深度剖析与实践应用-CSDN博客
🔥个人主页:Quitecoder 🔥专栏:c++笔记仓 朋友们大家好,通过本篇文章,来详细理解多态的内容 1.多态的定义及实现 多态的基本概念:多态指的是对象可以通过指向它们的基类的引用或指针被操纵,同时还能保持其派生类部分的特性。将派生类对象当作基类对象来对待,这允许不同类的对象响应相同的消息以不同的方式,换句话说,同一个接口,使用不同的实例而执行不同操作 比如买票,普通人买票时,是全价买票;学生买票时,是半价买票 class Person { public: virtual void BuyTicket() { cout << "买票-全价" << endl; } }; class Student : public Person { public: virtual void BuyTicket() { cout << "买票-半价" << endl; } }; void Func(Person& p) { p.BuyTicket(); } int main() { Person ps; Student st; Func(ps); Func(st); return 0; }...
每个程序员都应该了解的硬件知识-51CTO.COM
2024-04-10 12:36:41 本文旨在通过多个可运行的 benchmark 介绍常见的优化细节以及与之相关的硬件知识,为读者建立一个简单、有效的硬件心智模型。 在追求高效代码的路上,我们不可避免地会遇到代码的性能瓶颈。为了了解、解释一段代码为什么低效,并尝试改进低效的代码,我们总是要了解硬件的工作原理。于是,我们可能会尝试搜索有关某个架构的介绍、一些优化指南或者阅读一些计算机科学的教科书(如:计算机组成原理)。但以上的内容可能都太过繁琐、细节太多,在阅读的过程中,我们可能会迷失在纷繁的细节中,没法很好地将知识运用到实践中。 本文旨在通过多个可运行的 benchmark 介绍常见的优化细节以及与之相关的硬件知识,为读者建立一个简单、有效的硬件心智模型。 首先要介绍的就是缓存 cache 。我们先来看一个引自 CSAPP 的经典例子: pub fn row_major_traversal(arr: &mut Vec<Vec<usize>>) { let n = arr.len(); for i in 0..n { assert!(arr[i].len() == n);...
Branchless Lomuto Partitioning
A partition function accepts as input an array of elements, and a function returning a bool (a predicate) which indicates if an element should be in the first, or second partition. Then it returns two arrays, the two partitions: def partition(v, pred): first = [x for x in v if pred(x)] second = [x for x in v if not pred(x)] return first, second This can actually be done without needing any extra memory beyond the original array.
二进制安全虚拟机Protostar靶场(2)基础知识讲解,栈溢出覆盖变量 Stack One,Stack Two
Protostar靶场的安装和一些二进制安全的基础介绍在前文已经介绍过了,这里是文章链接 https://blog.csdn.net/qq_45894840/article/details/129490504?spm=1001.2014.3001.5501 当系统向缓冲区写入的数据多于它可以容纳的数据时,就会发生缓冲区溢出或缓冲区溢出,用更简单的话说就是在程序运行时,系统会为程序在内存里生成一个固定空间,如果超过了这个空间,就会造成缓冲区溢出,可以导致程序运行失败、系统宕机、重新启动等后果。更为严重的是,甚至可以取得系统特权,进而进行各种非法操作 寄存器是内存中非常靠近cpu的区域,因此可以快速访问它们,但是在这些寄存器里面能存储的东西非常有限 计算机寄存器是位于CPU内部的一组用于存储和处理数据的高速存储器。用于存放指令、数据和运算结果 常见的寄存器名称以及作用: 累加器寄存器(Accumulator Register,EAX):用于存储操作数和运算结果,在算术和逻辑操作中经常使用。 基址指针寄存器(Base Pointer...
C++程序正向编译逆向反编译(一)_c++反编译_向往生的博客-CSDN博客
1.需求 逆向工程师必须先是一个正向开发工程师,如果没有C++/MFC的开发经验,就不会懂得如何逆向分析C++/MFC的程序,本文完成一个helloworld的C++正逆向过程。 2.C++程序源码 编译环境:visual studio 2022 #include <iostream> #include <cstdlib> using namespace std; int main() { int a; a = 100; for (int i = 0; i < a; i++) { cout << "Hello World! " << endl; } cin >> a; return 0; } 编译完毕后生成exe程序,导入Ghidra,分析完毕后,在symbol tree窗口,输入main查找到主函数位置: 3.反编译结果 3.1 Ghidra反汇编 int __cdecl main(int _Argc,char **_Argv,char **_Env) { basic_ostream<char,std::char_traits<char>_> *this; int iVar1;...
static operator()
Since [P1169R3], wording. Since [P1169R2], added missing feature-test macro and updated wording to include [LWG3617]. [P1169R1] was approved for electronic polling by EWG, but two issues came up that while this paper does not change are still worth commenting on: can and can whether or not stateless lambdas be static be ? [P1169R0] was presented to EWGI in San Diego, where there was no consensus to pursue the paper.
Heap Based Buffer Overflow Original
Full Disclosure mailing list archives By Date By Thread HackTool.Win32.Muzzer.a / Heap Based Buffer Overflow From: malvuln <malvuln13 () gmail com> Date: Sat, 29 Jan 2022 01:06:09 -0500 Discovery / credits: Malvuln - malvuln.com (c) 2022 Original source: https://malvuln.com/advisory/c9291c93fce757a665352567ca13ec3f.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: HackTool.Win32.Muzzer.a Vulnerability: Heap Based Buffer Overflow Description: Processing a specially crafted...
Remote Heap Based Buffer Overflow
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.BNLite / Remote Heap Based Buffer Overflow From: malvuln <malvuln13 () gmail com> Date: Sun, 21 Nov 2021 18:41:58 -0500 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/a8818da39c7d36d9b5497d1a875798b8.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.BNLite Vulnerability: Remote Heap Based Buffer Overflow Description: The malware listens...
Reverse engineering software licensing from early-2000s abandonware - Part 1
Background This series concerns a software licensing system used in a proprietary software application from circa 2004. The software was available in an unregistered trial mode with limited functionality. A free licence could be obtained by registering online with the software vendor.
Full Disclosure: Backdoor.Win32.Whirlpool.a / Remote Buffer Overflow
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.Whirlpool.a / Remote Buffer Overflow - UDP Datagram From: malvuln <malvuln13 () gmail com> Date: Sun, 30 May 2021 19:53:02 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/90171763d1cc62102b08482bac54ea8b.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.Whirlpool.a Vulnerability: Remote Buffer Overflow - UDP Datagram Description:...
Backdoor.Win32.NetSpy.10 / Heap Corruption
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.NetSpy.10 / Heap Corruption From: malvuln <malvuln13 () gmail com> Date: Tue, 1 Jun 2021 00:04:44 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/e677149c35cbba118655d9b133da8827.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.NetSpy.10 Vulnerability: Heap Corruption Description: The malware listens on TCP port 7306 and drops an...
Remote Stack Buffer Overflow (SEH)
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.Delf.acz / Remote Stack Buffer Overflow (SEH) From: malvuln <malvuln13 () gmail com> Date: Tue, 1 Jun 2021 22:56:10 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/065d89c63fa1057de98c727d4b044b98.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.Delf.acz Vulnerability: Remote Stack Buffer Overflow (SEH) Description: The malware...
Backdoor.Win32.Delf.acz / Remote Stack Buffer Overflow
Advertisement Looking for a fix?
Backdoor.Win32.Delf.acz Buffer Overflow
Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/065d89c63fa1057de98c727d4b044b98.txt Contact: malvuln13@gmail.com Media: twitter.com/malvuln Threat: Backdoor.Win32.Delf.acz Vulnerability: Remote Stack Buffer Overflow (SEH) Description: The malware listens on TCP ports 6060,6161,6262,6363,6464,6565,6767,6868,6969,7070,7171,7373.
Backdoor.Win32.Whirlpool.a Buffer Overflow
Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/90171763d1cc62102b08482bac54ea8b.txt Contact: malvuln13@gmail.com Media: twitter.com/malvuln Threat: Backdoor.Win32.Whirlpool.a Vulnerability: Remote Buffer Overflow - UDP Datagram Description: The malware listens on UDP Datagram ports 8848 and 8864. Sending a 192 byte payload to port 8864 triggers a classic stack buffer overflow overwriting ECX, EIP registers.
Remote Stack Buffer Overflow (UDP)
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.Agent.lyw / Remote Stack Buffer Overflow (UDP) From: malvuln <malvuln13 () gmail com> Date: Fri, 14 May 2021 14:09:44 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/4de6f4104a5fc2185164747a6fcf20ce.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.Agent.lyw Vulnerability: Remote Stack Buffer Overflow (UDP) Description: The malware...
Backdoor.Win32.Agent.oda Buffer Overflow
Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/380ff48c4a28ac25f5efb630883eeb17.txt Contact: malvuln13@gmail.com Media: twitter.com/malvuln Threat: Backdoor.Win32.Agent.oda Vulnerability: Remote Stack Buffer Overflow (UDP) Description: The malware drops an executable named "aspimgr.exe" under SysWOW64 dir, which listens on TCP port 80 and UDP port 53.
Backdoor.Win32.Agent.oda / Remote Stack Buffer Overflow (UDP)
Advertisement Looking for a fix?
BACKDOOR.WIN32.AGENT.KTE / Remote Stack Buffer Overflow (UDP Datagram)
Advertisement Looking for a fix?
Remote Stack Buffer Overflow (UDP Datagram)
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.Agent.kte / Remote Stack Buffer Overflow (UDP Datagram) From: malvuln <malvuln13 () gmail com> Date: Thu, 29 Apr 2021 19:08:51 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/7c92e59e776355734781bbf05571d0f0.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.Agent.kte Vulnerability: Remote Stack Buffer Overflow (UDP Datagram)...
Backdoor.Win32.Agent.afq / Remote Heap Corruption
Full Disclosure mailing list archives By Date By Thread Backdoor.Win32.Agent.afq / Remote Heap Corruption From: malvuln <malvuln13 () gmail com> Date: Tue, 27 Apr 2021 20:22:45 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/853754de6b8ffbe1321a8c91aab5c232_C.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Backdoor.Win32.Agent.afq Vulnerability: Remote Heap Corruption Description: The malwares built-in server...
Remote Stack Buffer Overflow (UDP Datagram)
Full Disclosure mailing list archives By Date By Thread Trojan-Dropper.Win32.Delf.da / Remote Stack Buffer Overflow (UDP Datagram) From: malvuln <malvuln13 () gmail com> Date: Fri, 19 Mar 2021 21:49:08 -0400 Discovery / credits: Malvuln - malvuln.com (c) 2021 Original source: https://malvuln.com/advisory/a2f1adfd7a35fd0e0207a24be169b4c1.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: Trojan-Dropper.Win32.Delf.da Vulnerability: Remote Stack Buffer Overflow (UDP Datagram)...
TROJAN-DROPPER.WIN32.DELF.DA / Remote Stack Buffer Overflow (UDP Datagram)
Advertisement Looking for a fix?
BACKDOOR.WIN32.BNLITE / Remote Heap Corruption
Full Disclosure mailing list archives By Date By Thread BACKDOOR.WIN32.BNLITE / Remote Heap Corruption From: malvuln <malvuln13 () gmail com> Date: Sat, 2 Jan 2021 17:49:59 -0500 Discovery / credits: malvuln - Malvuln.com (c) 2021 Original source: http://malvuln.com/advisory/f78cef7588f9c32609a4932d10c67f95.txt Contact: malvuln13 () gmail com Media: twitter.com/malvuln Threat: BACKDOOR.WIN32.BNLITE Vulnerability: Remote Heap Corruption Description: When sending a specially crafted payload to...
Microsoft DRM Technology - 'msnetobj.dll' ActiveX Multiple Vulnerabilities
The Exploit Database is maintained by OffSec, an information security training company that provides various Information Security Certifications as well as high end penetration testing services. The Exploit Database is a non-profit project that is provided as a public service by OffSec. The Exploit Database is a CVE compliant archive of public exploits and corresponding vulnerable software, developed for use by penetration testers and vulnerability researchers.
CVE-2017-11176: A step-by-step Linux Kernel exploitation (part 3/4)
In the previous article, we implemented a proof-of-concept that triggers the bug from userland, dropping kernel modifications made with System Tap in part 1. This article starts by introducing the memory subsystem and the SLAB allocator. Those are such huge topics that we strongly recommend the reader to get the external resources pointed out. Understanding them is absolutely mandatory to exploit any kind of use-after-free or heap overflow bugs.
R7-2013-19 Disclosure: Yokogawa CENTUM CS 3000 Vulnerabilities
On Saturday, March 8th, @julianvilas and I spoke at RootedCON about our work with the Yokogawa CENTUM CS3000 product. Today, as promised, we're publishing details for three of the vulnerabilities found in the product. For all of you who weren't able to attend RootedCON, we're going just to quote the Yokogawa description of their own product in order to introduce it: "Yokogawa released CENTUM CS 3000 R3 in 1998 as the first Windows-based production control system under our brand.
.Net Exceptions - Tracking Down Where In The Code The Exceptions Occurred
I have written earlier about how to track down exceptions using configuration scripts for adplus. Most of the time the methods are short enough that just knowing what function you got an exception in, is enough for you to track down the why, but we all know that we don't live in that perfect world where we write completely modular applications and everything is nicely lined up:) Let's say you have found this exception on the heap...
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Dword
Contact Dword, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack