我目前正在玩GDB,想要调试Android中的本机处理器,特别是/ system/bin/lmkd.
但是,一旦调用该处理器,我就无法停止GDB.
这是我到目前为止所尝试的:
Android的一面:
./gdbserver tcp:5039 /system/bin/lmkd
Run Code Online (Sandbox Code Playgroud)
客户端:
gdb
target remote localhost:5039
Run Code Online (Sandbox Code Playgroud)
从这里,我输入info shared,所以我可以得到本机处理器的基地址,设置断点,继续,调用处理器,然后它会停止.
但info shared只显示共享对象文件的地址.
关于如何在处理器上设置我不知道地址的断点的任何建议?
每次在MacOS上启动lldb时,都会出现以下错误。
File "<input>", line 1, in <module>
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
import weakref
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Run Code Online (Sandbox Code Playgroud)
我检查了所有文件和名称。
我不知道是什么引起了这个问题。
有任何想法吗?
我试图在遇到断点时使用 python 读/写寄存器。
当断点被触发时,我能够执行一个简单的 python 脚本。
我遇到的问题是读取和写入单个寄存器。我可以得到一个寄存器列表,但不能得到一个寄存器。
* thread #1, stop reason = signal SIGSTOP
frame #0: 0x000000010521562c dyld` ImageLoaderMachO::usablePrebinding(ImageLoader::LinkContext const&) const + 56
dyld`ImageLoaderMachO::usablePrebinding:
-> 0x10521562c <+56>: ldrb w8, [x19, #0x76]
0x105215630 <+60>: ldrh w9, [x19, #0x74]
0x105215634 <+64>: bfi w9, w8, #16, #8
0x105215638 <+68>: tbz w9, #0x9, 0x105215694 ; <+160>
0x10521563c <+72>: ldr x8, [x19]
0x105215640 <+76>: ldr x8, [x8, #0x378]
0x105215644 <+80>: mov x0, x19
0x105215648 <+84>: blr x8
Target 0: (BBM) stopped.
(lldb) script
Python …Run Code Online (Sandbox Code Playgroud) 我试图了解如何通过从最简单的方法 PT_DENY_ATTACH 开始来实现反调试,并尝试使用 lldb 对其进行调试。但我不知道我需要在 Objective-C 的哪一部分中实现它。
我为登录页面编写了一个简单的 Objective-C 代码。
#import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *password;
@property (weak, nonatomic) IBOutlet UITextField *usernameTextField;
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
@property (weak, nonatomic) IBOutlet UILabel *notificationLabel;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.username = @"Sally";
self.password = @"password123";
self.passwordTextField.secureTextEntry = YES;
}
- (IBAction)loginWasPressed:(id)sender {
BOOL isUsersEqual = …Run Code Online (Sandbox Code Playgroud) 由于 ARM64 中缺少 PUSH 和 POP 指令,我在理解 SP 在 ARM64 中的工作方式时遇到了问题。
如果我要 PUSH/POP,SP 是否会减少/增加 4、8 或 16 个字节?
我正在阅读文档说堆栈帧必须按 16 字节对齐,但是当我调试时,情况似乎并非如此。
ios ×2
lldb ×2
abi ×1
arm64 ×1
assembly ×1
debugging ×1
gdb ×1
gdbserver ×1
macos ×1
macos-sierra ×1
objective-c ×1
python ×1
stack-memory ×1
trace ×1
xcode ×1