Windows error 0xDEADBEEF, -559038737

Detailed Error Information

HRESULT analysis[1]

FlagsSeverityFailure
Reserved (R)true
OriginMicrosoft
NTSTATUStrue
Reserved (X)true
FacilityCode3757 (0xead)
Error Code48879 (0xbeef)

Questions

88votes
6answers

What does <value optimized out> mean in gdb?

(gdb) n 134 a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; (gdb) n (gdb) p a $30 = <value optimized out> (gdb) p b $31 = <value optimized out> (gdb) p c $32 = 3735928563 How can gdb optimize out my value?? read more
gdb
42votes
12answers

0xDEADBEEF equivalent for 64-bit development?

For C++ development for 32-bit systems (be it Linux, Mac OS or Windows, PowerPC or x86) I have initialised pointers that would otherwise be undefined (e.g. they can not immediately get a proper value) like so: int *pInt = reinterpret_cast<int *>(0xDEADBEEF); (To save typing and being DRY the right-hand side [...] read more
c++
debugging
64-bit
defensive-programming
22votes
3answers

Getting information from an armored gpg public key file

When given a file with an armored public GnuPG key, i.e. a file (pubkey.gpg) that was created with: gpg -r 0xDEADBEEF --export --armored > pubkey.gpg What is the best way to get information such as the finger print in that file, without importing it into my keyring? The best way [...] read more
linux
gnupg
gnu
17votes
3answers

How can I access volume levels from the command line on Windows 7?

WHAT I NEED I'm looking for a tool or a script that allows me to access the Windows volume levels from the command line. Ideally it would allow me to get and set all volumes including application levels, but I'd settle for only getting, and only the master level. I [...] read more
windows-7
command-line
audio
script
cygwin
17votes
1answer

Bluetooth device discovery in Android -- startDiscovery()

Goal: Build an Android app that discovers the names and addresses of BT devices within range and submits their values to a webservice. BT devices have not been previously bonded to the host device, I just want to poll everything as I walk about. What I've done: 1. Pored over [...] read more
android
android-intent
bluetooth
android-adapter
android-context
14votes
1answer

Handling calls to (potentially) far away ahead-of-time compiled functions from JITed code

This question was put on hold as too broad, presumably because of the research I included in an effort to "show my work" instead of asking a low effort question. To remedy this, allow me to summarize the entire question in a single sentence (credit to @PeterCordes for this phrase): [...] read more
assembly
rust
compiler-construction
x86-64
jit
4votes
1answer

Why does an 8-byte array (C) in 64-bit Ubuntu take 16 bytes?

I've recently been (relearning) lower level CS material and I've been exploring buffer overflows. I created a basic C program that has an 8-byte array char buffer[8];. I then used GDB to explore and disassemble the program and step through its execution. I'm on a 64-bit version of Ubuntu, and [...] read more
c
64-bit
x86-64
32bit-64bit
sizeof
3votes
2answers

Enabling AES-encrypted single sign-on to Apache in a Win2008 domain

All of the tutorials I could find on setting up single-sign on into an Apache-hosted website using Active Directory authentication do so by configuring Kerberos with insecure settings. It's been best practice for awhile now to disable RC4-HMAC encryption for Kerberos in Active Directory, but a lot of tutorials call [...] read more
linux
apache-2.2
windows-server-2008
active-directory
kerberos
3votes
1answer

What are the possible reasons for registers to be offset by 1 in GDB?

The microcontroller is an STM32 F767ZI, which contains a 32 bit ARM Cortex M7 When setting values to the registers, the registers all appear to be offset by 1. For example, the following code: core.S .syntax unified .cpu cortex-m7 .fpu softvfp .thumb // Global memory locations .global vtable .global reset_handler [...] read more
assembly
arm
gdb
gnu
cortex-m
3votes
1answer

How to use rdpmc instruction for counting L1d cache miss?

I am wondering is there any single event that can capture the L1D cache misses. I tried to capture L1d cache miss by measuring latency to access specific memory with rdtsc at the beginning. On my setting, if the L1d cache miss happens, it should hit L2 cache. Therefore I [...] read more
assembly
x86
perf
intel-pmu
3votes
0answers

What happens when you seek past the end of a file opened for writing?

I have a binary data-set of known size that arrives in fixed-sized chunks. The chunks are out of order, but their position in the final result is known when I get them. Here is a simple example: from random import sample, seed import numpy as np chunk_size = 10 chunk_count [...] read more
python
seek
2votes
1answer

tcpdump default capture size differs on similar servers

Running /usr/sbin/tcpdump -n dst ${some_ip} and dst port 80 on two different but similar (distro, version) servers gives me different capture sizes (65535 bytes for one, 262144 bytes for another). What might cause this difference in tcpdump capture size? What discrepencies might it cause in resulting data output? EDIT: ldd [...] read more
linux
networking
linux-networking
tcpdump
2votes
0answers

Should or shouldn't I mask the results of XGETBV before using them for XSETBV?

I am trying to execute some UEFI applications. I found this code crashes on VirtualBox (test success is not printed while test start is printed): #include <stdint.h> void* ConOut; uint64_t (*OutputString)(void* protocol, void* string); void printChar(int c) { unsigned char data[4] = { (unsigned char)c }; if (c == '\n') [...] read more
x86
x86-64
avx
bare-metal
2votes
1answer

Can a field in react-final-form mark itself as invalid / prevent submission?

I have a custom file upload field that uploads files immediately once you select/drop them, and returns a UUID for later submission. So, basically what most webapps do nowadays (e.g. Facebook, Twitter, etc.) when you drop a file. This is all easy enough to handle with final-form - my field [...] read more
javascript
react-final-form
final-form
2votes
1answer

What is the process for generating a bare metal binary with MSVC tools?

What is the process for generating a bare metal binary with MSVC tools? In GNU land, you cc compile or as assemble the sources into object files, ld link the object files into an ELF (with a linker script) and then objcopy the relevant sections out of the ELF as [...] read more
windows
visual-studio
arm64
firmware
bare-metal
2votes
1answer

How to send data through UART of LM3S811

I am learning bare-metal programming, I tried to send data out through the UART of LM3S811 in Qemu. But it did not print any characters in the terminal. I have provided the .c file and the linker script. It would help if there are any links to learn bare-metal Programming [...] read more
assembly
arm
microcontroller
microprocessors
2votes
1answer

Prove a function is surjective using Z3

I'm trying to understand how to prove efficiently using Z3 that a somewhat simple function f : u32 -> u32 is bijective: def f(n): for i in range(10): n *= 3 n &= 0xFFFFFFFF # Let's treat this like a 4 byte unsigned number n ^= 0xDEADBEEF return n I [...] read more
z3
z3py
2votes
0answers

How to use std::atomic for registers with fixed address

As far as I understand it std::atomic<uint32_t> foo will create an atomic variable for me, but the actual memory location will be decided by the linker. On the other hand std::atomic<uint32_t*> bar will create an atomic pointer, i.e. the pointer itself is protected, but not the target it points to. [...] read more
c++
multithreading
c++11
atomicity
2votes
1answer

gdb won't load shared libs symbols, not even libc.so (musl), when loading a core file

I'm trying to debug a program running remotely on a board with a MIPS cpu, using musl for its libc. If I start gdbserver on the board, set the sysroot via set sysroot /path/to/sysroot and connect live from gdb, I get a meaningful stack trace (which took hours of effort [...] read more
linux
debugging
gdb
mips
musl
2votes
1answer

GNU LD filling unused space

I'm trying to understand the behaviour of the GNU linker and how sections are treated. I'm editing the stm32_flash.ld file in this stm32 project. When I modify the linker script to put the following as the first section: .my_test : { . = ALIGN(4); KEEP(*(.my_test)) LONG(0xdeadbeef); . = ALIGN(4); } [...] read more
linker
ld
2votes
0answers

Why does Visual C++ 2019 allow left operand (lvalue) casting of the assignment operator?

Working on a project that must run in Visual C++ and GCC Before understanding that lvalue casting of the assignment operator in C is not allowed, I was writing code like this in VC++: typedef uint64_t QWORD; QWORD A = 0xdeadbeef, T = 0; (char)A = T; Notice the (char)A [...] read more
c++
c
visual-studio
gcc
lvalue
2votes
1answer

Verification of a CRC checksum against zero

I had some contact with the CRC-16 checksum in the past and was accustomed to verifying it by recalculating the CRC-16 checksum over the file I want to verify, plus the 2 bytes of the CRC-16 itself. If the result was zero, then the file integrity was valid, otherwise not. [...] read more
c
checksum
crc
crc32
crc16
2votes
1answer

why bits/libc-header-start.h folder is included in stdio.h header

I am unable to compile to c program for 32bit machine from 64bit linux machine using command gcc -m32 -Werror a.c -o a It shows me the error In file included from a.c:1: /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory #include <bits/libc-header-start.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. I check the [...] read more
c
linux
gcc
glibc
2votes
1answer

How do I cast to a templated type?

In gdb, if you have a pointer to something, you can cast it before printing it. For example, this works: print *(int*) 0xDEADBEEF However, how do I print a std::vector<T>? Specifically a std::vector<std::string>? If it's std::string, I can do it with std::__cxx11::string, which whatis std::string outputs, but I can't convince [...] read more
gdb
1vote
2answers

How do I deploy my own GPG keyserver?

I would like to set up a read-only key-server operating by me where I am going to publish my own keys. So that anyone could do gpg --keyserver example.mymedia.su --receive-keys 0xDEADBEEF and get the key. Is it some sort of HTTP server? Is it enough to just put static files [...] read more
gnupg
1vote
0answers

ethernet interface on Linux drops packets

I'm trying to capture some Ethernet frames with Linux. Some of these packets/frames are invalid and contain corrupted data. For example an Ethernet frame contains the type 0x0800 which is IPv4, but the following data contain just random bytes. Furthermore, the source and destination MAC are unknown and not predictable. [...] read more
linux
ethernet
sockets
linux-device-driver
pcap
1vote
1answer

OS X Mountain Lion Crashes When Installs Xcode

So I just recently upgraded to Mountain Lion and so I needed to upgrade Xcode to the newest version. Well everything was going fine during the download but then about 1 minute after it started installing my computer just instantly crashed and rebooted. When I got back into OS X, [...] read more
crash
osx-mountain-lion
xcode
1vote
2answers

Using std::memmove to work around strict aliasing?

Can std::memmove() be used to "move" the memory to the same location to be able to alias it using different types? For example: #include <cstring> #include <cstdint> #include <iomanip> #include <iostream> struct Parts { std::uint16_t v[2u]; }; static_assert(sizeof(Parts) == sizeof(std::uint32_t), ""); static_assert(alignof(Parts) <= alignof(std::uint32_t), ""); int main() { std::uint32_t u [...] read more
c++
undefined-behavior
strict-aliasing
memmove
1vote
3answers

Why does the double conversion of some integers (to float and back to int) not remain equal to its original number, yet some do?

I have two integer variables: int i1 = 0xdeadbeef and int i2 = 0xffffbeef. (11011110101011011011111011101111 or 37359285591 and 111111111111111110111110111011111 or 4294950639 respectively). -------------------------------------------------------------------------------- (int) (float) i1 == i1 evaluates as false, yet (int) (float) i2 == i2 evaluates as true. Why is this? In this system, both ints and floats [...] read more
c
integer
hex
1vote
1answer

How compiler handles a non-zero null pointer value in C?

This answer properly explains about null pointers. In the last paragraph under Null Pointers it says > If the underlying architecture has a null pointer value defined as address > 0xDEADBEEF, then it is up to the compiler to sort this mess out. Now if some architecture internally defines Null [...] read more
c
null
compiler-construction
literals
null-pointer
1vote
1answer

Interrupt handler chaining in real mode

I'm trying to hook BIOS Int 13h to add my custom functionality to it and hijack some of existing one. Old Int 13h vector is stored in global variable. When interrupt handler is called the DS is set to some value that doesn't match the original data segment of caller. [...] read more
c
assembly
interrupt-handling
tasm
real-mode
1vote
1answer

Is this a POSIX-compliant implementation for handling signals such as SIGFPE, SIGSEGV, etc. in a multithreaded program?

I'm developing a program that needs to handle crash signals. By crash signal, I mean signals "delivered as a consequence of a hardware exception" [1], such as SIGFPE and SIGSEGV. I haven't found a specific name that describes this signal category, so I'm coming up with this one for clarity [...] read more
c++
pthreads
signals
posix
1vote
0answers

Shellcode crashing target PE

I am currently attempting to patch a target x86 PE file from the disk with a tool, patch.exe. purpose The purpose of this tool will be to eventually write/insert a multi-function payload into the target executable, who's purpose is to track the position of certain frames inside a game which [...] read more
c
portable-executable
shellcode
1vote
1answer

Javascript Warning: Unexpected mix of '^' and '>>>' no-mixed-operators

I recently integrated this hash function into my react web app, here is the code: const cyrb53 = function(str, seed = 0) { let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed; for (let i = 0, ch; i < str.length; i++) { ch = str.charCodeAt(i); h1 = [...] read more
javascript
reactjs
binary
1vote
0answers

gdb opaque symbol resolution turned off

When inter-procedural-analysis optimization (compiler flag) is enabled, the struct debug symbols (opaque-symbol-resolution) does not work. Any one knows why? Is it possible to have this optimization enabled but not lose this convenient debug capability? typedef struct mystruct { int a; char b; } mystruct_t; Without ipa enabled, (gdb) p /x [...] read more
debugging
gdb
compiler-optimization
debug-symbols
1vote
0answers

Multi-threaded reference counting

I was just thinking about multi-threaded reference counting, searched for it and found many posts, that basicly only mention the problem of atomicity, many answers even here on stackoverflow miss the actual problems involved in multi-threaded reference counting. So what's the fundamental problem. Let's assume an object type with a [...] read more
multithreading
reference
1vote
0answers

How to get emacs calc to recognize System Verilog formatted numbers

System verilog allows numeric constants like this: 32'hdead_beef this is equivalent to the c value of 0xdeadbeef System verilog allows the bit width to be defined as well as the base. In general it is <bit-width-in-decimal>'<base><digits-and-underscore> <base> can be: * 'd' for decimal * 'h' for hexadecimal * 'o' for [...] read more
emacs
1vote
1answer

Passing a pointer to a function but the pointer remains unchanged

I have created the following two files to illustrate what my problem is. main.c #include <gtk/gtk.h> #include "app_struct.h" static void activation(GtkApplication *app, gpointer user_data); static void check_file(GFile *file); int main(int argc, char **argv) { int status; GtkApplication *test = gtk_application_new("idk.for.now.test", G_APPLICATION_FLAGS_NONE); g_signal_connect(test, "activate", G_CALLBACK(activation), NULL); status = g_application_run(G_APPLICATION(test), argc, argv); [...] read more
c
pointers
gtk
gtk3
1vote
1answer

Unable to get QEMU to boot my bootloader after linking a C file

I am trying to link some C code into a bootloader that I have made, However after doing that, I'm not able to get QEMU to boot my raw file attached are the relevant parts of the bootloader, the makefile and linker scripts. EDIT: QEMU gives a "not a bootable [...] read more
assembly
operating-system
x86-16
bootloader
1vote
0answers

gdb: watchpoint with -l flag vs address

I was trying to set a breakpoint on a heap struct variable programmatically: when a function is called, set a watchpoint to the memory pointed by one of its arguments. However, doing awatch *0xDEADBEEF, as expected watches when the struct is used explicitly; awatch *(my_struct*)0xDEADBEEF watches whenever something writes in [...] read more
debugging
gdb
adb
xdebug
gdbserver
1vote
0answers

How to properly capture output of process using pwntools

I'm currently confused on how to use the pwntools library for python3 for exploiting programs - mainly sending the input into a vulnerable program. This is my current python script. from pwn import * def executeVuln(): vulnBin = process("./buf2", stdin=PIPE, stdout=PIPE) vulnBin.sendlineafter(': ','A'*90) output = vulnBin.recvline(timeout=5) print(output) executeVuln() The program [...] read more
python
exploit
pwntools
1vote
1answer

Constructing array literal as input for PL/pgSQL function

How should an array with elements of a composite type be included in a function call? After consulting the resources online and attempting the different variants, I continue to get parser errors. Below I've included the types, tables, functions, and execution attempts. Type CREATE TYPE jobs_v0.insertable_program AS ( handle text, [...] read more
postgresql
plpgsql
composite-types
1vote
3answers

C unions and undefined behaviour

In the following example code, is there any undefined or implementation defined behavior? Can I assign a value to one member of a union and read it back from another? #include <stdio.h> #include <stdint.h> struct POINT { union { float Position[3]; struct { float X, Y, Z; }; }; }; [...] read more
c
union
undefined-behavior
1vote
1answer

Function of retval in pthread_join

I'm learning threading in C in OS. I don't know why following code is giving me segmentation fault. Can anyone help me here? I am also confused a bit about how pthread_join uses its argument void ** retval. What is its function? #include <pthread.h> #include <stdio.h> #include <stdlib.h> void *thread [...] read more
c
operating-system
pthreads
1vote
1answer

Setting Include Paths When Building Kernel Modules

I'm trying to compile a kernel module for Linux. I have the following files: testuio.c and Makefile. When I type make all I get the following errors: $ make all make -C /lib/modules/`uname -r`/build M=/srv/dev-disk-by-label-tboWolfRaid/home/alex/ma/source/kernel_modules/memory modules make[1]: Entering directory '/usr/src/linux-headers-5.4.0-0.bpo.2-amd64' CC [M] /srv/dev-disk-by-label-tboWolfRaid/home/alex/ma/source/kernel_modules/memory/testuio.o In file included from /usr/include/unistd.h:25, from /srv/dev-disk-by-label-tboWolfRaid/home/alex/ma/source/kernel_modules/memory/testuio.c:13: [...] read more
gcc
makefile
linux-kernel
kernel-module
kbuild
1vote
1answer

GDB: Initialize memory with fixed value

In my code I have somewhere an uninitialized pointer that seems to get freed. The project is quite large and I cannot find the value. The problem is: once I attach a debugger, memory seems to be initialized with zero causing the pointer to be NULL and free not causing [...] read more
debugging
gdb
1vote
1answer

FIO repeatable buffer fill

Is it possible to have a pseudo-random buffer fill pattern using FIO? ie, the fill pattern for a block would incorporate a seed + block number or offset into a pseudo-random fill generator. This way the entire fill data could be 100% repeatable and verifiable, but more varied than the [...] read more
linux
io
1vote
2answers

Can two consecutive memory_order_release stores on the same thread be reordered with each other?

Can two consecutive memory_order_release stores on the same thread be reordered with each other? Either from the perspective of the same thread or a different thread loading them? The documentation on CPP reference says: > A store operation with this memory order performs the release operation: no > reads or [...] read more
c++
multithreading
memory-barriers
memory-model
stdatomic
1vote
2answers

In GDB, can you set memory as if it were a char array?

Say for instance I have a 32 element unsigned char array at address 0xdeadbeef. I would like to overwrite the contents of the array in memory. I am not compiled with -g, and so cannot just do a "set [variable name] = [my value]". Is it possible to set the [...] read more
c
arrays
gdb
1vote
0answers

Stack frame preparation

In order to improve my binary exploitation skills, and deepen my understanding in low level environments I tried solving challenges in pwnable.kr, The third challenge- called bof has the following C code: #include <stdio.h> #include <string.h> #include <stdlib.h> void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme); // smash [...] read more
c
compilation
stack
stack-frame
1vote
1answer

Why does operator () with type argument can be applied to type in the context of result_of?

As fas as I understand, result_of_t should be a type, that will be at the end of the evaluation of an expression. decltype(&foo) in the code below yields the type int (*)(int), but what does (int) outside of decltype? #include <type_traits> int foo(int) { return 0xdeadbeef; } int main() { [...] read more
c++
decltype
result-of
1vote
3answers

MinGW64 bit field access across word-boundaries is wrong

I'm investigation how different compilers handle unaligned access of structure bitfields members as well as members that cross the primitive types' boundaries, and I think MinGW64 is bugged. My test program is: #include <stdint.h> #include <stdio.h> /* Structure for testing element access The crux is the ISO C99 6.7.2.1p10 item: [...] read more
c
gcc
struct
mingw-w64
bit-fields
1vote
1answer

Using a float in Javascript in a hash function

I Have a hash function like this. class Hash { static rotate (x, b) { return (x << b) ^ (x >> (32-b)); } static pcg (a) { let b = a; for (let i = 0; i < 3; i++) { a = Hash.rotate((a^0xcafebabe) + (b^0xfaceb00c), 23); b = [...] read more
javascript
floating-point
type-conversion
integer
hash-function
1vote
2answers

Initialize constexpr array with template functions

I am trying to create a constexpr std::array with precompiled handler functions for my emulator. The code below works just fine for smaller numbers like 0x250, but everything above causes a 'C1026 parser overflow, program too complex' when used with the recent version of MSVC. #include <array> #include <iostream> template<typename [...] read more
c++
variadic-templates
template-meta-programming
constexpr
stdarray
1vote
1answer

Boost Graph Library cannot store references to other vertices?

I'm using BGL to build a graph storing bundled vertices where one type of vertex stores a reference to the other vertex type. Both types are handled using std::variant: struct simple_node_t { size_t enabled; }; struct complex_node_t { bool foo1; size_t foo2; simple_node_t& control; }; using vertex_t = std::variant<simple_node_t, complex_node_t>; [...] read more
c++
boost
graph
boost-graph
0votes
0answers

WIFI 6 Card not working even though the computer detects it and up to date drivers are installed

I have run into a dead end here. I am trying to install an Intel AX200 WIFI + Bluetooth network card onto my desktop PC. I connected it to a PCIe port that had more slots than needed but I read that this should be fine. Additionally, a cable from [...] read more
wireless-networking
drivers
network-adapter
computer-building
0votes
1answer

.struct directive of GNU Assembler - How to instantiate a class instance?

I'm trying to create an object-oriented class using GNU assembly for educational purposes. I have many questions regarding the use of the .struct directive: 1. It is said that this directive switch the code to the absolute section. Why is it named .struct then? Does it have anything to do [...] read more
linux
struct
memory-management
x86-64
gnu-assembler
0votes
0answers

Creating single variable to consolidate multiple classes

I have a dictionary (dict1) dict1={ 'lala':{ 'name':'lala', 'lula':0xcafecafe, }, 'mene':{ 'name':'mene', 'lula':0xdeadbeef, },} After that i created a register class to parse in the information class register: def __init__(self,name): self.name = dict1[name].get('name') self.data = dict1[name].get('lula') def self_add(self): value = self.data + self.data print('self_add value : {}'.format(value)) and create a [...] read more
python
0votes
1answer

Quickly finding array element by pointer

I have an array of strings where each string can also be clearly identified by a unique pointer assigned to it. The order of the elements in that array often changes, for example because of sorting. I want to be able to quickly find the numeric index of an array [...] read more
c++
arrays
algorithm
0votes
2answers

Weird UC3 Reset behavior after user page NVRAM usage

I recently need to use in build NVRAM/EEPROM of AT32UC3L0256 to store some configuration data. I finally managed to use the user page NVRAM of the MCU (after days of trial and error and cursing on GCC ignoring noinit directives and fixing and workarounding bugs in ASF as usual) to [...] read more
c++
reset
bootloader
avr32
atmel-uc3
0votes
1answer

Why use cat to open interactive shell?

(Asking again without the download link) Problem Description Nana told me that buffer overflow is one of the most common software vulnerability. Is that true? bof.c #include <stdio.h> #include <string.h> #include <stdlib.h> void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme); // smash me! if(key == 0xcafebabe){ system("/bin/sh"); } [...] read more
c
bash
terminal
ctf
pwntools
0votes
1answer

Process_vm_readv Returning Random Values

I am trying to use the process_vm_readv systemcall to read a value from another Linux process. When attempting to read a magic number at a known location, I receive a random value. I have tried writing two simple programs to see if I can get it working but I have [...] read more
c++
linux
memory
0votes
0answers

Linux custom device driver probe and init functions are not being called

I have built a custom hardware configuration in Vivado for Xilinx SoC board, and used petalinux to create a custom driver to control the hardware logic. It seems like after running insmod command, the driver is never initialized and the ->probe() function is not called. I am new to this [...] read more
linux
linux-device-driver
xilinx
vivado
petalinux
0votes
0answers

Why does a GDB watchpoint not trigger when cast to std::array's value type?

Using GDB 10.1, I set a watchpoint like this on std::array<Data, 1024> m_slots: (gdb) print &m_slots[0] $1 = (std::array<Data, 1024>::value_type *) 0xdeadbeef (gdb) watch *(Data*) 0xdeadbeef where Data is a struct. GDB can print sizeof(Data) = 32 and successfully sets the (hardware) watchpoint. The watchpoint fires when the object is [...] read more
c++
gdb
watchpoint
0votes
0answers

iwlwifi drivers not loading for ax200 in MX linux

Kernel is 5.8, wifi driver is the intel iwlwifi version for ax200 requiring a kernel of at least 5.1 and the wifi card appears in lspci -k but nothing I've tried is working as I can't find any documentation from intel surrounding this or any other thread someone has asked, [...] read more
linux-kernel
driver
intel
firmware
0votes
0answers

Union casting initialization and referencing internal structures

I'm trying to work with low level types like floats and doubles, in a program where they are 'encrypted' however, when I tried to create a structure that looked like this: struct rgba { float r, g, b, a; }; //and reference it like this: rgba color; reinterpret_cast<uint64_t>(color.a) ^= 0xDEADBEEF; [...] read more
c++
unions
c++20
0votes
1answer

Weird Bug when setting register in assembly

I was playing with blue pill (Stm32F103CB) and trying to set r7 register via assembly, .syntax unified .cpu cortex-m3 .fpu softvfp .thumb .global vtable .global reset_handler .type vtable, %object vtable: .word _estack .word reset_handler .size vtable, .-vtable .type reset_handler, %function reset_handler: LDR r0, =_estack MOV sp, r0 LDR r7, =0xDEADBEEF [...] read more
assembly
arm
stm32
bluepill
0votes
0answers

RISC-V Platform IO Debug not working (Mac OS)

I am using RISC-V Board Dev B and platform IO on Mac OS but debug is not working with some errors even though I successfully built and uploaded the project. Anyone can help this out? I will be appreciate if you can solve this problem. I tried to change the [...] read more
riscv
platformio
0votes
2answers

What does CMP dword ptr [EBP + local_c],0xdeadbeef mean?

Can somebody please explain what does CMP dword ptr [EBP + local_c], 0xdeadbeef means. As far as I understand it compare the EBP+local_c location value with 0xdeadbeef, but I am not sure if that is true. Thanks in advance read more
assembly
x86
0votes
0answers

angr: Add constraint on load address to state

This question pertains to the symbolic execution platform angr. Particularly, I want to ask two questions: 1. How to find a symbolic expression for the address operand of a load instruction? 2. How to add a constraint to a state, where the aforementioned address is a known value? To give [...] read more
python
symbolic-math
angr
0votes
1answer

Struct initialisation list is zero-ed instead of initialised to values

I'd say I'm decent in C++, however I'm very new to linker scripts and I'm not quite sure what I'm doing wrong. First off all, this is my linker script: ENTRY(ISR_Reset) MEMORY { FLASH (rx) : ORIGIN = 0x80000, LENGTH = 128K RAM (rwx) : ORIGIN = 0x20000000 LENGTH = [...] read more
c++
optimization
linker
arm
embedded
0votes
1answer

Redirect a function to subroutine using

If I want to redirect execution to another function in assembly, I can do something like this: push 0deadbeefh ; function pointer to some random function ret But lets say, in C void* func_ptr = (void*) 0xdeadbeef; Assuming I have the above variable storing a function pointer to a random [...] read more
assembly
0votes
1answer

How can I ask Mac OS to allocate memory at a specific address?

On Linux, you can allocate memory at a specific address like so: void *foo = (void *)0xDEADBEEF; size_t MyLength = 1024; void *bar = mmap(foo, MyLength, PROT_READ | PROT_WRITE | MAP_ANONYMOUS | MAP_FIXED, MAP_PRIVATE, -1, 0); Is this same method also possible on Mac OS, or if not, how does [...] read more
macos
memory
0votes
1answer

Simple ROP chain with 2 arguments to the function

I'm practicing with ROPchain and I have a very simple program, where I'm unable to call the 'vulnerable' function successfully: #include <stdio.h> #include <string.h> #include <stdlib.h> void vuln(int a, int b) { if (a == 0xdeadbeef && b == 231) { system("/bin/sh\00"); } } int main() { char buf[32]; printf("Input: [...] read more
c
binary
buffer-overflow
exploit
0votes
1answer

How to set magic pointer values on arbitrary pointer types

I have an application in which I've experienced some rare segmentation faults due to nullptr dereferences. The pointer values in the application follow a pretty standard life cycle: 1. I initialize them to nullptr. 2. They get set to a value at some point early on when information becomes available [...] read more
c++
pointers
lifetime
0votes
0answers

why does pointer memory command not working

I am trying to follow this basic program involving pointer into the memory. At first We define counter to be 0 (outside main) then we make p_int to point at the same address as a counter. But when i go into the loop for some reason it compares the register [...] read more
c
pointers
assembly
arm
main
0votes
2answers

Visual Studio natvis displaying pointer-to-interface

I'm trying to create debug visualizers for our company custom smart pointers. I would like to use ExpandItem to get the contents just one level down, which works for concrete types like ref_ptr<Vector2d>, but not for virtual types like ref_ptr<IStreamManager>. When using the virtual types, I get two entries, one [...] read more
visual-studio
debuggervisualizer
natvis
0votes
1answer

Eclipse MCU J-Link Debugger Crash on ldrb r3, [r7, #8]. Addresses are valid - [Edit - Hardware Issue]

[Edit] This turned out to be a hardware issue. A separate thread was turning on a radio power amplifier, & my Power supply current limit was tripping. The other thread was always activating exactly when this instruction was executing] I'm struggling with this crash when debugging my project. The CPU [...] read more
eclipse
arm
segger-jlink
0votes
0answers

Write registers data into array using asm C

I created a program that writes registers data into variables using asm. And it seems to be working well. But then I decided to replace variables by an array and to write registers data into an array. I used the same approach, but noticed that when I'm printing variables and [...] read more
c
gcc
assembly
inline-assembly
cpu-registers
0votes
1answer

Why does this exploit require two separate payload injections rather than one?

I am new to binary exploitation problems. This one comes from picoctf 2019, leap-frog. The particular solution I'm interested in uses a buffer overflow on the vuln() function to force execution to return to gets' PLT entry. This is done because gets allows us to write to an arbitrary place [...] read more
c
exploit
gets
ctf
0votes
0answers

Read word value (hex) of float

Say I have a float I'd like to get the word value of: float f = 42.0f; // 0xDEADBEEF There are two options I know of. 1. Type-pun with std::cout << *(int*)&f; This is undefined behavior, and I don't care to use a char* as an exception (as shown here: [...] read more
c++
c
undefined-behavior
c++98
strict-aliasing
0votes
1answer

Is bitset the right container to manipulate big data then move the results into memory?

I am trying to generate a 512bit pattern where the word 0xdeadbeef keeps rotating (shifted left by one) across the 512bits, each time I want to right the data to memory. Baiscally, 0xffffffff.......deadbeefffffffff (512 bits total). Keep shifting the deadbeef part by one and after each time write the whole [...] read more
c++
memory
bitset
0votes
1answer

How to return or export result of function javascript from service file to use in another file

Function Of Service export const deviceInfoRequest = async (callback) => { var request = new DeviceInfoMessage(); var AuthToken = 'ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'; client.deviceInfo(request, {'x-authorization': AuthToken}, (err, response) => { var dataDevicename = response.getDevicename(); var dataDeviceid = response.getDeviceid(); console.log("DeviceName==>>>>",dataDevicename); console.log("DeviceId==>>>>",dataDeviceid); this.callback(dataDevicename,dataDeviceid); }); } =======> Result of "console.log"=="DeviceName== test" and "DeviceId==>>>> 0xdeadbeef". Function Of [...] read more
javascript
reactjs
return
export
0votes
1answer

Stuck at hacking challenge in C (Stack buffer overflow)

I'm trying to overrun this buffer. I ran it like this: command here, but the value is not correct. I tried various inputs with which I actually overran the buffer but instead of my expected value of the check variable 0xdeadbeef the value is something like this: 0x73737373. What am [...] read more
c
linux
0votes
0answers

Mock a sequence of calls to different methods

I want to unit test a class that reads data from a stream in a certain protocol. This will require different read() Methods on the stream in a certain order. Is there a way to mock the stream like this: MyClass readFrom(InputStream in) { byte b = in.readByte(); int c [...] read more
java
mocking
mockito
0votes
1answer

How to put mongodb sessions in creachadair/jrpc2 Handlers

I want to build a microservice that uses jrpc2 and mongodb to manage small IoT devices. These are the libraries in question: https://godoc.org/bitbucket.org/creachadair/jrpc2 https://godoc.org/github.com/globalsign/mgo The problem is, being rather new to Golang in general, I'm not sure how to combine these things together. Here's the code I have: func DeviceAdd(ctx [...] read more
mongodb
go
json-rpc
0votes
1answer

Get around involuntary typing of columns in CSV file when using for unit test

I am using a CSV file to inject data into my test. [TestMethod] [DataSource( CsvData, CsvDir + "TC177023.csv", "TC177023#csv", SEQ )] The file looks somethings like this: (other strings removed) something,something,Value,something,something,something ,,0xDEADBEEF,, ,,-12,, ,,0,, ,,0,, ,,0,, I have one column that I have integers in and I wanted to extend [...] read more
c#
unit-testing
mstest
0votes
1answer

Precise details of writing a byte into PCIe address space from CPU

I am extremely confused about the exact series of steps involved in having the CPU write a value into a PCIe card's memory. It's very difficult to understand the precise meaning of stuff you read on the internet, so I'm hoping someone can read my theory of what's happening and [...] read more
linux
pci-e
0votes
1answer

Integer within C binary: viewing it using readelf, objdump or similar

I have the following C source file, hello.c, compiled on linux via g++ -o hello hello.c: #include <stdio.h> const char* p = "Hello world"; const long nn = 0xDEADBEEF; int main() { printf("%s %ld", p, nn); return -1; } (Yes I know I am using g++ for C but that [...] read more
c
linux
objdump
readelf
0votes
1answer

Creating a bitfield class that points to arbitrary data- is this safe?

Context I am creating a Bitfield class that is responsible for providing access to a contiguous set of bits in a UInt32. The source data is not managed by the Bitfield, but instead another object. In practice, the same object that owns the source data will also own any Bitfield [...] read more
c#
pointers
0votes
1answer

Scripting a repetitive gdb job

I want to do the same repetitive job in gdb across a bunch of different files. Namely, bash$ gdb ./file1 ... gdb starts up ... gdb$ b *0xdeadbeef gdb$ r < file2 ... some output prints ... gdb$ x/3a $esp ... some addresses print ... Is there some way I [...] read more
c
bash
gdb
0votes
1answer

why char* takes 4 bytes instead of 1 byte

I wrote a program to find endianness of a system. It doesnt work as the pointer value is 0xffffffef instead of 0xef. Why is the pointer value 0xffffffef? I declared it as a char* which should take only 1 byte. I can fix the problem by *ptr&0xff but I don't [...] read more
c
0votes
0answers

Is there a readable pattern for creating nested Protobuf messages in C++?

I'm new to Protobuf and would like to know if there is a good pattern for creating protobuf messages that results in readable code. You can do it like this: message.mutable_foo()->mutable_bar()->mutable_gazoo->set_gronk(4711); message.mutable_foo()->mutable_bar()->mutable_gazoo->set_grunk(0xdeadbeef); message.mutable_foo()->mutable_bar()->mutable_spunk->set_snafu("Boink!"); Or like this: auto foo = message.mutable_foo(); auto bar = foo->mutable_bar(); auto gazoo = bar->mutable_gazoo(); gazoo->set_gronk(4711); gazoo->set_grunk(0xdeadbeef); [...] read more
c++
protocol-buffers
0votes
1answer

Why do my PCI-e I/O register reads appear to be cached?

I have a PCI-e hardware device that has a number of registers that I want to read from and write to. However, when I read a register, I will get a value from a previous read (the first read returns 0xFFFFFFFF). I'm using pci_iomap() to get the base address of [...] read more
c
linux
io
linux-device-driver
pci-e
0votes
2answers

How are stack pointers converted from virtual to physical memory

I've been working with a lot of assembly, and reviewing virtual memory I've run into some new confusion. Briefly, I don't understand how an address in assembly, the code that interfaces with the processor directly, could be converted from a virtual address to a physical address. I was always told [...] read more
assembly
paging
virtual-memory
0votes
0answers

STM32 uC after exit DFU mode does not return to normal but has breakpoints

I'm entering the DFU mode of the STM32 without using the Boot0 physical pin. I do this by sending a command via the UART and switch the uC to DFU mode. I'm using the STM32F042G6U6. But it doesn't restart when I use the ST tools to exit from DFU mode. [...] read more
c
embedded
stm32
0votes
1answer

How to perform a specific buffer overflow bypassing a length check

I'm trying to perform a bufferoverflow so that a variable (type) has a specific value in it. I struggle with the strlen & check for my input. I tried using something like: 'AAAAA\x00AAA...A\x00\xbc\xd4\xb9' for tricking the strlen check that my input is just 5 A's long. But something strips my [...] read more
c
gdb
buffer-overflow
strlen
0votes
2answers

Unexpected typecasting between values in C

I have a snippet of C code unsigned int x = 0xDEADBEEF; unsigned short y = 0xFFFF; signed int z = -1; if (x > (signed short) y) printf("Hello"); if (x > z) printf("World"); I wanted to know if the comparison in the first statement evaluates to DEADBEEF > FFFFFFFF [...] read more
c
casting
type-conversion
0votes
2answers

Vivado/XSDK: How to access address from Zynq M_AXI_GP0 Bus?

Let's say I built a vivado Zynq FPGA project, and I want to write and read the Zynq's "M_AXI_GP0" port from a c-program running on the zynq as follows. Further, let's suppose the address I want to read and write on the "M_AXI_GP0" port of the Zynq is address "0x000A1000". [...] read more
c
fpga
xilinx
vivado
bare-metal
0votes
0answers

What does '.() at 0xdeadbeef' mean in a (core file) stacktrace generated by dbx on AIX?

I'm running some tests on AIX, and I'm getting a bunch of crashes similar to the following: build 25-May-2019 18:40:46 Segmentation fault in ThreadSafeSharedObject_cpp::ChangeRefCount(unsigned int&,int) at line 21 in file "" ($t8) build 25-May-2019 18:40:46 Thread $t1 build 25-May-2019 18:40:46 glinkl.pthread_mutex_unlock() at 0xd5d4baac build 25-May-2019 18:40:46 BlockingResponseQueue.Simba::Support::CriticalSection::Leave() const(0x2055a320), line 54 [...] read more
c++
multithreading
crash
aix
dbx
-1votes
1answer

Suitable IPC between a C++ DLL (local hooks) and C# application

Whats the best inter-process communication for a C++ DLL that's injected into a third-party process and a C# application? Here's the current situation: // This gets executed within the target process memory region LRESULT CALLBACK HookProc(int code, WPARAM wParam, LPARAM lParam) { if (code > 0) { auto csharpApplicationFunctionPointerAddress = [...] read more
c++
com
hook
ipc
rpc
-1votes
1answer

Function that returns address of local variable acts differently with different versions of gcc?

I wrote this code and found that it acts differently with different versions of gcc. The source code, #include<stdio.h> int *fun(); int main(int argc, char *argv[]) { int *ptr; ptr = fun(); printf("%x", *ptr); } int *fun() { int *ptr; int foo = 0xdeadbeef; ptr = &foo; return ptr; } [...] read more
c
assembly
gcc
segmentation-fault
undefined-behavior
-1votes
1answer

"0xDEADBEEF" - Signed or Unsigned?

I wanna know whether a hex number "0xDEADBEEF" is a 32-bit signed number or unsigned number. Because a 32-bit singed number ranges from -2,147,483,648 - 2,147,483,647 but it is 3,735,928,559 so anyone know about this? read more
unsigned
signed
-1votes
2answers

C++ Arduino error "stray '\221' in program"

I am trying to interface TFT display with an Arduino board I am using this 2.8’ TFT display https://robu.in/product/2-8-inch-spi-touch-screen-module-tft-interface-240320/. It has ILI9341 driver IC. I am getting following error while compiling the code Not used: C:\Program Files (x86)\Arduino\libraries\SPI exit status 1 stray '\221' in program I am using the following [...] read more
c++
arduino
tftp
-1votes
1answer

Setting and getting data from a string or stringstream

I'm trying to write a reusable message object that would take its properties, convert them into a delimited string (using 0x1d group seperator), put that in a char buffer, and also be able to do the reverse (from char back to object). This reason why I must do this is [...] read more
c++
c++98
-1votes
1answer

Extract a known length substring starting from known substring

I am trying to parse a text file with a known format, however each line is not 100% consistent. Each line of the file contains some data in the format ...x03: 0xDEADBEEF...x04: 0xDEADBEEF...x05: 0xDEADBEEF...ect I want to be able to extract particular x values from this string and print them [...] read more
string
bash
shell
text
-1votes
1answer

Wrong first argument when using PyArg_ParseTuple

I write methods for a c extension type: static PyObject * RawGraphState_apply_C_L(RawGraphState * self , PyObject * args) { npy_uint8 vop = 0xdeadbeef; npy_intp i;// = 0xdeadbeef; if(!PyArg_ParseTuple(args, "II", &i, &vop)) { return NULL; } printf("i = %ld\n", i); if(vop >= 24) { PyErr_SetString(PyExc_ValueError, "vop index must be in [0, [...] read more
python
python-3.x
python-c-api
-2votes
1answer

Reverse the order of the elements of an array of 32-bit integers

I have this task: Reverse the order of an array of 32-bit integers So, I have this array: { 0x12345678, 0xdeadbeef, 0xf00df00d }; It should look like this: { 0xf00df00d, 0xdeadbeef, 0x12345678 }; I've tried this, but with no success: #include <stdint.h> void reverse_array ( uint32_t *array, unsigned int count [...] read more
c
arrays

Comments

Leave a comment

(plain text only)

Sources

  1. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0