CARVIEW |
Select Language
HTTP/2 200
date: Thu, 31 Jul 2025 09:21:14 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"d103d7bf2a3c35fc22670e7af3b0142b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=1QTlAi304z9COWlYd6ewUTIXv3k%2BOefomDBB2W0uC69mi8PrTztjnfUfthzRc%2FHhXcWnzhqbxK%2BYT728kHypJv92MPn5HyXT9uXNW0gLaXyg93Kqs19MedFw1fpI8qbFXiKePiTsOYFxRJyciwrwFYVK1BE57W6pQz2K0caiktHHbajuYkV8QMw%2FVXHSMsKG6TFFsHSufOGQB44sHpnJCC7hh3s2hiqWKwhTnPQSyaiBafVi12F6DV5f%2B%2BSue0dulnnmgcm8x05kj9qgNvb5eA%3D%3D--qtdLgqkpsBoBo1bn--IoCkAXTya%2B4k33UKz22a6A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.349910304.1753953674; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 09:21:14 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 09:21:14 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E34C:111CDC:6E251A:86B014:688B358A
main.m · GitHub
Show Gist options
Save samdmarshall/17f4e66b5e2e579fd396 to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
Last active
February 17, 2022 14:48
-
Star
12
(12)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save samdmarshall/17f4e66b5e2e579fd396 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
#include <objc/objc-api.h> | |
#include <objc/runtime.h> | |
#include <malloc/malloc.h> | |
#include <mach/mach.h> | |
@interface TEST : NSObject | |
@end | |
@implementation TEST | |
@end | |
@interface lolol : TEST | |
@end | |
@implementation lolol | |
@end | |
static Class * internalClassList; | |
static uint64_t classCount; | |
void CanHasObjects(task_t task, void * context, unsigned type, vm_range_t * addr, unsigned count) { | |
for (uint64_t index = 0; index < count; index++) { | |
vm_range_t *range = &addr[index]; | |
uintptr_t *address = ((uintptr_t *)range->address)[0]; | |
size_t size = range->size; | |
if (size >= sizeof(Class) && address != NULL) { | |
for (uint64_t lookupIndex = 0; lookupIndex < classCount; lookupIndex++) { | |
Class testClass = (internalClassList[lookupIndex]); | |
if (address == testClass) { | |
printf("0x%016x -- Class: %s\n",address, object_getClassName((__bridge id)address)); | |
break; | |
} | |
} | |
} | |
} | |
} | |
int main(int argc, const char * argv[]) { | |
TEST *a = [[TEST alloc] init]; | |
lolol *b = [[lolol alloc] init]; | |
internalClassList = objc_copyClassList(&classCount); | |
vm_address_t *zones; | |
uint64_t count; | |
kern_return_t error = malloc_get_all_zones(mach_task_self(), NULL, &zones, &count); | |
if (error == KERN_SUCCESS) { | |
for (uint64_t index = 0; index < count; index++) { | |
malloc_zone_t *zone = (malloc_zone_t *)zones[index]; | |
if (zone != NULL && zone->introspect != NULL) { | |
zone->introspect->enumerator(mach_task_self(), NULL, MALLOC_PTR_IN_USE_RANGE_TYPE, zone, NULL, &CanHasObjects); | |
} | |
} | |
} | |
return 0; | |
} | |
This file contains hidden or 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
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007b64a840 -- Class: __NSPlaceholderArray | |
0x000000007b64a750 -- Class: __NSArrayI | |
0x000000007d467d80 -- Class: OS_xpc_dictionary | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467990 -- Class: OS_xpc_string | |
0x000000007d467ed0 -- Class: OS_xpc_domain | |
0x000000007c810a10 -- Class: OS_dispatch_queue | |
0x000000007d468170 -- Class: OS_xpc_pipe | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64b060 -- Class: __NSCFType | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64acf0 -- Class: __NSCFDictionary | |
0x000000007b64acf0 -- Class: __NSCFDictionary | |
0x000000007b64acf0 -- Class: __NSCFDictionary | |
0x000000007b64a840 -- Class: __NSPlaceholderArray | |
0x000000007b64a390 -- Class: __NSCFString | |
0x000000007b64a750 -- Class: __NSArrayI | |
0x00000000000011c0 -- Class: TEST | |
0x0000000000001210 -- Class: lolol | |
0x000000007b64ab38 -- Class: __NSDictionaryM | |
0x000000007b64ab10 -- Class: __NSDictionaryI | |
0x000000007b413810 -- Class: NSObject | |
0x000000007b64ac00 -- Class: __NSPlaceholderDictionary | |
0x000000007b64ac00 -- Class: __NSPlaceholderDictionary | |
0x000000007cc763a0 -- Class: NSLock | |
0x000000007cc763a0 -- Class: NSLock | |
0x000000007cc763a0 -- Class: NSLock | |
0x000000007cc76440 -- Class: NSRecursiveLock | |
0x000000007cc763a0 -- Class: NSLock | |
0x000000007cc76440 -- Class: NSRecursiveLock | |
0x000000007cc76440 -- Class: NSRecursiveLock | |
0x000000007b64acf0 -- Class: __NSCFDictionary | |
0x000000007cc79280 -- Class: NSThread | |
0x000000007cc79258 -- Class: _NSThreadData | |
0x000000007b64af20 -- Class: NSBlockInvocation | |
Program ended with exit code: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.
hi!,i read this code ,but "address" is not the name of class but like"0x000020201"this ,so the address == testClass is not real(i use xcode8.1 and command line)