mach

Different result from match search and check directly cell()

大兔子大兔子 提交于 2020-01-03 05:12:51
问题 For the below problem I mistakenly asked for a review in C.R., but they told me not to be the right place, so I extend to you the same question. I cannot find answers alone. this very simple code return 2 different results, why ?!?! I'll be crazy... Function FirstDay(t As String) As Boolean d = DateSerial(Left(t, 4), Mid(t, 5, 2), Right(t, 2)) - 1 FirstDay = False Var = Application.Match(d, Worksheets("Diary").Columns(1), 0) If Not IsError(Var) Then FirstDay = True End If 'this only to check

How to get WiFi encryption mode on iOS/iPhone/iPad?

淺唱寂寞╮ 提交于 2019-12-30 18:43:24
问题 How to get Wi-Fi encryption mode in iOS without private libraries? 回答1: The code from the answer above has been posted originally on this website: http://www.codeproject.com/Articles/621213/Non-Standard-Way-to-Get-Inaccessible-Data-from-iOS By the way, for this code to work you need to include the appropriate header files with #include <mach/mach.h> so that your compiler recognizes NDR_record_t ndr . However, this whole setup did not actually return me the encryption mode of the current WiFi,

OSX setgid system call - which API is the correct one

跟風遠走 提交于 2019-12-24 01:17:25
问题 I'd like to use the system call setgid, to change the group ID of the current process. Trying to lookup this function, the only implementation I've found is in kern_prot.c : /* * setgid * * Description: Set group ID system call * * Parameters: uap->gid gid to set ... .. . */ int setgid(proc_t p, struct setgid_args *uap, __unused int32_t *retval) { ... .. . } Notice that according to /usr/unistd.h, the API is completely different ( int setgid(gid_t); ). does int setgid(gid_t); is a wrapper of

Delaying Code Execution on OSX 10.10

馋奶兔 提交于 2019-12-21 06:16:13
问题 I've encountered a very strange issue that affects my code running only on OSX 10.10 systems. I've seen this anomaly occur on over 25 OSX 10.10 systems running my code, whereas the exact same code did not exhibit this behavior before upgrading (10.7). Furthermore, this issue is not 100% reproducible in that it occurs randomly ~0-5% of the time. While testing the code, nothing else critical or CPU exhaustive is occurring on the machine. Even if something else was happening, the very fact that

Meaning of a Common String In Executables?

时光毁灭记忆、已成空白 提交于 2019-12-21 03:53:31
问题 There appear to be some similar-looking long alphanumeric strings that commonly occur in Mach-O 64 bit executables and ELF 64-bit LSB executables among other symbols that are not alphanumeric: cat /bin/bash | grep -c "AWAVAUATSH" has 181 results, and cat /usr/bin/gzip | grep -c "AWAVAUATSH" has 9 results. What are these strings? 回答1: Interesting question. Since I didn't know the answer, here are the steps I took to figure it out: Where in the file does the string occur? strings -otx /bin/gzip

Dtrace invalid address error when extracting process command line

女生的网名这么多〃 提交于 2019-12-12 04:17:09
问题 I'd like to have dtrace script that print new processes' cmdline and their matching parent name. i.e. : if I ran /Users/bla/myexec arg1 arg2 arg3 from bash I will get something like : parent is bash process is --> /Users/bla/myexec arg1 arg2 arg3 After searching here and here I came up with the following solution : #!/usr/sbin/dtrace -s proc:::exec { self->pexecname = execname; } proc:::exec-success / self->pexecname != 0 / { this->isx64=(curproc->p_flag & P_LP64)!=0; #define SELECT_64_86(x64

Using AMWorkflow with sandboxed app

倖福魔咒の 提交于 2019-12-11 11:37:23
问题 I am trying to execute an Automator workflow from a sandboxed AppKit app. Minimal example + github repo : NSOpenPanel * panel = [NSOpenPanel openPanel]; [panel setAllowsMultipleSelection:NO]; [panel setCanChooseFiles:YES]; [panel setCanChooseDirectories:NO]; [panel setAllowedFileTypes:[NSArray arrayWithObject: @"com.apple.automator-workflow"]]; NSInteger result = [panel runModal]; if (result == NSFileHandlingPanelOKButton) { NSURL * workflow = [[panel URLs]objectAtIndex:0]; NSLog(@"selected

NSWorkspace runningApplications doesn't return my XPC mach service

我只是一个虾纸丫 提交于 2019-12-11 01:36:50
问题 NSArray *activeApps = [[NSWorkspace sharedWorkspace] runningApplications]; Returns running applications and agents, but i cannot see my running XPC mach service (although it is running and visible in activity monitor processes) even when i look up the PID in activity monitor id res = [NSRunningApplication runningApplicationWithProcessIdentifier:223]; i get res nil, although with other processes this works well 回答1: The NSRunningApplication documentation states: Only user applications are

Dtrace print parent process command

烂漫一生 提交于 2019-12-10 23:38:30
问题 I'd like to have a script that for each new running process, prints its starting command, as well as its parent process. i'm using the following probes : proc::posix_spawn:exec-success,proc::__mac_execve:exec-success From within the script body, command line string is built from curproc->p_dtrace_argv . parent pid (ppid) is also available, but so far I haven't managed to figure out how to extract the parent process name (preferably full name that can be taken from parent argv[0]). 回答1: You

Why does host_statistics64() return inconsistent results?

末鹿安然 提交于 2019-12-10 01:30:33
问题 Why does host_statistics64() in OS X 10.6.8 (I don't know if other versions have this problem) return counts for free, active, inactive, and wired memory that don't add up to the total amount of ram? And why is it missing an inconsistent number of pages? The following output represents the number of pages not classified as free, active, inactive, or wired over ten seconds (sampled roughly once per second). 458 243 153 199 357 140 304 93 181 224 The code that produces the numbers above is: