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

41votes
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
32votes
9answers

How do I manipulate bits in Python?

In C I could, for example, zero out bit #10 in a 32 bit unsigned value like so: unsigned long value = 0xdeadbeef; value &= ~(1<<10); How do I do that in Python ? read more
python
27votes
4answers

long double (GCC specific) and __float128

I'm looking for detailed information on long double and __float128 in GCC/x86 (more out of curiosity than because of an actual problem). Few people will probably ever need these (I've just, for the first time ever, truly needed a double), but I guess it is still worthwile (and interesting) to [...] read more
gcc
long-double
19votes
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
19votes
8answers

Is there SQL parameter binding for arrays?

Is there a standard way to bind arrays (of scalars) in a SQL query? I want to bind into an IN clause, like so: SELECT * FROM junk WHERE junk.id IN (?); I happen to be using Perl::DBI which coerces parameters to scalars, so I end up with useless queries [...] read more
sql
perl
arrays
binding
parameters
16votes
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
14votes
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
11votes
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
10votes
3answers

How do you pronounce large hex numbers?

This question might be subjective, but I'm hoping there's some consensus that I just don't know about. Short hex numbers are relatively easy to spell out (e.g., 0xC4A might be "cee-four-ay"). Hex numbers ending with a multiple of three zeros are likewise pretty easy (e.g., 0xC000 might be "cee-thousand"). But [...] read more
hex
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++
7votes
1answer

CORS and the OAuth 2 authorization code flow

I have a back end application that is protected with the OAuth 2 authorization code flow. The front end (javascript in browser) hits an authorization endpoint on the back end, the back end redirects the browser to an authorization code server, the user authenticates and then the authorization server redirects [...] read more
javascript
authentication
redirect
oauth-2.0
cors
6votes
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
6votes
2answers

static linking not working for node module

I am developing a native node module for AWS lambda. This node module needed json-c As per AWS lambda guidelines the node module should not have dynamic dependencies. So tried linking the static version of json-c library. But I am getting compile time errors . As a node module is [...] read more
linker
shared-libraries
static-linking
aws-lambda
node-modules
5votes
1answer

Why is my write to virtual memory not visible in Virtual Device Driver?

I have a custom driver that I've written meant to facilitate a custom mapping of exact hardware ram memory addresses into user land. I am trying to test that common memory mmap'd as shared between two processes to the same hardware address facilitates visible memory operations that each side can [...] read more
c
linux
kernel
driver
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
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
gas
att
3votes
1answer

Efficient byte pattern search in matlab memory map

I have large binary files (2+ GB) that are arranged with a sync pattern (0xDEADBEEF) followed by a data block of a fixed size. Example: 0xDE AD BE EF ... 96 bytes of data 0xDE AD BE EF ... 96 bytes of data ... repeat ... I need to locate [...] read more
matlab
3votes
3answers

Javascript implementation of Jenkins Hash?

Is there a javascript implemenation of the Jenkins Hash I could use - rather than implementing it on my own? I know there is a python implemenation I could use to write my own js. But I am no Javascript expert and therefor I would prefer someone elses implementation. -------------------------------------------------------------------------------- [...] read more
javascript
hash
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
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

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

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
2votes
3answers

Proper way for declaring binary rotation preprocessor macro

I would like to create macros for binary rotations. My goal was to make those macros universal for both uint32_t and uint64_t operand types. I came to this implementation: #define ROTL(X, N) (((X) << (N)) | ((X) >> (8 * sizeof(X) - (N)))) #define ROTR(X, N) (((X) >> (N)) | [...] read more
c
gcc
macros
binary
bit-manipulation
2votes
4answers

STM32L073RZ (rev Z) IAP jump to bootloader (system memory)

I use the STM32L073RZ (Nucleo 64 board). I would like to jump into the system memory in application programming (IAP). My code works on the revision B of the STM32L073 microcontroller but fails on the latest revision, rev Z. I read the errata sheet, no details are given, just a [...] read more
stm32
bootloader
2votes
2answers

