All pastes #1893057 Raw Edit

Mine

public text v1 · immutable
#1893057 ·published 2010-07-01 21:27 UTC
rendered paste body
#include <idc.idc>
#include <x360_imports.idc>

static bswap32(value){
	return ((((value >> 0) & 0xFF) << 24) | (((value >> 8) & 0xFF) << 16) | (((value >> 16) & 0xFF) << 8) | (((value >> 24) & 0xFF) << 0));
}

static SetupSections(){
	auto currAddr, i, szSectionName, dwRawSize, dwRawOffset, dwVirSize, dwVirOffset, dwFlags;
	currAddr = FindBinary(0x40000, SEARCH_DOWN, "50 45 00 00");
	currAddr = currAddr + 0xF8;
	for(i=0; i<0xD; i++)
	{
		if(Dword(currAddr+(i*0x28)) != 0)
		{
			szSectionName = GetString(currAddr+(i*0x28)+0, 8, 0);
			dwRawSize = bswap32(Dword(currAddr+(i*0x28)+8));
			dwRawOffset = bswap32(Dword(currAddr+(i*0x28)+0xC));
			dwVirSize = bswap32(Dword(currAddr+(i*0x28)+0x10));
			dwVirOffset = bswap32(Dword(currAddr+(i*0x28)+0x14));
			dwFlags = bswap32(Dword(currAddr+(i*0x28)+0x24));
			
			SegCreate(0x40000+dwRawOffset, 0x40000+dwRawOffset+dwRawSize, 0, 1, 1, 2);
			MoveSegm(0x40000+dwRawOffset, 0x80040000+dwRawOffset, 0);
			RenameSeg(0x80040000+dwRawOffset, szSectionName);
			DelSeg(0x40000+dwRawOffset, 0);
		}
	}
}

static	MakeFunctions()
{
	auto i;
	i=0x8005A800;
	Message(form(".pdata found at 0x%X", i));
	while(i < 0x80061378) //strstr(SegName(i), form(".pdata")) != -1)
	{
		MakeDword(i);
		//MakeUnk(Dword(i), 0);
		MakeCode(Dword(i));
		i = i + 8;
	}
}

static main()
{
	
	//SetupSections();
	MakeFunctions();
}