This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Naville
committed
Mar 10, 2016
1 parent
976a10d
commit 877a5f7
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#import "../SharedDefine.pch" | ||
#define Port 2588 | ||
extern void CYListenServer(short port); | ||
extern void init_Cycript_hook() { | ||
CYListenServer(Port); | ||
NSLog(@"Cycript Server At %i",Port); | ||
CYListenServer(CyPort); | ||
NSLog(@"Cycript Server At %i",CyPort); | ||
//Shall We Inform DeviceIP and Port Through GUI? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifdef PROTOTYPE | ||
#import <Foundation/Foundation.h> | ||
#import <spawn.h> | ||
#import <termios.h> | ||
#import <unistd.h> | ||
#import <sys/ioctl.h> | ||
@interface WebShell{ | ||
int subprocessPTY; | ||
int fatherPTY; | ||
pid_t processPID; | ||
pid_t SSHPID; | ||
} | ||
-(instancetype)init; | ||
@end | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifdef PROTOTYPE | ||
#import "WebShell.h" | ||
@implementation WebShell : NSObject | ||
-(instancetype)init{ | ||
self=[super init]; | ||
self->fatherPTY = open("/dev/ptmx", O_RDWR | O_NOCTTY); | ||
if(self->fatherPTY==-1){ | ||
NSLog(@"/dev/ptmx Handle Returned Error"); | ||
return nil; | ||
} | ||
grantpt(self->fatherPTY); | ||
unlockpt(self->fatherPTY); | ||
|
||
|
||
|
||
return self; | ||
} | ||
-(void)release{ | ||
close(self->subprocessPTY); | ||
close(self->fatherPTY); | ||
[super release]; | ||
|
||
|
||
} | ||
-(void)startChild{ | ||
NSString* address=[[NSString stringWithFormat:@"127.0.0.1:%i",CyPort] autorelease]; | ||
//Viva La Objective-C | ||
|
||
const char *arg1[] = { "/usr/bin/cycript", "-r", address.UTF8String, NULL }; | ||
const char *envp[] = { "TERM=xterm-256color", NULL }; | ||
execve(arg1[0],arg1,envp); | ||
|
||
} | ||
|
||
|
||
@end | ||
|
||
#endif |