Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Section header / Relocation table question

Status
Not open for further replies.

csolar

Programmer
Dec 10, 2003
11
US
Hi guys, I have been working with a dll for a mod I am making and I am having trouble changing a few pieces of it.
I realize that dll's are pretty complex and require editing of more then just one part of it, but I want to know what I need to do to get this to work.

Code:
  L241D3DD0:
  		mov	ecx,[L243833F8]
  		mov	edx,[ecx]
  		push	3F800000h
  		push	BF800000h
  		call	[edx+04h]
  		fstp	dword ptr [esp+10h]
  		mov	ecx,[L243833F8]
  		mov	eax,[ecx]
  		push	3F800000h
  		push	BF800000h
  		call	[eax+04h]
  		fst	dword ptr [esp+20h]
  		fmul	dword ptr [esp+20h]
  		fld	dword ptr [esp+10h]
  		fmul	dword ptr [esp+10h]
  		faddp	ST(1),ST
  		fcomp	dword ptr [L242AF84C]
  		fnstsw	ax
  		test	ah,41h
  		jz 	L241D3DD0

[\code]

That is what I want to change, it picks two random numbers from -1 to 1 and repeats if the sum of their squares is greater than 1.  

I have looked at the relocation tables and found there are cells that divide up this code.  When I edit this code here I end up with some recognizeable code in the first cell I edit, but once I reach that cells boundary the next cell is just all 'dd' instructions according to pe explorer.  
I have tried a variety of things and read some articles on pe header format and what I have come to understand is the dll keeps track of each instruction's size, be it 8 bytes, 4 bytes, etc.  And when I put my code in there  am changing the intruction sizes.  So I kindly ask anyone who knows pe header format in much greater detail to explain how I can change what I need to change in order to but different size instructions in there.

Thank you for reading.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top