OSDN Git Service

* [libintel64asm] Create Test Binary File.
[drdeamon64/drdeamon64.git] / drdrv1.c
1 /*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
2
3                          D r . D e a m o n  6 4
4                         for INTEL64(R), AMD64(R)
5         
6    Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
7
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
10
11  1. Redistributions of source code must retain the above copyright notice,
12     this list of conditions and the following disclaimer.
13  2. Redistributions in binary form must reproduce the above copyright
14     notice, this list of conditions and the following disclaimer in the
15     documentation and/or other materials provided with the distribution.
16
17 THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
18 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
30
31 /* File Info -----------------------------------------------------------
32 File: drd64_.c
33 Function: 
34 Comment: 
35 ----------------------------------------------------------------------*/
36
37 //#include"include/drd64_types.h"
38 #include<stdio.h>
39 #include<stdlib.h>
40
41 int
42         main(
43                 int argc,
44                 char *argv[] )
45 {
46         int             i_target_pid;
47         int             i_err;
48         int             i_cid;
49         
50         if( 2 > argc )  {
51                 puts(" drd64 [Target PID] <Connect Server Addr.>");
52                 return 0x00;
53         }
54
55         i_target_pid    = atoi( argv[1] );
56         printf("TestProg. PID = %d\n", getpid());
57
58         Drd64_LibDrd64_InitSystem();
59
60         /* 001. Connect Marshald */
61         i_err   = Drd64_LibDrd64_Cmd_Connect();
62         if( 0x00 != i_err )             {
63                 puts("[Error] Can't Connect Local-Marshald");
64                 return 0x00;
65         }
66
67         if( 2 == argc )         {
68                 i_cid = Drd64_LibDrd64_Cmd_Attach( i_target_pid, "localhost" );
69         }
70         else if ( 2 < argc )    {
71                 i_cid = Drd64_LibDrd64_Cmd_Attach( i_target_pid, argv[2] );
72         }
73         if( 0 > i_cid )         {
74                 puts("[Error] Can't Attach Target-Process");
75                 return 0x00;
76         }
77         printf(" Attach CID = %d\n", i_cid );
78
79         sleep(2);
80         Drd64_LibDrd64_Cmd_Detach( i_cid );
81         Drd64_LibDrd64_Cmd_DisConecct();
82         Drd64_LibDrd64_TermSystem();
83
84         return 0x00;
85 }
86
87
88 /* EOF of drd64_.c ----------------------------------- */