I’m working through a DLL hijacking exercise, and have a DLL written which works as expected when compiled in Visual Studio. Essentially, when the DLL is loaded, it executes a shell command and passes off legitimate functionality (in this example, the CheckEvenOdd and PrintAMessage functions) to the originally intended DLL (in this example, GetEvenOdd.dll). The working code is as follows;
Tag: c++
Setting GCServer = True when running on Linux in .net core project
How do set GCServer to true in a .net core project? Usually in .net framework projects I add an App.Config xml file that sets GCServer variable to true but this does not work in a .net core project running on Linux (the App.Config file is generated and publish but the variable still doesn’t change) Answer Add <ServerGarbageCollection>True</ServerGarbageCollection> to your csproj
.net core date format on Linux
I’m migrating my code from .net framework to .net core and testing it on a Linux machine, one of the issues I had a problem with is the date format when calling DateTime ToString() function, in Windows the default date format is guided by the OS and can be customized in the settings I’ve tried to do something similar in
Restarting an endless while loop upon a mouse event?
I am aiming a simple code which looks like this: My goal here is to restart the print sequence from “hey 1” immediately when left mouse is clicked. However, I am not able to achieve this without using “if” conditions before every sleep. a “goto” is not working for me across different functions too. Can anyone suggest an optimal solution
Preserve quotes when using wordexp
I’m trying to use the wordexp function to shell-like expansion on some strings. wordexp removes single and double quotes, I would like to preserve those however. My initial though was to just surround all quotation mark pairs in the input string with another pair of, this time escaped, quotation marks which wordexp should leave untouched (or the other way around).
Why does the free() function not return memory to the operating system?
When I use the top terminal program at Linux, I can’t see the result of free. My expectation is: free map and list. The memory usage that I can see at the top(Linux function) or /proc/meminfo get smaller than past. sleep is start. program exit. But The usage of memory only gets smaller when the program ends. Would you explain
Does clang++ treat system headers in a more relaxed way?
The following struct is defined in the Linux system header file /usr/include/sys/inotify.h: Please note the last field name, which is a zero-length array. C++17 does not support zero-length array, so, if using struct inotify_event in a C++17 project and compiling it with -pedantic, a compiler warning should be raised. However, the following code doesn’t raise any warning for struct inotify_event.
GdkPixbuf change opacity
Is it somehow possible to set the opacity of a of a GdkPixbuf to about 50%? The thing is i am writing in Gtk2 (cannot switch to Gtk3!) a filebrowser widget (for a remote file transfer) and I want the icons of the files to be 50% transparent if the file is hidden. I get the icon using GFileInfo and
Jlibfprint cross compilation
I’m trying to cross-compile the JNI Bridge Jlibfprint using buildroot. This is the source code. Here is the .mk file: Extract, Patch, Update, Configure, Autoreconfiguring, Patching libtool run without problem. Then it failed at Building stage with this: Then I added, these includes to the /JlibFprint_jni/src/Makefile.am And now it fails with: Answer I downloaded JDK for ARM 32 bits and
How to link to Winsock when cross-compiling a Windows app on Linux?
I am porting a Cmake project from Linux to Windows. It uses sockets, so uses pthread in Linux and needs Winsock in Windows. The project is being compiled in Linux, using cross-compilation to create Windows binaries. The project is already compiling fine, and there is a switch to link pthreads when building for Linux and winsock for Windows. However, there