Giter Club home page Giter Club logo

anti-debug's Introduction

telegram   

Hello im codepulze, self taught developer with 5 - 6 years experience, my stack is below.

All my projects are for educitional purpoeses and shouldnt have be abused

JavaScript Python Django REST API Perl Ruby Node.js CSS HTML PowerShell Bash Go
GitHub Profile Stats 💻
EvilBytecode's Github Stats EvilBytecode's Top Languages

🎫 Coding Services SEND DM 🎫

github contribution grid snake animation

anti-debug's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

chronoss3

anti-debug's Issues

C code won't compile in antidbgbetter

Tried porting the C code to a test.c file and compile it with gcc. Here are the errros.

antidbg.c:7:26: error: 'NtSetInformationThread' redeclared as different kind of symbol
    7 | typedef NTSTATUS(WINAPI *NtSetInformationThread)(IN HANDLE, IN THREADINFOCLASS, IN PVOID, IN ULONG);
      |                          ^~~~~~~~~~~~~~~~~~~~~~
In file included from antidbg.c:2:
C:/ProgramData/mingw64/mingw64/x86_64-w64-mingw32/include/winternl.h:1103:18: note: previous declaration of 'NtSetInformationThread' with type 'NTSTATUS(void *, THREADINFOCLASS,  void *, ULONG)' {aka 'long int(void *, THREADINFOCLASS,  void *, long unsigned int)'}
 1103 |   NTSTATUS NTAPI NtSetInformationThread(HANDLE ThreadHandle,THREADINFOCLASS ThreadInformationClass,PVOID ThreadInformation,ULONG ThreadInformationLength);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
antidbg.c: In function 'hehehidehthread':
antidbg.c:12:33: warning: comparison between pointer and integer
   12 |     if (pNtSetInformationThread != NULL)
      |                                 ^~
antidbg.c:15:9: error: called object 'pNtSetInformationThread' is not a function or function pointer
   15 |         pNtSetInformationThread(GetCurrentThread(), ThreadHideFromDebugger, NULL, 0);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
antidbg.c:11:28: note: declared here
   11 |     NtSetInformationThread pNtSetInformationThread = (NtSetInformationThread)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "NtSetInformationThread");
      |                            ^~~~~~~~~~~~~~~~~~~~~~~
antidbg.c: At top level:
antidbg.c:54:11: warning: 'GetTickCount64' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
   54 | ULONGLONG GetTickCount64();

The code I tried to compile is as following

#include <windows.h>
#include <winternl.h>
#include <process.h>

// C Part CODED BY MUZA

typedef NTSTATUS(WINAPI *NtSetInformationThread)(IN HANDLE, IN THREADINFOCLASS, IN PVOID, IN ULONG);

void hehehidehthread()
{
 NtSetInformationThread pNtSetInformationThread = (NtSetInformationThread)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "NtSetInformationThread");
 if (pNtSetInformationThread != NULL)
 {
     THREADINFOCLASS ThreadHideFromDebugger = (THREADINFOCLASS)0x11;
     pNtSetInformationThread(GetCurrentThread(), ThreadHideFromDebugger, NULL, 0);
 }
}
BOOL checksysreq()
{
 SYSTEM_INFO systemInfo;
 GetSystemInfo(&systemInfo);
 DWORD numberOfProcessors = systemInfo.dwNumberOfProcessors;
 if (numberOfProcessors < 2)
     return FALSE;

 MEMORYSTATUSEX memoryStatus;
 memoryStatus.dwLength = sizeof(memoryStatus);
 GlobalMemoryStatusEx(&memoryStatus);
 DWORD RAMMB = (DWORD)(memoryStatus.ullTotalPhys / (1024 * 1024));
 if (RAMMB < 2048)
     return FALSE;

 HANDLE hDevice = CreateFileW(L"\\\\.\\PhysicalDrive0", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
 if (hDevice == INVALID_HANDLE_VALUE)
     return FALSE;

 DISK_GEOMETRY pDiskGeometry;
 DWORD bytesReturned;
 if (!DeviceIoControl(hDevice, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &pDiskGeometry, sizeof(pDiskGeometry), &bytesReturned, (LPOVERLAPPED)NULL))
 {
     CloseHandle(hDevice);
     return FALSE;
 }

 DWORD diskSizeGB = (DWORD)(pDiskGeometry.Cylinders.QuadPart * (ULONG)pDiskGeometry.TracksPerCylinder * (ULONG)pDiskGeometry.SectorsPerTrack * (ULONG)pDiskGeometry.BytesPerSector / (1024 * 1024 * 1024));
 CloseHandle(hDevice);
 if (diskSizeGB < 100)
     return FALSE;

 return TRUE;
}

ULONGLONG GetTickCount64();

The code might differ slightly since it's formatted but even unformatted I get the same errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.