Last change
on this file since 254 was 250, checked in by dai_9181, 17 years ago |
Selectステートメントのスケジュール機構をリファクタリング
|
File size:
1.2 KB
|
Line | |
---|
1 | #include "stdafx.h"
|
---|
2 |
|
---|
3 | #include <NativeCode.h>
|
---|
4 | #include <Procedure.h>
|
---|
5 |
|
---|
6 | #define BREAK_EIP(checkEip) (obp+0x00401000>=checkEip)
|
---|
7 |
|
---|
8 | void ObpPlus( int step )
|
---|
9 | {
|
---|
10 | extern int obp;
|
---|
11 | obp += step;
|
---|
12 |
|
---|
13 | // 例:epi=0x00401999
|
---|
14 | if( BREAK_EIP(0x00433FD7) )
|
---|
15 | {
|
---|
16 | int test=0;
|
---|
17 | }
|
---|
18 | }
|
---|
19 |
|
---|
20 | void NativeCode::PutUserProcSchedule( const UserProc *pUserProc, bool isCall )
|
---|
21 | {
|
---|
22 | pUserProc->Using();
|
---|
23 |
|
---|
24 | Schedule schedule( pUserProc, size );
|
---|
25 | if( isCall == false )
|
---|
26 | {
|
---|
27 | schedule.SpecifyAddressOf();
|
---|
28 | }
|
---|
29 | schedules.push_back( schedule );
|
---|
30 |
|
---|
31 | *((long *)(codeBuffer+size))=0;
|
---|
32 | size += sizeof(long);
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | // 未完成
|
---|
37 | if( isCall )
|
---|
38 | {
|
---|
39 | pobj_SubAddrSchedule->add(pUserProc,1);
|
---|
40 | }
|
---|
41 | else
|
---|
42 | {
|
---|
43 | pobj_SubAddrSchedule->add(pUserProc,0);
|
---|
44 | }
|
---|
45 | extern char *OpBuffer;
|
---|
46 | extern int obp;
|
---|
47 | *((long *)(OpBuffer+obp))=0;
|
---|
48 | ObpPlus( sizeof(long) );
|
---|
49 | }
|
---|
50 |
|
---|
51 | void NativeCode::PutDllProcSchedule( const DllProc *pDllProc )
|
---|
52 | {
|
---|
53 | pDllProc->Using();
|
---|
54 |
|
---|
55 | schedules.push_back( Schedule( pDllProc, size ) );
|
---|
56 |
|
---|
57 | *((long *)(codeBuffer+size))=0;
|
---|
58 | size += sizeof(long);
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 | // 未完成
|
---|
63 | pobj_ImportAddrSchedule->add(pDllProc);
|
---|
64 | extern char *OpBuffer;
|
---|
65 | extern int obp;
|
---|
66 | *((long *)(OpBuffer+obp))=0;
|
---|
67 | ObpPlus( sizeof(long) );
|
---|
68 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.