Search Results

Search found 796 results on 32 pages for 'hex'.

Page 7/32 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Reverse Engineer a .pyo python file

    - by Brian
    I have 2 .pyo python files that I can convert to .py source files, but they don't compile perfectly as hinted by decompyle's verify. Therefore looking at the source code, I can tell that config.pyo simply had variables in in an array: ADMIN_USERIDS = [116901, 141, 349244, 39, 1159488] I would like to take the original .pyo and disassembly or whatever I need to do inorder to change one of these IDs. Or.... in model.pyo the source indicates a if (productsDeveloperId != self.getUserId()): All I would want to do is hex edit the != to be a == .....Simple with a windows exe program but I can't find a good python disassembler anywhere. Any suggestions are welcomed...I am new to reading bytecode and new to python as well.

    Read the article

  • binary sed replacement

    - by Ryan
    Hello, I was attempting to do a sed replacement in a binary file however I am beginning to believe that is not possible. Essentially what I wanted to do was similar to the following: sed -bi "s/\(\xFF\xD8[[:xdigit:]]\{1,\}\xFF\xD9\)/\1/" file.jpg Or more notably... scan through a binary file until the hex code FFD8, continue reading until FFD9, and only save what was between them (discards the junk before and after, but saves FFD8 and FFD9 as part of the file still) Is there a good way to do this? Even if not using sed?

    Read the article

  • Modify EXE to stop launching firefox

    - by Random Joe
    I'm using a wireless modem program from my ISP. This program automatically disconnect when it detects the line is idle. It does so in 2-5 minutes of idle time. Whenever I reconnect, It will automatically fire up my default browser to the ISP portal. I DID NOT pay them to shove their web portal in my face 50 times a day. The ISP provides no options for disabling this behavior. Can someone please show me how to hex edit the EXE program to stop it from annoying the hell out of me?

    Read the article

  • Manipulating binary data in Python

    - by Dominic Bou-Samra
    I am opening up a binary file like so: file = open("test/test.x", 'rb') and reading in lines to a list. Each line looks a little like: '\xbe\x00\xc8d\xf8d\x08\xe4.\x07~\x03\x9e\x07\xbe\x03\xde\x07\xfe\n' I am having a hard time manipulating this data. If I try and print each line, python freezes, and emits beeping noises (I think there's a binary beep code in there somewhere). How do I go about using this data safely? How can I convert each hex number to decimal?

    Read the article

  • Does style="color: #FFF;" render as #F0F0F0 or #FFFFFF?

    - by Dolph Mathews
    When defining colors using "shorthand hexidecimal" (style="color: #FFF;"), is there a defined method for expanding the shorthand? (style="color: #F0F0F0;" or style="color: #FFFFFF;") Do all browsers use the same expansion method? Is this behavior by specification (if so, where is it defined)? Does the expansion method perhaps vary between CSS 1/2/3? I've observed that "most browsers" expand to #FFFFFF. Are there any other places where this shorthand notation is allowed, but the expansion method is different? I've always avoided using shorthand hex, because I've never known the answers to these questions...

    Read the article

  • Add Hexidecimal Header Info to JPEG File Using Java

    - by jboyd
    I need to add header info to a JPEG file in order to get it to work properly when shared on some websites, I've tracked down the correct info through a lot of Hex digging, but now I'm kind of stuck trying to get it into the file. I know where in the file it needs to go, and I know how long it is, my problem is that RandomAccessFile just overwrites existing data in the file and FileOutputStream appends the data to the end. I don't want either, I want to INSERT data starting at the third byte. My example code: File fileToChange = new File("someimage.jpg"); byte[] i = new byte[2]; i[0] = (byte)Integer.decode("0xcc"); i[1] = (byte)Integer.decode("0xcc"); RandomAccessFile f = new RandomAccessFile(new File("videothing.jpg"), "rw"); long aPositionWhereIWantToGo = 2; f.seek(aPositionWhereIWantToGo); // this basically reads n bytes in the file f.write((byte[])i); f.close(); So this doesn't work because it overwrites, and does not insert, I can't find any way to just insert data into a file

    Read the article

  • Add two hexBinarys with XPATH 1.0

    - by fielding
    Hi, my xml document looks somewhat like that (Values are both xsl:hexBinary): <Offsets> <Offset> <Name>ErrorOffset</Name> <Value>DD</Value> </Offset> <Offset> <Name>OtherOffset</Name> <Value>FF</Value> </Offset> </Offsets> <Value> <Name>Error1</Name> <Code>01</Code> </Value> <Value> <Name>Error2</Name> <Code>02</Code> <Offset>ErrorOffset</Offset> </Value> now i want to transform this to a new xml file: <Value> <Name>Error1</Name> <Code>01</Code> </Value> <Value> <Name>Error2</Name> <Code>DF</Code> </Value> All that should happen is adding <Offset> to the basic <Value>. But plain + returns NaN and sum() expects only one parameter. XSLT and XPATH are quite nice, but it goes on my nerves that easy operations like adding two hex values just dont work as easy as it should.

    Read the article

  • How to turn this simple 10 digit hex number back into 8 digits?

    - by Babil
    The algorithm to convert input 8 digit hex number into 10 digit are following: Given that the 8 digit number is: '12 34 56 78' x1 = 1 * 16^8 * 2^3 x2 = 2 * 16^7 * 2^2 x3 = 3 * 16^6 * 2^1 x4 = 4 * 16^4 * 2^4 x5 = 5 * 16^3 * 2^3 x6 = 6 * 16^2 * 2^2 x7 = 7 * 16^1 * 2^1 x8 = 8 * 16^0 * 2^0 Final 10 digit hex is: = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 = '08 86 42 98 E8' The problem is - how to go back to 8 digit hex from a given 10 digit hex (for example: 08 86 42 98 E8 to 12 34 56 78) Some sample input and output are following: input output 11 11 11 11 08 42 10 84 21 22 22 33 33 10 84 21 8C 63 AB CD 12 34 52 D8 D0 88 64 45 78 96 32 21 4E 84 98 62 FF FF FF FF 7B DE F7 BD EF

    Read the article

  • How to add Transparency information to a HEX color code?

    - by TK123
    I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the user change text color. It gives HEX values like so: #RRGGBB And there is a slider that allows the user to change a text's transparency. It runs from 0.1 to 1 Somehow I need to get a 2 digit letter from this transparency amount and append it to the HEX value for it to work. Does anyone know how to append Alpga information to HEX color codes? What is the math formula for it? I guess the question can also be answered if anyone knows how to concert RGBA color values with transparency into HEX: rgba(255, 255, 255, 0.6)

    Read the article

  • What is the quikest method to see actual color of any hex code #a7a7a7?

    - by metal-gear-solid
    What is the quikest method to see actual color of any hex code #a7a7a7? When i work on other's CSS then if i deal with color codes then i quickly wan to see the color of that particular hex code. suppose if i'm editing css in notepad and i found code #a7a7a7 then how can i know what is the color of this code. If i have a color on my screen then i quickly know what would be hex code for this with the help of some tools ,but i need just opposite of this. i'm not talking about to see whole color chart of site. I want to see color of particular hex code.

    Read the article

  • How to convert a string to a binary, then hex, value?

    - by Wuschelbeutel Kartoffelhuhn
    In one column I have a bitstring encoded as a string type. In a different column I wish to have the same bits (potentially starting with a leading 0), but as a binary value type. Ultimately, I want to have it in hex representation (string or hex type, doesn't matter) in a third column. How is this done? Do I have to program something for it or is there a faster way? Input cell contains the following string: 00000100100011000100100011 I wish to obtain the string: 0123123

    Read the article

  • How to get raw jpeg data (but no metatags / proprietary markers)

    - by CoolAJ86
    I want to get raw jpeg data - no metadata. I'm very confused looking at the jpeg "standards". How correct is my understanding of the marker "tree"? 0xFFD8 - Identifies the file as an image 0xFFE? - EXIF, JFIF, SPIFF, ICC, etc 0x???? - the length of the tag 0xFFD8 - Start of Image 0xFFE0 - should follow SOI as per spec, but often preceded by comments ??? 0x???? - Matrices, tags, random data ??? There are never other markers in-between these markers? Or these include the matrices and such? 0xFFDA - Start of Stream - This is what I want, yes? 0xXXXX - length of stream 0xFFD9 - End of Stream (EOI) 0x???? - Comment tags, extra exif, jfif info??? 0xFFD9 - End of Image 0xFF00 - escaped 0xFF, not to be confused with a marker This has been my reading material: http://en.wikipedia.org/wiki/JPEG http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html http://www.media.mit.edu/pia/Research/deepview/exif.html http://www.faqs.org/faqs/jpeg-faq/part1/section-15.html

    Read the article

  • Why am I not getting the expected results with fread() in C?

    - by mauvehead
    Here is my code: #include <stdio.h> int main(void) { FILE *fp; unsigned int i; char bytes[512]; fp = fopen("myFile","r"); for(i = 0;i <= 512;i++) { fread(&bytes, sizeof(bytes), 1, fp); printf("bytes[%d]: %x\n", i, bytes[i]); } } Here is the expected output $ hexdump myFile 0000000 aa55 aa55 0060 0000 0a17 0000 b1a5 a2ea 0000010 0000 0000 614c 7563 616e 0000 0000 0000 0000020 0000 0000 0a68 0000 1001 421e 0000 0000 0000030 f6a0 487d ffff ffff 0040 0000 002f 0000 But here is what I see from my program bytes[0]: 55 bytes[1]: 8 bytes[2]: ffffffc8 bytes[3]: ffffffdd bytes[4]: 22 bytes[5]: ffffffc8 bytes[6]: ffffff91 bytes[7]: 63 bytes[8]: ffffff82 My obvious guess is that I'm either addressing something incorrectly and receiving the wrong data back or I am printing it incorrectly and viewing it the wrong way.

    Read the article

  • Is there a simpler way to convert a byte array to a 2-byte-size hexadecimal string?

    - by Tom Brito
    Is there a simpler way of implement this? Or a implemented method in JDK or other lib? /** * Convert a byte array to 2-byte-size hexadecimal String. */ public static String to2DigitsHex(byte[] bytes) { String hexData = ""; for (int i = 0; i < bytes.length; i++) { int intV = bytes[i] & 0xFF; // positive int String hexV = Integer.toHexString(intV); if (hexV.length() < 2) { hexV = "0" + hexV; } hexData += hexV; } return hexData; } public static void main(String[] args) { System.out.println(to2DigitsHex(new byte[] {8, 10, 12})); } the output is: "08 0A 0C" (without the spaces)

    Read the article

  • php XML DOM translates special chars to &#xYY;

    - by ZiTAL
    I send this with AJAX POST: <li><ul class "zone zCentral ui-sortable"><li><ul class="region rCol3 ui-sortable"><li class="" style=""><div><span class="tc tc_video">574081</span> <span>video: 'Mundo.Hoy': ¿Dónde habré olvidado... mi memoria?</span></div></li></ul></li></ul></li> I do this to create XML: header('Content-type: text/html; charset=utf-8'); if(isset($_POST) && isset($_POST['data'])) { $data = '<ul id="zone_container" class="ui-sortable">'; $data .= $_POST['data']; $data .= '</ul>'; $dom = new DOMDocument('1.0', 'utf-8'); $dom->loadXML($data); echo $dom->saveXML(); exit(); } and i get this: <?xml version="1.0"?> <ul id="zone_container" class="ui-sortable"> <li><ul class="zone zCentral ui-sortable"><li><ul class="region rCol3 ui-sortable"><li class="" style=""><div><span class="tc tc_video">574081</span> <span>video: 'Mundo.Hoy': &#xBF;D&#xF3;nde habr&#xE9; olvidado... mi memoria?</span></div> </li></ul></li></ul></li></ul> ¿Dónde habré olvidado... mi memoria? translates to: &#xBF;D&#xF3;nde habr&#xE9 ; olvidado... mi memoria? Y need original chars in the XML, these are utf-8 valid i don't know the reason for this encode :(

    Read the article

  • setBit java method using bit shifting and hexadecimal code - question

    - by somewhat_confused
    I am having trouble understanding what is happening in the two lines with the 0xFF7F and the one below it. There is a link here that explains it to some degree. http://www.herongyang.com/java/Bit-String-Set-Bit-to-Byte-Array.html I don't know if 0xFF7FposBit) & oldByte) & 0x00FF are supposed to be 3 values 'AND'ed together or how this is supposed to be read. If anyone can clarify what is happening here a little better, I would greatly appreciate it. private static void setBit(byte[] data, final int pos, final int val) { int posByte = pos/8; int posBit = pos%8; byte oldByte = data[posByte]; oldByte = (byte) (((0xFF7F>>posBit) & oldByte) & 0x00FF); byte newByte = (byte) ((val<<(8-(posBit+1))) | oldByte); data[posByte] = newByte; } passed into this method as parameters from a selectBits method was setBit(out,i,val); out = is byte[] out = new byte[numOfBytes]; (numOfBytes can be 7 in this situation) i = which is number [57], the original number from the PC1 int array holding the 56-integers. val = which is the bit taken from the byte array from the getBit() method.

    Read the article

  • What's the most effective way to interpolate between two colors? (pseudocode and bitwise ops expecte

    - by navand
    Making a Blackberry app, want a Gradient class. What's the most effective way (as in, speed and battery life) to interpolate two colors? Please be specific. // Java, of course int c1 = 0xFFAA0055 // color 1, ARGB int c2 = 0xFF00CCFF // color 2, ARGB float st = 0 // the current step in the interpolation, between 0 and 1 /* Help from here on. Should I separate each channel of each color, convert them to decimal and interpolate? Is there a simpler way? interpolatedChannel = red1+((red2-red1)*st) interpolatedChannel = interpolatedChannel.toString(16) ^ Is this the right thing to do? If speed and effectiveness is important in a mobile app, should I use bitwise operations? Help me! */

    Read the article

  • BigInteger.Parse() on hexadecimal number gives negative numbers.

    - by brickner
    I've started using .NET 4 System.Numerics.BigInteger Structure and I've encountered a problem. I'm trying to parse a string that contains a hexadecimal number with no sign (positive). I'm getting a negative number. For example, I do the following two asserts: Assert.IsTrue(System.Int64.Parse("8", NumberStyles.HexNumber, CultureInfo.InvariantCulture) > 0, "Int64"); Assert.IsTrue(System.Numerics.BigInteger.Parse("8", NumberStyles.HexNumber, CultureInfo.InvariantCulture) > 0, "BigInteger"); The first assert succeeds, the second assert fails. I actually get -8 instead of 8 in the BigInteger. The problem seems to be when I'm the hexadecimal starts with 1 bit and not 0 bit (a digit between 8 and F inclusive). If I add a leading 0, everything works perfectly. Is that a bad usage on my part? Is it a bug in BigInteger?

    Read the article

  • Is there a simpliest way of doing this?

    - by Tom Brito
    Is there a simpler way of implement this? Or a implemented method in JDK or other lib? /** * Convert a byte array to 2-byte-size hexadecimal String. */ public static String to2DigitsHex(byte[] bytes) { String hexData = ""; for (int i = 0; i < bytes.length; i++) { int intV = bytes[i] & 0xFF; // positive int String hexV = Integer.toHexString(intV); if (hexV.length() < 2) { hexV = "0" + hexV; } hexData += hexV; } return hexData; } public static void main(String[] args) { System.out.println(to2DigitsHex(new byte[] {8, 10, 12})); } the output is: "08 0C 0A" (without the spaces)

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >