Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2023
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. // clang -fmodules -fobjc-arc -framework Foundation -framework SystemConfiguration -o dump_sc dump_sc.m
  2.  
  3. @import Foundation;
  4. @import SystemConfiguration;
  5.  
  6. #define var __auto_type
  7. #define let __auto_type const
  8.  
  9. _Pragma("clang assume_nonnull begin")
  10.  
  11. int main ( )
  12. {
  13. let ctx = SCDynamicStoreCreate(
  14. NULL, CFSTR("Dump Dynamic Store"), NULL, NULL);
  15.  
  16. let patterns = @[ @".*" ]; // Regex pattern
  17.  
  18. let allKeysAndValues = (__bridge_transfer NSDictionary *)
  19. SCDynamicStoreCopyMultiple(ctx, nil, (__bridge CFArrayRef)patterns);
  20.  
  21. NSLog(@"%@", allKeysAndValues);
  22.  
  23. CFRelease(ctx); // Closes connection to dynamic store
  24. return 0;
  25. }
  26.  
  27. _Pragma("clang assume_nonnull end")
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement