Posts

Showing posts from April, 2020

SwiftUI] Displaying Modal View in SwiftUI (Modal View)

Image
Today, we will see how to launch Modal View in SwiftUI.  How to do the following in SwiftUI to bring up a modal view with existing Objective-C? - ( IBAction )showMyModal { MyModal *myModal = [[MyModal alloc]initWithNibName: @"MyModal" bundle: nil ]; [myModal setModalTransitionStyle: UIModalTransitionStylePartialCurl ]; [ self presentModalViewController:myModal animated: YES ]; } First, create a SwiftUI project as an example and add a Button to the ContentView. import SwiftUI struct ContentView : View { var body: some View { VStack{ Text( "Hello, World!" ) Button(action: { print( "hello button!!" ) }) { Text( /*@START_MENU_TOKEN@*/ "Button" /*@END_MENU_TOKEN@*/ ) } } } } struct ContentView_Previews : PreviewProvider { static var previews: some View { ContentView() } } Define the

DLL Injection using CreateRemoteThread in Windows 10

Image
DLL Injection using CreateRemoteThread One of the methods of DLL injection is to create a RemoteThread and load the desired DLL into the target process.  This is one of the simplest and most widely used methods.  CreateRemoteThread You can create a thread in another process using the API. CreateRemoteThread If you browse on MSDN, you'll see the following in Remarks: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createremotethread   CreateRemoteThread function (processthreadsapi.h)-Win32 apps Creates a thread that runs in the virtual address space of another process. docs.microsoft.com Terminal Services isolates each terminal session by design.  Therefore,  CreateRemoteThread  fails if the target process is in a different session than the calling process. In translation, Terminal Services Pros say that if the target process is running in a different session, it will fail because the session is specified and executed

Using Overlapped I / O in DeviceIoControl

Image
Using Overlapped I / O in DeviceIoControl Various methods can be used, such as  synchronizing with events and continuously receiving events through polling, to monitor the frequent events in the kernel driver one by one in user mode  . Scenario in question Imagine that you continue to receive events with relatively simple polling.  The kernel driver queues the event that occurred, and the user mode application issues the IOCTL to retrieve the contents of the queue.  In this type of logic, the user-mode application will  While execute the same loop as  DeviceIoControl and will continue to communicate with the driver by calling. while ( true ) { BOOL ret = DeviceIoControl(hDevice, IOCTL_RECV, &data, sizeof (DATA), 0 , 0 ,&dwReturn, NULL ); if (ret) { // 처리.. } } DeviceIoControl Blocking 발생 In the previously used logic,  DeviceIoControl blocking occurs  until an event occurs in the kernel driver  .  DeviceIoControl Blocking occurs in the user m