bridgeic
June 1st, 2012, 03:25
There is a PE file, it's section table show as below.
2604
Below is part of the codes of the PE:
00408F2E |. 6A 7E PUSH 7E
00408F30 |. 68 60654D00 PUSH lmcrypt.004D6560
00408F35 |. 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
00408F38 |. 51 PUSH ECX
00408F39 |. E8 17330000 CALL lmcrypt.0040C255
After copy the PE and past it at the end of another PE, the codes upper changed to codes below automatically.
004F8DAE |. 6A 7E PUSH 7E
004F8DB0 |. 68 60654D00 PUSH merge_2.004D6560
004F8DB5 |. 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
004F8DB8 |. 51 PUSH ECX
004F8DB9 |. E8 17330000 CALL merge_2.004FC0D5
You see, the adress for the call function adjusted automatically from 0040C255 to 004FC0D5 based on relocation table.
My question is why the value "004D6560"(points to .data section in first PE) in 2nd line "PUSH 004D6560" won't change acoordingly? Is there way can let 'PUSH 004D6560' adjusted address automatically also? Whether the 1st PE file should has another relocation table corrsponding to .data section?
2604
Below is part of the codes of the PE:
00408F2E |. 6A 7E PUSH 7E
00408F30 |. 68 60654D00 PUSH lmcrypt.004D6560
00408F35 |. 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
00408F38 |. 51 PUSH ECX
00408F39 |. E8 17330000 CALL lmcrypt.0040C255
After copy the PE and past it at the end of another PE, the codes upper changed to codes below automatically.
004F8DAE |. 6A 7E PUSH 7E
004F8DB0 |. 68 60654D00 PUSH merge_2.004D6560
004F8DB5 |. 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
004F8DB8 |. 51 PUSH ECX
004F8DB9 |. E8 17330000 CALL merge_2.004FC0D5
You see, the adress for the call function adjusted automatically from 0040C255 to 004FC0D5 based on relocation table.
My question is why the value "004D6560"(points to .data section in first PE) in 2nd line "PUSH 004D6560" won't change acoordingly? Is there way can let 'PUSH 004D6560' adjusted address automatically also? Whether the 1st PE file should has another relocation table corrsponding to .data section?