-
Notifications
You must be signed in to change notification settings - Fork 1
/
FuzzVDCUnlockUserKey.cpp
44 lines (34 loc) · 1.04 KB
/
FuzzVDCUnlockUserKey.cpp
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
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
#include "android/os/IVold.h"
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/strings.h>
#include <android-base/stringprintf.h>
#include <binder/IServiceManager.h>
#include <binder/Status.h>
#include <private/android_filesystem_config.h>
extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size)
{
int* data1 = (int*)data;
data = data + 4;
int* data2 = (int*)data;
data = data + 4;
std::string data3 = data;
std::string data4 = data1.substr(data1.length()/2);
data3 = data3.substr(0, data3.length()/2);
android::sp<android::IBinder> binder = android::defaultServiceManager()->checkService(android::String16("vold"));
auto vold = android::interface_cast<android::os::IVold>(binder);
vold->unlockUserKey(*data1, *data2, data3, data4);
return 0;
}