От: | Аноним | ||
Дата: | 18.02.10 07:51 | ||
Оценка: |
void func1()
{
}
void func2()
{
}
int _tmain(int argc, _TCHAR* argv[])
{
int addr_func1 = (int)(&func1);
int addr_func2 = (int)(&func2);
printf( "func1 = %d, func2 = %d ", addr_func1, addr_func2 );
return 0;
}
func1 = 4264311, func2 = 4264306
0041143E mov dword ptr [addr_func1],offset func1 (411177h)
int addr_func2 = (int)(&func2);
00411445 mov dword ptr [addr_func2],offset func2 (411172h)
void func1()
{
004113C0 push ebp
004113C1 mov ebp,esp
004113C3 sub esp,0C0h
004113C9 push ebx
004113CA push esi
004113CB push edi
004113CC lea edi,[ebp-0C0h]
004113D2 mov ecx,30h
004113D7 mov eax,0CCCCCCCCh
004113DC rep stos dword ptr es:[edi]
}
004113DE pop edi
004113DF pop esi
004113E0 pop ebx
004113E1 mov esp,ebp
004113E3 pop ebp
004113E4 ret
--- No source file -------------------------------------------------------------
004113E5 int 3
004113E6 int 3
004113E7 int 3
004113E8 int 3
004113E9 int 3
004113EA int 3
004113EB int 3
004113EC int 3
004113ED int 3
004113EE int 3
004113EF int 3
--- g:\users\pavel\documents\visual studio 2005\projects\test_mem\test_mem\test_mem.cpp
void func2()
{
004113F0 push ebp
004113F1 mov ebp,esp
004113F3 sub esp,0C0h
004113F9 push ebx
004113FA push esi
004113FB push edi
004113FC lea edi,[ebp-0C0h]
00411402 mov ecx,30h
00411407 mov eax,0CCCCCCCCh
0041140C rep stos dword ptr es:[edi]
}
0041140E pop edi
0041140F pop esi
00411410 pop ebx
00411411 mov esp,ebp
00411413 pop ebp
00411414 ret
--- No source file -------------------------------------------------------------
00411415 int 3
00411416 int 3
00411417 int 3
00411418 int 3
00411419 int 3
0041141A int 3
0041141B int 3
0041141C int 3
0041141D int 3
0041141E int 3
0041141F int 3
--- g:\users\pavel\documents\visual studio 2005\projects\test_mem\test_mem\test_mem.cpp
int _tmain(int argc, _TCHAR* argv[])
{
00411420 push ebp
00411421 mov ebp,esp
00411423 sub esp,0D8h
00411429 push ebx
0041142A push esi
0041142B push edi
0041142C lea edi,[ebp-0D8h]
00411432 mov ecx,36h
00411437 mov eax,0CCCCCCCCh
0041143C rep stos dword ptr es:[edi]
int addr_func1 = (int)(&func1);
0041143E mov dword ptr [addr_func1],offset func1 (411177h)
int addr_func2 = (int)(&func2);
00411445 mov dword ptr [addr_func2],offset func2 (411172h)
printf( "func1 = %d, func2 = %d ", addr_func1, addr_func2 );