This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char *bin2hex(const unsigned char *bin, size_t len) | |
{ | |
char *out; | |
size_t i; | |
if (bin == NULL || len == 0) | |
return NULL; | |
out = malloc(len*2+1); | |
for (i=0; i<len; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @brief | |
* PHP's str_replace ported to C | |
* @author Silver Moon (m00n.silv3r@gmail.com) | |
* */ | |
#include<stdio.h> | |
#include<string.h> | |
#include<stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Privilege: | |
SeCreateTokenPrivilege = 1 | |
SeAssignPrimaryTokenPrivilege = 2 | |
SeLockMemoryPrivilege = 3 | |
SeIncreaseQuotaPrivilege = 4 | |
SeUnsolicitedInputPrivilege = 5 | |
SeMachineAccountPrivilege = 6 | |
SeTcbPrivilege = 7 | |
SeSecurityPrivilege = 8 | |
SeTakeOwnershipPrivilege = 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//откуда-то с инетов, вроде с РеактОс. Автор не я, просто выложил | |
#pragma once | |
#define _WIN32_WINNT 0x0502 // Change this to the appropriate value to target other versions of Windows. | |
#define DPRINT(...) | |
#define DPRINT1(...) | |
#include <stdlib.h> | |
#include <tchar.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* example , how to enum files with NtQuerydirectoryFilе */ | |
#include <windows.h> | |
#include <stdio.h> | |
typedef LONG NTSTATUS; | |
typedef NTSTATUS *PNTSTATUS; | |
typedef DWORD ULONG_PTR; | |
#define STATUS_SUCCESS (NTSTATUS)0x00000000L | |
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <ntsecapi.h> | |
#include <stdio.h> | |
DWORD random_num(DWORD min, DWORD max) | |
{ | |
if (min > max) | |
return 0; | |
DWORD val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
typedef DWORD (__stdcall *_RtlComputeCrc32)(DWORD, const BYTE*, INT); | |
#define CRC32_BLOCK_SIZE 1024 | |
DWORD get_crc32_of_file(LPCSTR sFileName) | |
{ | |
_RtlComputeCrc32 RtlComputeCrc32 = (_RtlComputeCrc32)GetProcAddress(LoadLibraryA("ntdll.dll"), "RtlComputeCrc32"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
DWORD GetIntegrityLevel(HANDLE hProcess) | |
{ | |
DWORD dwIntegrityLevel = 0; | |
HANDLE hToken; | |
if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken)) { | |
DWORD dwSize; |