Add Outlining Support for strcat
@bpotchik đang làm issue này rồi.
Từ ngày 23/6/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What is the feature you'd like to have?
Currently, in the binary I am looking at, there are a number of string operations that are treated as raw hex numbers applied to variable offsets. It would be nice if these showed in a more 'as it would appear in the code' way, of just general string operations.
Is your feature request related to a problem?
There are other similar examples in the binary (macOS, x86_64) I'm looking at, but this is the most self contained one:
005851a0 int64_t SerumGUI::getPath_AppDataBase(int64_t arg1, int64_t* arg2)
005851b5 int64_t rax = *___stack_chk_guard
005851d4 void var_70
005851d4 if (_FSFindFolder(0xffff8005, 0x61737570, 0, &var_70) == 0)
005851dc int64_t rax_2 = _CFURLCreateFromFSRef(0, &var_70)
005851f1 _CFURLGetFileSystemRepresentation(rax_2, 0, arg2, 0x200)
005851f9 _CFRelease(rax_2)
00585201 int64_t rax_3 = _strlen(arg2)
🐛00585210 *(arg2 + rax_3) = 0x6566782e6d6f632f
🐛0058521e *(arg2 + rax_3 + 8) = 0x7364726f63657272
🐛0058522d *(arg2 + rax_3 + 0x10) = 0x2f6d757265732e
00585239 int64_t rax_4 = *___stack_chk_guard
00585240 if (rax_4 != rax)
0058524b ___stack_chk_fail()
0058524b noreturn
0058524a return rax_4
If I right click -> Display As -> Character Constant on those hex constants, it looks a bit more readable:
005851a0 int64_t SerumGUI::getPath_AppDataBase(int64_t arg1, int64_t* arg2)
005851b5 int64_t rax = *___stack_chk_guard
005851d4 void var_70
005851d4 if (_FSFindFolder(0xffff8005, 0x61737570, 0, &var_70) == 0)
005851dc int64_t rax_2 = _CFURLCreateFromFSRef(0, &var_70)
005851f1 _CFURLGetFileSystemRepresentation(rax_2, 0, arg2, 0x200)
005851f9 _CFRelease(rax_2)
00585201 int64_t rax_3 = _strlen(arg2)
- 🐛00585210 *(arg2 + rax_3) = 0x6566782e6d6f632f
- 🐛0058521e *(arg2 + rax_3 + 8) = 0x7364726f63657272
- 🐛0058522d *(arg2 + rax_3 + 0x10) = 0x2f6d757265732e
+ 🐛00585210 *(arg2 + rax_3) = '/com.xfe'
+ 🐛0058521e *(arg2 + rax_3 + 8) = 'rrecords'
+ 🐛0058522d *(arg2 + rax_3 + 0x10) = '.serum/'
00585239 int64_t rax_4 = *___stack_chk_guard
00585240 if (rax_4 != rax)
0058524b ___stack_chk_fail()
0058524b noreturn
0058524a return rax_4
But it would be nicer if it was automatically something more like this (or similar):
005851a0 int64_t SerumGUI::getPath_AppDataBase(int64_t arg1, int64_t* arg2)
005851b5 int64_t rax = *___stack_chk_guard
005851d4 void var_70
005851d4 if (_FSFindFolder(0xffff8005, 0x61737570, 0, &var_70) == 0)
005851dc int64_t rax_2 = _CFURLCreateFromFSRef(0, &var_70)
005851f1 _CFURLGetFileSystemRepresentation(rax_2, 0, arg2, 0x200)
005851f9 _CFRelease(rax_2)
00585201 int64_t rax_3 = _strlen(arg2)
- 🐛00585210 *(arg2 + rax_3) = 0x6566782e6d6f632f
- 🐛0058521e *(arg2 + rax_3 + 8) = 0x7364726f63657272
- 🐛0058522d *(arg2 + rax_3 + 0x10) = 0x2f6d757265732e
+ 🐛00585210 *(arg2 + rax_3) = '/com.xferrecords.serum/'
00585239 int64_t rax_4 = *___stack_chk_guard
00585240 if (rax_4 != rax)
0058524b ___stack_chk_fail()
0058524b noreturn
0058524a return rax_4
Or even better would be:
005851a0 int64_t SerumGUI::getPath_AppDataBase(int64_t arg1, int64_t* arg2)
005851b5 int64_t rax = *___stack_chk_guard
005851d4 void var_70
005851d4 if (_FSFindFolder(0xffff8005, 0x61737570, 0, &var_70) == 0)
005851dc int64_t rax_2 = _CFURLCreateFromFSRef(0, &var_70)
005851f1 _CFURLGetFileSystemRepresentation(rax_2, 0, arg2, 0x200)
005851f9 _CFRelease(rax_2)
- 00585201 int64_t rax_3 = _strlen(arg2)
- 🐛00585210 *(arg2 + rax_3) = 0x6566782e6d6f632f
- 🐛0058521e *(arg2 + rax_3 + 8) = 0x7364726f63657272
- 🐛0058522d *(arg2 + rax_3 + 0x10) = 0x2f6d757265732e
+ 🐛00585210 _strcat(arg2, "/com.xferrecords.serum/")
00585239 int64_t rax_4 = *___stack_chk_guard
00585240 if (rax_4 != rax)
0058524b ___stack_chk_fail()
0058524b noreturn
0058524a return rax_4
- https://www.geeksforgeeks.org/strcat-in-c/
-
char *strcat(char *dest, const char *src);
-
Are any alternative solutions acceptable?
Unsure.
Additional Information:
- This last screenshot shows another thing that would be nice to improve (which maybe is worth opening as a separate issue), where 32 bit shifts are also being used within the string operations
- Ngôn ngữ chính
- C++
- Star
- 1.3k
- Fork
- 298
- Merge trung bình
- 5 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 19
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Vector35/binaryninja-api
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8540 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8516 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Vector35/binaryninja-api#8503 ·
-
normalize time logs from WARP Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8446 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Vector35/binaryninja-api#8444 ·
Tất cả issue của Vector35/binaryninja-api
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
autowarefoundation/autoware_universe#13413 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
automated-analysis bug memory-safety
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gazebosim/gz-sensors#662 · 1 bình luận ·