A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 41

Thread: what the * is a byteArray anyway

  1. #21
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    In this case the example.swf has to be in the server too, isnt it?I know some ppl can see all the stuff in the server, not just the ones the browser shows
    As for obfuscation, i've heard somewhere here on fk that there are programs that can remove the junk code from a obfuscated swf, thats why i am looking for other ways
    All i want now is a way to send a single password from php to flash, so that flash can use it to decode the byteArray, and send in a way that nothing besides my swf in my server can read it

  2. #22
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    But this may be stuff for another topic
    Thanks everyone on this one
    Last edited by Cimmerian; 02-16-2007 at 12:58 PM.

  3. #23
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Quote Originally Posted by Cimmerian
    In this case the example.swf has to be in the server too, isnt it?
    It has to be on the server, but it doesnt have to be within a public directory of that server. This makes it inaccessible any way except through server-side scripting. For example, most servers are setup to have something like a www folder that represents the public directory structure of the site. Keeping the SWF outside of that will allow PHP to still access it but prevent others from being able to navigate to it via URL.

    Plus, as I said before, no solution is full proof. If its out there, its out there. :-/

  4. #24
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    That is nice...and how do i load it in the swf?Flex help says that the Loader class is for swfs, gif, and jpgs and pngs only, i gess

  5. #25
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    when Loader gets it, its getting the raw binary data with the header information. The header says "Look at me! my type is a SWF" and the binary SWF itself confirms it. The extension has no bearing on whether or not the Loader instance can accept the actual file or not. As far as it knows, its getting a SWF

  6. #26
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Rigth...just two more things:
    1 I've hear that firefox caches everything, even stuff with no cache in header,so if he gets this php file and load into his own swf?

    2 What happens if another swf in another server tryes to load this php file?

  7. #27
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    1. I guess, I don't know about that one
    2. You can probably use some kind of host or referrer check to prevent the script from returning the swf if called from a different server.

    there are probably other threads on Flashkit that explain these things too. Might want to go digging around for information posted by someone who knows more about this than me

  8. #28
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Ok, thanks sen

  9. #29
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Sen, just one more thing...in your example, i dont understand how the encoder.swf puts the new encoded byteArray into the encodedgame.swf

    Thanks in advance...
    Last edited by cancerinform; 02-18-2007 at 03:30 PM.

  10. #30
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    Quote Originally Posted by Cimmerian
    Sen, just one more thing...in your example, i dont understand how the encoder.swf puts the new encoded byteArray into the encodedgame.swf

    Thanks in advance...
    It doesn't. As I said earlier, I saved it myself using a hex editor. However, its completely possible using a server-side script - the hex editor was just easier for me for that example.

  11. #31
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Ok, i have downloaded a hex editor but i dont understand how it works, i gess i will take some time to figure out
    Anyway, there is one last thing (for now) about byteArrays...i mean, if i have two swfs, one parent and one child, and the parent loads the child, is there any way for the child to know, when is loaded, the byteArray of the parent?
    Thanks

  12. #32
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Rise from the grave!!!
    Hey sen...i think im a boring person but i got to ask...
    What hex editor are you using and were are good tutorials for it?
    Thanks...

  13. #33
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    I've used hexplorer in the past and I think now I'm using something called "Free Hex Editor" (simple enough) - a free version of an otherwise more feature rich editor.

    Are you looking for tutorials about the editors or what hexadecimal is?

  14. #34
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    I am looking for tutorials on exe editors
    Hexadecimal i think i know what it is; it is FF, FE, FD instead of numbers

  15. #35
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Right, this hex editor is a lot more intuitive then the other i was using before
    I think i am almost getting
    When i open a file it shows a lot of things like that:

    000000e0: 5a 24 8f 82 21 04 00 02 08 14 81 8d d0 5c ca 38

    So, i belive that the 000000e0 is the byte and the rest are the values inside that byte, inst it?So that in a byteArray object those would be the values of the item with index 14 isnt it?
    Now, what i dont understand is; a byte == 8 bits, but here it shows 16, not 8, of those little things like 8f, 82, 21...
    Or a bit is two of those?i mean, a bit is 5a 24, another one is 8f 82...is that it?Thanks

  16. #36
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    hex editors arent so much exe editors as they are just file readers. What you're getting with a hex editor is a hex representation of the bits within a file - any file. What you're seeing is just the 1's and 0's of a file reformatted to their hex representations. If you know what bytes in a file (exe) does what, and you open that file in a hex editor, you can change that file's bytes to read whatever you want.

  17. #37
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Rigth, but what i want to understand is:
    each bunch of 1a, 1c, c3 after the 000000e0 is a byte, isnt it?

  18. #38
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Note: You will never stop somebody from decompiling your game or application, however you can take steps to make it alot more difficult.

    If you load a flash movie over http, it will be stored in the browsers cache, from here potential decompilers can take the file and start work on it. Flash 9 flash movies are not yet decompilable as far as i am aware, but they will be in due course.

    One way to avoid the browser caching the file is to send the raw bytes over a socket connection (see flash.net.Socket class) and then use the Loader.loadBytes() method to re-construct the swf at run-time. This way, a file never physically exists.

    From their you need to protect the socket server so it only sends out the raw bytes of your game to visitors of your website, which is a much easier task than trying to protect the flash movie itself.

  19. #39
    hippie hater Cimmerian's Avatar
    Join Date
    Oct 2006
    Location
    over there
    Posts
    599
    Thats what i want to do
    But first i gotta understand that hex editor
    I'm think now that MAYBE that number 0000000d0 has nothing to do...and that the 1 byte is each 08, a2, 49 that it shows...SO, that in a byteArray object the item with index 0 would have the value of the first pair of digits...and so on

  20. #40
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Thats not really the case, instances of the ByteArray class have different methods for extracting different types of data.

    However, understanding ByteArrays is not really necessary to use Loader.loadBytes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center