FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Very Vaugue Specific Question.





Dougie1
Well I read that files can be loaded and can edit the hex values. Now I mod halo 2 and would like to know if I could resign maps in halo 2. I got told that this is how they are resigned:
Quote:
starting at offset 2048 (straight after the header) you have to xor every dword together.

So in the various resigner apps we have dotted around the site, they start a loop running that goes from offset 2048 to the very end of the map -4.
Within the loop a var is xored with the dword (read as an int32) from the current stream. The var is then xored again in the next loop with the next dword in the stream and so on. Eventually you have the final checksum, which is then written in at offset 720

I don't really understand that but I wondered if it was possible with php. I know it is impractical because I could just make a programme in C which would run on my computer and would be easier but I was just wondering and how difficult it would be and if anyone knows how I would do it. Thanks! Very Happy
hexkid
I like your choice of topic!

http://www.php.net/manual/en/language.operators.bitwise.php
Dougie1
Would you be able to help me start. I see that you can xor using:
Code:
$a ^ $b

But I see no mention of how you can start at a specific offset or loop the running.

I also do not know how you would do it with a file as it doesn't show you how you would implement it into a file.

I also don't see how you would store the variables through the file..

Maybe this is a bit advanced for my php skills.

Do you think this is possible with php and do you think an intermediate at it could manage it? Thanks.
hexkid
Well ... do it just like you would in C.

Code:
/* pseudo-code */
fopen(); /* input */
fopen(); /* output */
while (!feof()) {
  getc(); /* input */ /* fgetc() in PHP */
  xor();
  putc(); /* output */ /* fwrite() in PHP */
}
fclose();
fclose();
Related topics
General FAQ forum
Closed topics just when you need them most.
coppermine or galleries
Tutorial portals
irony: Liberal Church May Lose Funds Over Sermon
My posts are missing
Computer won't route
Gmail = Functions missing!!
Hibernating
I need Flash 8 Help
The ultimate question: Are we really here?
Page cache/refresh question
PHPBB Forum question
A question of faith - is faith immoral?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.