1. 程式人生 > 其它 >替換apk中的檔案然後重新打包簽名

替換apk中的檔案然後重新打包簽名

技術標籤:qemugdblinuxc語言

QEMU原始碼除錯

QEMU環境配置

檢視我上篇部落格配置環境:https://blog.csdn.net/qq_36723459/article/details/112273567

QEMU開啟debug模式

…/configure --enable-debug --target-list=arm-softmmu --audio-drv-list=

啟動debug

gdb build/arm-softmmu/qemu-system-arm(檔案路徑要注意,我是在qemu目錄下)
set args -M help

注:追加 insert_sort -tui介面化除錯
gdb build/arm-softmmu/qemu-system-arm insert_sort -tui
內容如下:

GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from arm-softmmu/qemu-system-arm...done.
warning: File "/home/zj/project/inkline/source/qemu/qemu-5.1.0/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /home/zj/project/inkline/source/qemu/qemu-5.1.0/.gdbinit
line to your configuration file "/home/zj/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/zj/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
(gdb) set args -M help
(gdb) c
The program is not being run.
(gdb) start
Temporary breakpoint 1 at 0x3032d0: file /home/zj/project/inkline/source/qemu/qemu-5.1.0/softmmu/main.c, line 47.
Starting program: /home/zj/project/inkline/source/qemu/qemu-5.1.0/build/arm-softmmu/qemu-system-arm -M help
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeb568700 (LWP 24362)]

Thread 1 "qemu-system-arm" hit Temporary breakpoint 1, main (argc=3, argv=0x7fffffffdd48, envp=0x7fffffffdd68)
    at /home/zj/project/inkline/source/qemu/qemu-5.1.0/softmmu/main.c:47
47	{
(gdb) l
42	#undef main
43	#define main qemu_main
44	#endif /* CONFIG_COCOA */
45	
46	int main(int argc, char **argv, char **envp)
47	{
48	    qemu_init(argc, argv, envp);
49	    qemu_main_loop();
50	    qemu_cleanup();
51	
(gdb) s