-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathSession.hpp
More file actions
69 lines (54 loc) · 1.46 KB
/
Session.hpp
File metadata and controls
69 lines (54 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#using <WindowsBase.dll>
#include <frida-core.h>
#include <msclr/gcroot.h>
using namespace System;
using System::Windows::Threading::Dispatcher;
namespace Frida
{
ref class Script;
enum class SessionDetachReason;
ref class SessionDetachedEventArgs;
public delegate void SessionDetachedHandler (Object ^ sender, SessionDetachedEventArgs ^ e);
public ref class Session
{
internal:
Session (FridaSession * handle, Dispatcher ^ dispatcher);
public:
~Session ();
protected:
!Session ();
public:
event SessionDetachedHandler ^ Detached;
property unsigned int Pid { unsigned int get (); }
void Detach ();
Script ^ CreateScript (String ^ source);
Script ^ CreateScript (String ^ source, String ^ name);
internal:
void OnDetached (Object ^ sender, SessionDetachedEventArgs ^ e);
private:
FridaSession * handle;
msclr::gcroot<Session ^> * selfHandle;
Dispatcher ^ dispatcher;
SessionDetachedHandler ^ onDetachedHandler;
};
public enum class SessionDetachReason
{
ApplicationRequested = 1,
ProcessReplaced,
ProcessTerminated,
ConnectionTerminated,
DeviceLost
};
public ref class SessionDetachedEventArgs : public EventArgs
{
public:
property SessionDetachReason Reason { SessionDetachReason get () { return reason; } };
SessionDetachedEventArgs (SessionDetachReason reason)
{
this->reason = reason;
}
private:
SessionDetachReason reason;
};
}