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

74votes
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
12votes
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
7votes
1answer

In C++ is it possible to specify which delete operator is used?

I am instrumenting some code and noticed that with the C++14 features there are two new delete operators (From http://en.cppreference.com/w/cpp/memory/new/operator_delete): > These are 5-6) Called instead of (1-2) if a user-defined replacement is provided except that it's implementation-defined whether (1-2) or (5-6) is called when deleting objects of incomplete type [...] read more
c++
c++14
clang++
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
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
3votes
2answers

defuse.ca online GAS assembler accepts AT&T syntax for movb and movw, but not movl?

I'm using https://defuse.ca/online-x86-assembler.htm#disassembly to assemble x86 instructions to machine code. (Editor's note: it uses GAS in .intel_syntax noprefix mode.) -------------------------------------------------------------------------------- The below code throws Error: no such instruction: `movl $0xdeadbeef,0x08048c5f' movl $0xdeadbeef,0x08048c5f But the following assembly code works fine movb $0xdeadbeef, 0x08048c5f movw $0xdeadbeef, 0x08048c5f read more
assembly
x86
gnu-assembler
att
3votes
2answers

what is the difference between "python -c 'print' " and "(python -c 'print'; cat)" in linux

I usually use "python -c" to pass arguments to C program. Like this: $ python -c 'print "a" * 12' | ./program but when I execute a BOF practice program pwnable.kr/bof, the python -c 'print' and ( python -c 'print'; cat ) work differently. 1. I wrote a exploit code [...] read more
python
c
linux
reverse-engineering
cracking
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
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
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

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 aIt 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 stdio.h [...] read more
c
linux
gcc
glibc
2votes
1answer

How to copy the value at a certain address in memory to a register in gcc AT&T style

I want to copy the value at a certain address in memory to a register using AT&T style assembly. I know this shouldn't be hard, and I think in Intel style it's something like: mov rdi, [0xdeadbeef] But I don't know much about the AT&T style (or assembly in general). [...] read more
assembly
x86-64
att
2votes
3answers

Making std::to_string work with void pointers, like operator<<?

I have some code which std::to_string()'s a variable whose type is a template parameter. Suppose the code is: template <typename T> std::string foo(const T& t) { return std::string("I got ") + std::to_string(t); } Now, sometimes this parameter needs to be a void *; and I would like to get the [...] read more
c++
string
c++11
void-pointers
ostream
2votes
2answers

Make a constraint more difficult to solve for a constraint solver?

I am a newbie to SMT solving and I am writing to inquire some advice and pointers to understand what is a really difficult constraint for SMT solver to solve, for instance Z3. I tried to tweak the length of bit vectors, for instance in the following way: >>> a [...] read more
constraints
z3
smt
satisfiability
constraint-satisfaction
2votes
1answer

ASM to C: how to dereference a pointer and add an offset?

I feel kind of dumb, but I'm struggling with dereferencing a pointer (+ adding an offset) in C. What I want to recreate in C is this behavior: movabs rax, 0xdeadbeef add rax, 0xa mov rax, QWORD PTR [rax] So at the end rax should be: *(0xdeadbeef+0xa)Especially the equivalent to [...] read more
c
pointers
assembly
x86-64
intel
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
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
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
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
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 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
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
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 writes [...] 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

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
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

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
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
1vote
1answer

Determine which signal uncaught by terminated child process

I have a Mac OS X app (Cocoa), which spawns a C++ console helper app to do some work. The GUI spawns the helper via NSTask, and they communicate with each other via named pipes. This is all good. If the helper app dies, the GUI gets an NSTaskDidTerminateNotification, and [...] read more
cocoa
macos
ipc
signals
nstask
1vote
2answers

After sending a pointer to an external function to make it null, it doesn't change to null

I have created a pointer of type "Vector" (see code). After creation I want to send a pointer of type Vector (meaning Vector*) to a function called "VectorDestroy(Vector* _vector), which frees the struct from memory and assigns it to null. However when I continue in the code and want to [...] read more
c
pointers
struct
null
free
1vote
1answer

How can I use lwIP tcp/ip stack with microcontroller stm32f4 (client)

Core: Cortex-M4 Microcontroller: stm32f407 (stm32f4 discovery board) IP Stack: lwIP 1.4.1 I am using this microcontroller to control an automate and I want to send some information to a separate web server via a HTTP request in the form of: http://192.168.1.3/api/xdevices.json?SetR=01 lwIP has a http server for the microprocessor, but [...] read more
tcp
stack
microcontroller
lwip
stm32f4
1vote
2answers

Iterate over list starting from a certain index

Here is an example: list_ = [5, 'cat', 0xDEADBEEF, 4.0] for offset in range(len(list_)): result = 0 for elem in list_[offset:]: result = func(result, elem) return result where func is non-commutative. In the code above, list_[offset:] will create a new list, but all I need is a view to list_. [...] read more
python
arrays
list
iterator
iteration
1vote
0answers

Using a template function in an anonymous namespace

I am trying to use Strong Types and to add stream operator for them. In my source file I put all of these helpers in an anonymous namespace. One of these helpers is using a template stream operator (utils::to_hex(T)) defined in another header. namespace { // Anonymous namespace // Example [...] read more
c++
c++11
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

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
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
0answers

Have some troubles to use lib installed with vcpkg in vscode and gcc

I'm a beginner in C and I want to use a lib called json-c. So I followed the git tutoriel and I installed vcpkg. After that I run the command: vcpkg install json-c vcpkg integrate install So now vscode can see the new lib, i see function descriptions, etc.. I [...] read more
c
gcc
visual-studio-code
include
vcpkg
0votes
1answer

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

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
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
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
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
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

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
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
0answers

having issues in understanding the buffer-overflow process

This is the problem from recent picoCTF buffer-overflow challenge. here i have some doubts. I am learning bufferoverlow, so my questions may be trivial. i am not able to understand the proper functionality of this program. This was the program given: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include [...] read more
stack-overflow
buffer-overflow
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
0votes
0answers

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

Allow modification of list during loop

In most cases, the user is modifying the array directly within the original loop. In my case, the array is being modified by a method being called inside of the loop, outside of the loop's control. I need a way for an outsider to be able to add a value [...] read more
java
list
concurrency
0votes
1answer

Why traditional GetProcAddress to std::function is not working straightforward

As in the title I'd like to convert GetProcAddress into std::function. Yes, there are multiple solutions in stack overflow, but none actually explains why those workarounds are needed. I can't really understand the exact error message and why it happens. The sample source is simple: #include <functional> #include <Windows.h> using [...] read more
c++
c++17
dynamic-import
0votes
1answer

C++ assigning integer (containing address) to pointer

I am new to C++, I have a function which returns address of a memory location and I want to assign that address to a pointer, just like: unsigned int address = 0xdeadbeef; unsigned int* memory_ptr = (unsigned int*) address; But above code is through warning: cast to pointer from [...] read more
c++
pointers
0votes
1answer

Address operator and variable token joining macro

I have had a problem with running a program that (when simplified) looks something like this. #include <stdio.h> #define ADDR_TOKEN_MACRO(x) & ## x int main() { int *i; int **y; int b = 0xDEADBEEF; *y = ADDR_TOKEN_MACRO(b); return 0; } I'm trying to set the integer pointer i's address to [...] read more
c
0votes
2answers

Problem with Stack based Euler-Tree-traversal

I want a function that traverses a binary tree with the Euler traversal (this is how it works). Of course this is easily achievable with recursion - I know how that works. But now I want to implement an iterative version of this algorithm using a stack instead of recursion. [...] read more
algorithm
data-structures
tree
binary-tree
tree-traversal
0votes
1answer

Using a public PRNG and uniform distribution (C++17)

I am trying to implement a PRNG I found online yet I am having compile time issues (seen below): 1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\xutility(4010): error C2061: syntax error: identifier 'result_type' 1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\xutility(4012): error C2065: '_Ty1': undeclared identifier 1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.15.26726\include\xutility(4012): error C2065: '_Ty1': undeclared identifier [...] read more
c++
visual-studio
random
visual-studio-2017
-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
-2votes
3answers

Considering only 4 bits at a time when converting decimal to hex

I have a C function to convert decimal to a hex string hexConversion: int hexConversion(int num){ char hex_buffer[9]; unsigned int mask = 4026531840; for(int i = 0; i < 9; i++){ int temp = mask & num; if(temp < 10){ hex_buffer[i] = temp + '0'; } else if(temp == 10){ [...] read more
c
function
binary
hex
output

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