Is initializing a pointer with an arbitrary, literal, non-zero value defined?

Consider: struct T{}; int main() { T* p = (T*)0xDEADBEEF; } Using an invalid pointer is implementation-defined. Dereferencing it is undefined behavior. My question isn't about those. My question is whether the mere initialization of p, as is, is defined. If you think you already have all the information needed [...] read more
c++
pointers
language-lawyer
2votes
1answer

Assemble far calls or far jumps (j* instructions)

I'm trying to create a dispatch table which changes the location of some instruction in another address which is allocated by AllocateMemoryOnRemoteProcess. One of the problems that I encountered was almost all of Calls and all kind of Jumps are near and relative and as long as I load the [...] read more
assembly
x86
clang
x86-64
objdump
2votes
2answers

Process-shared condition variable : how to recover after one process dies?

I'm working on a simple FIFO queue to synchronize multiple instances of a server process. This is very similar toLinux synchronization with FIFO waiting queue, except dealing with multiple processes instead of threads. I adapted caf's ticket lock to use process-shared mutex and condition variable from a shared memory segment. [...] read more
c
linux
pthreads
condition-variable
2votes
1answer

C loss of data or precision is not warned about by compiler

Apple's LLVM does not warn about this problem, even when -Wall is specified: uint8_t tta; typedef uint32_t TT; TT ttb; ttb= 0xdeadbeef; tta = ttb; // here tta is only 0xEF What can be done to force the compiler to warn about loss of data during assignment? read more
c
macos
clang
llvm
compiler-warnings
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

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

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

#define in inline assembly in GCC

I'm attempting to write inline assembly in GCC which writes a value in a #define to a register. #define SOME_VALUE 0xDEADBEEF void foo(void) { __asm__("lis r5, SOME_VALUE@ha"); __asm__("ori r5, r5, SOME_VALUE@l"); } However, I get an error when I compile: > undefined reference to `SOME_VALUE' Is there a way for [...] read more
c
assembly
embedded
inline
1vote
4answers

Interleave 4 byte ints to 8 byte int

I'm currently working to create a function which accepts two 4 byte unsigned integers, and returns an 8 byte unsigned long. I've tried to base my work off of the methods depicted by this research but all my attempts have been unsuccessful. The specific inputs I am working with are: [...] read more
c
bit-manipulation
interleave
1vote
2answers

Reordering of access to multiple volatile variables in C

