Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对继承UIViewController的类进行alloc init会报错. 对继承NSObject的类进行初始化alloc init没问题 #98

Open
ljy0jy opened this issue Nov 19, 2024 · 1 comment

Comments

@ljy0jy
Copy link

ljy0jy commented Nov 19, 2024

   result3 = objc.msg_send("NewVcViewController", "alloc")
    NewVcViewController = objc.msg_send(result3,"init")

<<NewVcViewController.h>>
@interface NewVcViewController : UIViewController
-(int)simpleTest:(int)a add:(int)b;

+(int)simpleTest_class:(int)a add:(int)b;
@EnD

<<NewVcViewController.m>>
#import "NewVcViewController.h"

@interface NewVcViewController ()

@EnD

@implementation NewVcViewController

  • (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    }

-(int)simpleTest:(int)a add:(int)b{
return a+b;
}
+(int)simpleTest_class:(int)a add:(int)b {
return a+b;
}

Traceback (most recent call last):
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/chomper/core.py", line 207, in _start_emulate
self.uc.emu_start(address, stop_addr)
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/unicorn/unicorn_py3/unicorn.py", line 642, in emu_start
raise UcError(status)
unicorn.unicorn_py3.unicorn.UcError: Invalid memory fetch (UC_ERR_FETCH_UNMAPPED)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/new/Documents/learn/iOS逆向/chomper_code/chomper/examples/ios_te.py", line 62, in
main()
File "/Users/new/Documents/learn/iOS逆向/chomper_code/chomper/examples/ios_te.py", line 51, in main
NewVcViewController = objc.msg_send(result3,"init")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/chomper/objc.py", line 55, in msg_send
return self.emu.call_symbol("_objc_msgSend", receiver, sel, *new_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/chomper/core.py", line 723, in call_symbol
return self._start_emulate(address, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/chomper/core.py", line 210, in _start_emulate
self.crash("Unknown reason", exc=e)
File "/Users/new/Documents/pythonProject/iosRe/.venv/lib/python3.12/site-packages/chomper/core.py", line 355, in crash
raise EmulatorCrashedException(
chomper.exceptions.EmulatorCrashedException: Unknown reason at libcorecrypto.dylib!0x1c426a4d8
nanobind: leaked 22 instances!

@sledgeh4w
Copy link
Owner

sledgeh4w commented Nov 19, 2024

chomper 主要用来模拟执行加解密相关的程序,并没有支持所有的 OC 类,尤其是像这种 UI 相关的类。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants