4
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by Salem
0

C++ and delphi are not compatible , better learn the algorithm and code it in delphi afresh.

-1

Hi All User

Please Translate C++ To Delphi

Thank You Very Much

int Generate_Reloction_Map(BYTE* Reloc_Seg, DWORD Func_RVA, int Func_Size, DWORD* Reloc_Map)
{
	BYTE* Reloc_Ptr = Reloc_Seg;
	int _rel_Cnt = 0;
	while (*(DWORD*)Reloc_Ptr)
	{
		DWORD Reloc_RVA = ((DWORD*)Reloc_Ptr)[0];
		DWORD Block_Size = ((DWORD*)Reloc_Ptr)[1];		
		for (int i = 0; i < (Block_Size - 8) / 2; i++)
		{

			if ((Reloc_RVA + (((WORD*)(Reloc_Ptr + 8))[i] & 0xFFF) >= Func_RVA) &&
				(Reloc_RVA + (((WORD*)(Reloc_Ptr + 8))[i] & 0xFFF) < Func_RVA + Func_Size))
			{
				if (Reloc_Map) 
					Reloc_Map[_rel_Cnt] = Reloc_RVA + (((WORD*)(Reloc_Ptr + 8))[i] & 0xFFF);
				_rel_Cnt++;
			}
		}
		Reloc_Ptr += Block_Size;
	}
	return _rel_Cnt;
}
Votes + Comments
Posting your malware one function at a time won't get it done either - go away
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.