In this example: volatile uint32_t * pOne = 0xDEADBEEF; volatile uint32_t * pTwo = 0x0BADC0DE; void same(void) { uint32_t tmp; tmp = *pOne; // A *pOne = 0; // B *pOne = tmp; // C } void different(void) { uint32_t tmp; tmp = *pOne; *pOne = 0; // E *pTwo [...] read more
c
language-lawyer
c99
volatile
order-of-execution
1vote
2answers

Does strict aliasing prevent you from writing to a char array through a different type?

My understanding is that strict aliasing in C++ is defined in basic.lval 11: > (11) If a program attempts to access the stored value of an object through a glvalue of other than one of the following types the behavior is undefined: * (11.1) the dynamic type of the object, [...] read more
c++
language-lawyer
strict-aliasing
1vote
4answers

Command substitution within sed expression

I'm having little problem with bash/sed. I need to be able to use command substitution within sed expression. I have two big text files: * first is logfile.txt which sometimes* shows error messages by ID (0xdeadbeef is common example) in format ERRORID:0xdeadbeef * second errors.txt has error messages stored in [...] read more
linux
bash
sed
substitution
1vote
1answer

Why can integer store a hex value but cannot store the same value in decimal?

I most recently successfully exploited a C executable by causing its char array to overflow in to another variable. I did this by piping in the output of exploit1.py in to the command line which was accepted as an argument by lab2C. Here is the command I used: ./lab2C.exe "$(python [...] read more
python
c
hex
buffer-overflow
exploit
1vote
0answers

How to use a single malloc() call for a 2D array

I want to malloc a large block of memory then access it as a 2D array. The malloc call is pretty strait forward, something like this. const int rows = 1000; const int cols = 2048; uint32_t* mal_ptr = malloc(sizeof(uint32_t)*rows*cols); After that I don't know how to declare a pointer [...] read more
c
arrays
malloc
1vote
1answer

Random Number Generator in C++ for skipList

I wanted a random number generator for skiplist implementation and got the following logic. Can I get an explanation of how here random numbers are getting generated. I see use of bit wise operator but not able to understand the logic. #include <stdint.h> #include <iostream> using namespace std; typedef unsigned [...] read more
c++
1vote
2answers

What does this code do? found &= pattern[j] == *(char*)(base + i + j)

I came across some confusing code, and I don't know what it signifies: found &= pattern[j] == *(char*)(base + i + j); I've tried rewriting it, and this is what I've made so far: if (pattern[j] == *(char*)(base + i + j)) { found = found & pattern[j]; } For [...] read more
c
1vote
0answers

MAPISendMail crashes UWP converted app. Alternatives to sending an email from a UWP app?

I have a Win32 application that is also distributed via the Windows Store (for that it's converted to UWP using the Desktop Bridge.) The application uses MAPISendMail function to automate creation of an email in a default email client with an arbitrary attachment, as such: BOOL SendEmail(HWND hParentWnd, LPCTSTR pStrEmailAddrTo, [...] read more
c++
winapi
uwp
windows-store-apps
desktop-bridge
1vote
1answer

Detecting obvious endian issues

Consider the following code: int main(int argc, char *argv[]) { unsigned int a = 0xdeadbeef; unsigned char *b = (unsigned char *) &a; printf("%x %x %x %x\n", b[0], b[1], b[2], b[3]); return 0; } Is there a gcc/clang (or any other compiler!) warning that I can enable that will tell [...] read more
c
gcc
clang
endianness
portability
1vote
0answers

Is the prime number 532660159 somehow "connected" to the STL?

If you do a std::vector<double> v = std::vector<double>(); your vector is going to have a capacity equal to zero, fine. Now I have an API having a function having a std::vector<double> reference parameter to which I pass a vector definied as above. And at debug, I see a capacity equal [...] read more
c++
stl
visual-studio-2017
1vote
1answer

SPARC assembly, How a C pointer to struct is accessed

I have a small piece of SPARC assembly code that I'm trying to understand. .section ".text" .global tt_0x09 tt_0x09: /* Find AHBSTAT */ set ahbstat, %l3 ld [%l3], %l3 /* Get failing address from AHBSTAT faddr. */ ld [%l3 + 4], %l4 set 0xDEADBEEF, %l5 st %l5, [%l4] /*st %g0, [...] read more
c
pointers
assembly
struct
sparc
1vote
1answer

Why does the gold linker cause dl_iterate_phdr() not to return my custom note section?

On Linux, I would like to store some structures in a custom .note.foobar section and discover them at runtime. I compile and link the program below once with gold and once without: $ gcc -o test-ld test.c $ gcc -o test-gold -fuse-ld=gold test.c You can see that the ld-linked version [...] read more
c
linux
elf
dlopen
gold-linker
1vote
1answer

What disaster does the compiler prevent by disallowing assigning to a borrowed value?

An example from Programming in Rust (PDF): #[derive(Debug)] enum IntOrString { I(isize), S(String), } fn corrupt_enum() { let mut s = IntOrString::S(String::new()); match s { IntOrString::I(_) => (), IntOrString::S(ref p) => { s = IntOrString::I(0xdeadbeef); // Now p is a &String, pointing at memory // that is an int of [...] read more
rust
borrowing
1vote
0answers

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

simavr not producing gtkwave files

I just installed simavr from the following: https://github.com/buserror/simavr I did a quick make all sudo make install No problem, but when running $ ./simavr/run_avr tests/atmega88_example.axf I get AVR_MMCU_TAG_VCD_TRACE 00c6:00 - UDR0 Loaded 1708 .text at address 0x0 Loaded 114 .data Loaded 4 .eeprom But, what I'm expecting is AVR_MMCU_TAG_VCD_TRACE 00c6:00 [...] read more
gcc
simulation
avr
avr-gcc
simavr
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
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
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
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
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
0answers

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

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

how to create an assembly-only project in Code Composer Studio (CCS) for TI MSP432 series

I can copy some existing assembly project, however there are a lot files associated with it that I wonder if they are necessary. Another way of re-phrasing this question would be, is I wanted to set up either CCS or Eclipse to build/install/debug an MSP432 Launchpad development board, what would [...] read more
assembly
arm
microcontroller
code-composer
msp432
0votes
0answers

Can I dereference CRC32 checksum?

Is it possible to create CRC32 checksum as I want? Like, crc32(???) = 0xdeadbeef. In this case, 0xdeadbeef is what I want as a CRC32 checksum result. read more
algorithm
dereference
crc
crc32
0votes
1answer

Needing advice for implementing malloc and free in C

For school, I need to write a program that uses my own implementation of malloc and free. I need to be able to report on all the chunks of memory in my 'heap', whether it's allocated or not. I feel like I've written good code to do so, but evidently [...] read more
c
malloc
free
sbrk
0votes
0answers

Assembly basics - multiple arguments

Suppose I have the following snippet: push ebp (1) mov ebp,esp (2) mov eax,0xaf (3) xor al,al (4) mov ah,BYTE PTR [ebp+0x9] (5) And I call this with the following arguments: 0xdeadbeef, 0xdeefbeab, 0xf00b1den. I'm basically unsure of BYTE PTR is. My assumption: at (3) the eax stack looks as [...] read more
assembly
x86
0votes
1answer

Julia: Using the Underscore as a Digit Separator in BigFloat and BigInt

According to the Julia 1.0.0 docs: > The underscore _ can be used as digit separator: julia> 10_000, 0.000_000_005, 0xdead_beef, 0b1011_0010 (10000, 5.0e-9, 0xdeadbeef, 0xb2) However, in the Julia 1.0.0 REPL I get this: julia> VERSION v"1.0.0" # Underscore does not work work on right side of decimal in BigFloat. [...] read more
julia
0votes
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
0votes
0answers

How to compile C function at specific address Visual C++

I'm using Visual Studio 2017. I have a compiled dll which sets some variables and uses some functions at some addresses when loaded like this: #define func_address 0xdeadbeef; typedef int func(int a, int b); BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: [...] read more
c++
c
visual-c++
compilation
reverse-engineering
0votes
1answer

Pointer parameter NULL when entering in function scope but not at function call

I'm working on stm32f469 doing some bare metal code to try to use the libtomcrypt / libtomfastmath libraries. The code I'm trying to debug has been checked by valgrind and is working on many platforms like macos, raspberrypi, ios, android. To keep things simple, I am doing the following which [...] read more
c
bare-metal
stm32f4
libtomcrypt
0votes
1answer

Direct Call x86 Assembly

I'm trying to essentially patch in a dll a far call to my own address instead of the one compiled already. Here is the bytes I am trying to patch : { 0xFF, 0x15, 0x30, 0x20, 0x00, 0x10 } Which should translate to : call DWORD PTR ds:0x10002030 Which I [...] read more
assembly
x86
call
0votes
0answers

GDB disassembly filled with zeros

When I run objdump -D on my file, I get the assembly code I expect. kernel.elf: file format elf32-i386 Disassembly of section .text: 00100000 <__code>: 100000: 02 b0 ad 1b 03 00 add 0x31bad(%eax),%dh 100006: 00 00 add %al,(%eax) 100008: fb sti 100009: 4f dec %edi 10000a: 52 push %edx [...] read more
operating-system
gdb
kernel
elf
qemu
0votes
1answer

How Do I get Compiler to Recognize Reference to Library?

I downloaded the json-c library and was trying to do some basic tests in my environment (Ubuntu with Atom and gcc). However, I seem to be missing something in my makefile because every time I try to compile I get undefined reference errors. Below is what I'm trying to run, [...] read more
c
makefile
compiler-errors
0votes
3answers

why do I get a SIGSEGV in _Global_Offset_Table error with my 64bit exploit instead of getting a shell

So what's the story.. I'm following this tutorial on 64bit overflow exploit using rop. https://blog.techorganic.com/2016/03/18/64-bit-linux-stack-smashing-tutorial-part-3/ The c source to exploit is pretty simple and even includes a helper function to have the necessary assembly commands at hand; for c code and python script checkout the bottom of the post. So [...] read more
python
c
64-bit
buffer-overflow
exploit
0votes
0answers

how to implement BlueTooth class; what should it extend; compile errors at startActivityForResult and registerReceiver

I have created one tab layout in main activity. It sets 3 tabs. In settings tab(which is extending ListFragment) I am handling click event on list. When 1st element is clicked, it creates BlueTooth object bt. Bluetooth extends activity.Inside that I am handling bluetooth functions.But bluetooth functions do not seem [...] read more
android
0votes
1answer

How to solve "subscripted value is neither array nor pointer nor vector"

I'm solving C programming quiz. The quiz problem was "what is the output of the following code snnipet?" uint32_t v = 0xdeadbeef; printf("%02x", (char *) v[0]); or uint64_t? Honestly I didn't understand the problem, so I tested on my local machine. #include<stdio.h> #include<stdint.h> int main() { uint32_t v = 0xdeadbeef; [...] read more
c
0votes
0answers

code injection - passing arguments

As a preamble, this is a for a school assignment and thus for educational purposes. I'm trying to use a buffer overflow vulnerability to inject a return address that points to a function. The twist is, the function needs an argument that should be stored in edx when it executes. [...] read more
assembly
x86
exploit
0votes
0answers

How can a pure binary file be disassembled?

This code, for example : global _start section .text mov ecx, 1 mov eax, 1 int 0x80 section .data dd 0xCAFECAFE dd 0xDEADBEEF section .data dd 0xDEADCAFE When I generate a pure binary file with nasm -f bin, the file looks like this : 66 B9 01 00 00 00 [...] read more
assembly
disassembly
0votes
1answer

python simhash import issue [github.com/seomoz/simhash-py]

I've installed simhash using below command pip install git+https://github.com/seomoz/simhash-py.git and to check if it has been installed successfully below is the o/p of pip freeze pip freeze | grep simhash You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade [...] read more
python
pip
ubuntu-16.04
python-module
0votes
2answers

Combine two main loops in one node.js process

I would like to get system notifications and pass them through http to client. Now I use node.js to provide these two services in one process, but there is a problem. The notification listener has its own main loop listening to system events, and when the service is started, it [...] read more
javascript
node.js
0votes
1answer

calling for a ELF from python code

I have a problem with python tools to call a sub process or any process at all. My ELF is sitting on my PC at the same folder as the python code does. The ELF works something like: input,output,input,output: like 40 times, and I need to send data to the [...] read more
python
linux
subprocess
pipe
elf
0votes
1answer

MongoDB select subdocument with aggregation function

I have a mongo DB collection that looks something like this: { { _id: objectId('aabbccddeeff'), objectName: 'MyFirstObject', objectLength: 0xDEADBEEF, objectSource: 'Source1', accessCounter: { 'firstLocationCode' : 283, 'secondLocationCode' : 543, 'ThirdLocationCode' : 564, 'FourthLocationCode' : 12, } } ... } Now, assuming that this is not the only record in the [...] read more
mongodb
aggregation-framework
0votes
1answer

How the standards input passing stream different?

I'm a newbie in Linux, and exploitation. I have tried to solve some exploitation challenges and I realize some interesting things. [1](python -c 'print "a"*40 + "\xef\xbe\xad\xde"';cat ) | ./ch13 and [2]python -c 'print "a"*40 + "\xef\xbe\xad\xde"';cat | ./ch13 When I use I [1] my shellcode work correctly, and it [...] read more
c
shellcode
0votes
0answers

How to best approach scalable test infrastructure compatible with API invocation validation?

I am currently working on writing a test helper that would take an object instance and run it through a sequence of API invocations and validate the corresponding results. Please note that the API invocations results can vary based on the current state of the object instance. Currently, my initial [...] read more
c++
unit-testing
c++11
visual-c++
automated-tests
-1votes
0answers

How to configure custom header and footer in Scalpel/Foremost on Kali-Linux

I am working through some work exercises on file carving. Using a header of 0xDEADBEEF and a footer of 0xBEEFDEAD, I need to run the program to receive a specific token. I have turned the header/footer into hexadecimal: 0xDEADBEEF = \x30\x78\x44\x45\x41\x44\x42\x45\x45\x46 0xBEEFDEAD = \x30\x78\x42\x45\x45\x46\x44\x45\x41\x44 I have enabled it in the [...] read more
linux
header
footer
kali-linux
-1votes
1answer

Calling a function via its address C

I tried to implement a solution of this question: Calling a function through its address in memory in c / c++, but I'm not very familiar with the differences in C and C++. When I try to implement the answer, my compiler throws a weird error message at me: shellcode/findpattern.c: [...] read more
c
pointers
memory
function-pointers
memory-address
-1votes
1answer

Bash permission denied on Linux

I was doing the "bof" problem on http://pwnable.kr/play.phpI downloaded the "bof" file. But when I use gdb, it says as follows: Starting program: /home/henry/Downloads/bof /bin/bash: /home/henry/Downloads/bof: Permission denied /bin/bash: line 0: exec: /home/henry/Downloads/bof: cannot execute: Permission denied During startup program exited with code 126. bof.c: #include <stdio.h> #include <string.h> #include [...] read more
c
bash
ubuntu
-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
-2votes
1answer

Comparison of signed int and unsigned short in c++

I know that when we compare signed with unsigned the compiler converts our signed values to unsigned and when we compare a short with int the compiler converts the smaller type to the larger one. But I wrote this code to check if we compared an signed int x=0xdeadbeef and [...] read more
c++
unsigned
signed
-2votes
2answers

How to read an arbitrary pointer from the stack with a format string exploit?

I'm a trying to learn about reverse engineering from CSCI 4971 course, and I'm struggling with one particular lab question (fmt_string). I'm supposed to find and print out the flag stores somewhere. Here's how the source code looks: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #define LINK "\x1b\x5b" "34m" [...] read more
c
security
x86
reverse-engineering
format-string
-2votes
1answer

How to use xor and and in SPARC assembly

set 0xDEADBEEF, %o1 set 0x13579246, %o2 xor %o1, %o2, %o1 What will be in register o1? set 0xDEADBEEF, %o1 set 0x13579246, %o2 and %o1, %o2, %o1 What will be in register o1? read more
assembly
bit
sparc
-3votes
1answer

Why did the author use reinterpret_cast?

Here is a code snippet of Effective C++ Item 50: static const int signature = 0xDEADBEEF; typedef unsigned char Byte; // this code has several flaws — see below void* operator new(std::size_t size) throw(std::bad_alloc) { using namespace std; size_t realSize = size + 2 * sizeof(int); // increase size of [...] read more
c++
casting
type-conversion
-7votes
4answers

Cast increment and assign in C

How can I achieve the following? De-reference and assign a value to a pointer and increment the pointer by (uint64_t) bytes in one line. // random address 0xDEADBEEF unsigned int *myvalue = 0xDEADBEEF; *((uint64_t*) myvalue)++ = 34; An error is produced due to the casting if i remove the casting [...] read more
c
pointers
casting

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