forked from yhryyq/cfgtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
40 lines (38 loc) · 1.29 KB
/
test.py
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
import re
# s = '"52" -> "48" [ label = "DDG: mid"]'
# # match = re.search(r'"(\d+)"\s+->\s+"(\d+)"\s+\[\s+label\s+=\s+"(\s+)"\]', s)
# match = re.search(r'"(\d+)"\s+->\s+"(\d+)"\s+\[\s+label\s+=\s+"(\w+:\s+\w*)"', s)
# # print(match)
# if match:
# source, target, data = match.groups()
# print(data)
# a = {"123": {"fuck": 123}}
# a.update({"456": {"shit": 456}})
# for i, j in a.items():
# print(i)
# print(j)
# a.setdefault("123", {}).
# pattern = r"JNINativeMethod\s+\w+_\w+\[[\d\s]*\]\s*=\s*\{(.*\};)"
# s = '''JNINativeMethod methods_MainActivity[] = {
# {"stringFromJNI", "()Ljava/lang/String;", (void *) stringFromJNI},
# {"add", "(II)I", (void *) add}
# };'''
# match = re.search(pattern, s)
# first = match.group()
# print(first)
s = "123."
print(s.rfind("-"))
# jv_method_defs = re.findall(pattern, s, re.DOTALL)
# print(jv_method_defs)
# pattern2 = r"\{\"(.*)\",\s*\"(.*)\",\s*\(.*?\)\s*(\w+)\}"
# matches = re.findall(pattern2, jv_method_defs[0])
# for match in matches:
# print(match)
# print(jv_method_defs[0])
# print(match)
# if match:
# first, second, third = match.groups()
# print(first)
# print(second)
# print(third)
# JNIEXPORT jobject JNICALL Java_com_example_string2CStr(JNIEnv env, jstring jstr)