debasishm89 / RandomCodes

Random Codes Related to Reverse Engineering
9 stars 8 forks source link

frida-drcov-modified.py | expected a bytes-like object, str found #1

Open brunoaduarte opened 1 year ago

brunoaduarte commented 1 year ago
IDA> python ./frida-drcov-modified.py 4430
[*] Attaching to pid '4430' on device '127.0.0.1:62030'...
[+] Attached. Loading script...
[+] Got module info.
Starting to stalk threads...
Stalking thread 4430.
Stalking thread 4434.
Stalking thread 4435.
Stalking thread 4436.
Stalking thread 4437.
Stalking thread 4438.
Stalking thread 4439.
Stalking thread 4440.
Stalking thread 4451.
Stalking thread 4452.
Stalking thread 4453.
Stalking thread 4454.
Stalking thread 4458.
Stalking thread 4463.
Stalking thread 4466.
Stalking thread 4467.
Stalking thread 4468.
Stalking thread 4469.
Stalking thread 4470.
Stalking thread 4471.
Stalking thread 4472.
Stalking thread 4474.
Stalking thread 4475.
Stalking thread 4476.
Stalking thread 4477.
Stalking thread 4478.
Stalking thread 4479.
Stalking thread 4480.
Stalking thread 4481.
Stalking thread 4482.
Stalking thread 4483.
Stalking thread 4484.
Stalking thread 4486.
Stalking thread 4487.
Stalking thread 4490.
Stalking thread 4491.
Stalking thread 4494.
Stalking thread 4496.
Stalking thread 4497.
Stalking thread 4498.
Stalking thread 5316.
Stalking thread 5317.
Stalking thread 5318.
Stalking thread 5322.
Stalking thread 5325.
Stalking thread 5339.
Stalking thread 5460.
Stalking thread 5462.
Stalking thread 5758.
Stalking thread 5791.
Stalking thread 5929.
Done stalking threads.
[*] Now collecting info, control-C or control-D to terminate....
^D^D[!] SIGINT, saving 66564 blocks to 'frida-drcov.log'
Traceback (most recent call last):
  File "E:\frida-drcov-modified.py", line 357, in <module>
    main()
  File "E:\frida-drcov-modified.py", line 342, in main
    sys.stdin.read()
  File "E:\frida-drcov-modified.py", line 262, in sigint
    save_coverage()
  File "E:\frida-drcov-modified.py", line 270, in save_coverage
    body = create_coverage(bbs)
           ^^^^^^^^^^^^^^^^^^^^
  File "E:\frida-drcov-modified.py", line 248, in create_coverage
    return bb_header + b''.join(data)
                       ^^^^^^^^^^^^^^
TypeError: sequence item 0: expected a bytes-like object, str found
Andrew-Fryer commented 1 year ago

I ran in to this too and came up with a similar fix. I'm not sure how it worked without this...