-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.h
41 lines (36 loc) · 1.43 KB
/
shared.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef Shared_h
#define Shared_h
#include <Appkit/AppKit.h>
#include <CommonCrypto/CommonDigest.h>
#include <EndpointSecurity/EndpointSecurity.h>
#include <Foundation/Foundation.h>
#include <Kernel/kern/cs_blobs.h>
#include <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
#include <libproc.h>
#include <mach/mach_time.h>
#include <stdint.h>
void init_date_formater(void);
uint64_t MachTimeToSeconds(uint64_t machTime);
NSString *_Nonnull SHA1ForFileAtPath(NSString *_Nonnull filePath);
typedef struct {
const NSString *_Nullable name;
int value;
} CSFlag;
#define CSFLAG(flag) \
{ @ #flag, flag }
NSString *_Nonnull codesigning_flags_str(const uint32_t codesigning_flags);
NSString *_Nonnull esstring_to_nsstring(
const es_string_token_t es_string_token);
const NSString *_Nonnull event_type_str(const es_event_type_t event_type);
NSString *_Nonnull events_str(size_t count,
const es_event_type_t *_Nonnull events);
es_message_t *_Nonnull copy_message(const es_message_t *_Nonnull msg);
void free_message(es_message_t *_Nonnull msg);
#pragma mark Helpers - Misc
NSString *_Nonnull fdtype_str(const uint32_t fdtype);
bool is_system_file(const NSString *_Nonnull path);
bool is_plain_text_file(const NSString *_Nonnull path);
char *_Nonnull filetype_str(const mode_t st_mode);
#define BOOL_VALUE(x) x ? "Yes" : "No"
// #pragma mark - Endpoint Secuirty Demo
#endif