antidebug | Collection Of Anti-Debugging Tricks | Code Inspection library
kandi X-RAY | antidebug Summary
kandi X-RAY | antidebug Summary
Collection Of Anti-Debugging Tricks.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of antidebug
antidebug Key Features
antidebug Examples and Code Snippets
Community Discussions
Trending Discussions on antidebug
QUESTION
For a bit of background, I was playing around with anti-debug techniques. To prevent software breakpoints, one can search at runtime for 0xCC inside a memory segment. Code example here -> https://github.com/LordNoteworthy/al-khaser/blob/master/al-khaser/AntiDebug/SoftwareBreakpoints.cpp
Instead of checking for only one function, I wanted to test the whole .text
section at runtime and compute the hash of the section. After some research I ended up with something like that.
ANSWER
Answered 2019-Dec-06 at 09:59@PeterCordes is right (look in the comments). It's because of ASLR, I just tested the code with ASLR Off and the sum is always the same.
QUESTION
I'm testing an antidebug solution with ptrace
method
ANSWER
Answered 2018-Jun-03 at 00:34Here's what's happening:
handle = dlopen ("libc.so", RTLD_LAZY)
assigns NULL tohandle
. Dlopen fails because on your GNU/Linux distro (and most other modern distros)lib.so
isn't a shared library - it's a GNU ld script.
dlopen ("libc.so.6", RTLD_LAZY)
would have succeeded.go = dlsym(handle, "ptrace")
succeeds(!). With glibc, it's OK to pass a NULL pointer as the handle argument to dlsym because glibc happens to use((void *) 0)
asRTLD_DEFAULT
.
This generally won't work on other systems. FreeBSD's dlsym uses((void *) -2)
asRTLD_DEFAULT
, and if you call dlsym with a NULL handle, it will look for the symbol within the executable or shared library that called dlsym.go(PTRACE_TRACEME, 0)
succeeds.dlclose(handle)
can't tolerate a NULL handle, and it causes a segfault, so theSIGSEGV
signal is raised.since the process is being traced, receiving a signal results in it being stopped (suspended). Typing
jobs
to your shell will show the signal that made the process stop.
The code
QUESTION
Here is my code:
...ANSWER
Answered 2018-May-26 at 05:58you use static linked CRT - this is visible from your stack trace. static linked CRT in exe initialized after exe entry point is called. but tls callback on DLL_PROCESS_ATACH
called before exe entry point. in this case your static CRT yet not initialized and any call to this CRT code can crash. solution - use dynamic linked CRT in separate DLL - in this case it already will be initialized before TLS callback
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install antidebug
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page