Skip to content

u/zefyear

In this archive from Jul 2018 to Jul 2018

0
posts
1
comments
0
media
6
score

I think the most profitable use of your time be to swap some underlying method Zoom is using to get OS data.

You start with what you want your 'hook' to do and what you want to hook. This is a simple hook that just swaps out whatever really is in /etc/os-release with a short string "ZV" by replacing the implementation of open. You need to use the program strace to really figure out how Zoom is doing it.

#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dlfcn.h>

int open(const char *path, int oflag) {
    if (strcmp(path, "/etc/os-release")) {
        int (*nopen)(const char *path, int oflag);
        nopen = dlsym(RTLD_NEXT, "open");
        return nopen(path, oflag);
    } else {
        int *fildes = calloc(2, sizeof(int));
        pipe(fildes);
        const char *fake = "ZV";
        write(fildes[1], fake, strlen(fake));
        return fildes[0];
    }
}

To use this, you must write out the file you've created from the code above to a file (I've named it fakeread.c) and compile it:

$ gcc -shared -fPIC -ldl -o fakeread.so fakeread.c

Then you just need to call your command with an environment variable that instructs the dynamic linker to preferentially use the symbols exported by your new shared object.

$ LD_PRELOAD=`pwd`/fakeread.so WHATEVER_ZOOM_COMMAND_IS

You can hook other library functions like exec or even system calls like uname with the same principle.

 

incidentally, if you've run strace on the program and you've found it does actually inspect /etc/os-release, you can use the following as an acceptable fake value instead of "ZV" to trick zoom.

const char *fake = "NAME=Fedora\n"
    "VERSION=\"28 (Workstation Edition)\"\n"
    "ID=fedora\n"
    "VERSION_ID=28\n"
    "PLATFORM_ID=\"platform:f28\"\n"
    "PRETTY_NAME=\"Fedora 28 (Workstation Edition)\"\n"
    "ANSI_COLOR=\"0;34\"\n"
    "CPE_NAME=\"cpe:/o:fedoraproject:fedora:28\"\n"
    "HOME_URL=\"https://fedoraproject.org/\"\n"
    "SUPPORT_URL=\"https://fedoraproject.org/wiki/Communicating_and_getting_help\"\n"
    "BUG_REPORT_URL=\"https://bugzilla.redhat.com/\"\n"
    "REDHAT_BUGZILLA_PRODUCT=\"Fedora\"\n"
    "REDHAT_BUGZILLA_PRODUCT_VERSION=28\n"
    "REDHAT_SUPPORT_PRODUCT=\"Fedora\"\n"
    "REDHAT_SUPPORT_PRODUCT_VERSION=28\n"
    "PRIVACY_POLICY_URL=\"https://fedoraproject.org/wiki/Legal:PrivacyPolicy\"\n"
    "VARIANT=\"Workstation Edition\"\n"
    "VARIANT_ID=workstation\n";
6 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.