Cxbx-Reloaded/Doc/RemovedCode.txt

106 lines
2.6 KiB
Plaintext
Raw Normal View History

2003-02-10 04:51:49 +00:00
disassemble
// ******************************************************************
// * disassemble entry point 0x50 bytes
// ******************************************************************
{
const int BUF_SIZE = 0x50;
disassemble_init(0, INTEL_SYNTAX);
char buf[BUF_SIZE]; /* buffer of bytes to disassemble */
int pos = 0; /* current position in buffer */
int size = 0; /* size of instruction */
struct instr i; /* representation of the code instruction */
while(pos > BUF_SIZE)
{
disassemble_address(buf + pos, &i);
if(size)
{
printf("%.08X: %s", pos, i.mnemonic);
if(i.destType)
{
printf(" %s", i.dest);
if(i.srcType)
{
printf(", %s", i.src);
if(i.auxType)
{
printf(", %s", i.aux);
}
}
}
printf("\n");
pos += size;
}
else
{
pos++;
}
}
disassemble_cleanup();
}
xboxkrnl::NtOpenFile :
/*
char * checkString = "\\Device\\Harddisk0\\partition1\\";
if
(
CompareString
(
LOCALE_USER_DEFAULT,
NORM_IGNORECASE,
ObjectAttributes->ObjectName->Buffer,
ObjectAttributes->ObjectName->Length,
checkString,
strlen(checkString)
)
== CSTR_EQUAL
)
{
xntdll::OBJECT_ATTRIBUTES iObjectAttributes;
xntdll::UNICODE_STRING iUnicodeString =
{
30,
32,
L"C:\\Aaron\\XBoxHD"
};
InitializeObjectAttributes
(
&iObjectAttributes,
&iUnicodeString,
ObjectAttributes->Attributes,
ObjectAttributes->RootDirectory,
NULL
);
if(xntdll::ZwOpenFile(FileHandle, DesiredAccess, &iObjectAttributes, (xntdll::_IO_STATUS_BLOCK*)IoStatusBlock, ShareAccess, OpenOptions) == STATUS_SUCCESS)
MessageBox(NULL, (char*)ObjectAttributes->ObjectName->Buffer, "CxbxKrnl", MB_OK);
}
*/
logo bitmap dump:
FILE *outfile = fopen("C:\\Logo.txt", "wt");
for(uint32 d=0;d<dwLength;d++)
{
if(d%10 == 0)
fprintf(outfile, "\n");
fprintf(outfile, "0x%.02X, ", RLE[d]);
}
fprintf(outfile, "\nsize : %.08X", dwLength);
fclose(outfile);