binaryfiles

How to determine which glibc function is called from binary?

半城伤御伤魂 提交于 2019-12-13 07:39:46
问题 Is there any way we could say which glibc function is called from ARM elf binary? For example, consider the following diassembly: 8300 <printf@plt-0x40>: .... 8320: e28fc600 add ip, pc, #0, 12 8324: e28cca08 add ip, ip, #8, 20 ; 0x8000 8328: e5bcf344 ldr pc, [ip, #836]! ; 0x344 .... 83fc <main>: ... 8424:ebffffbd bl 8320 <_init+0x2c> Here, how we can say that bl 8320 is a call to printf? Is this information stored in ELF binary somewhere? 回答1: Is there any way we could say which glibc

fread string of dynamic size from a binary file

三世轮回 提交于 2019-12-13 05:17:54
问题 I need to know how to read a string from a binary file using fread (). Thing is, as I understand, if I want to copy the value of some string to a new string declared like this: char *string; I need to calculate first the length of the other string using strlen () , use that value to reserve memory for my new string with malloc , and then copy the value o the other string to my new string using strcpy () Kinda like this: newLength = strlen ( otherString ) + 1; string = malloc ( sizeof ( char )

Write a file into another binary file

寵の児 提交于 2019-12-13 05:05:03
问题 Like the title says I'm trying to write a file within another binary file, the thing is that the way I do it, it seems that it saves a reference to the original file, not the file itself, anyone knows how can I do save the whole file not just a reference? here's the code I used: File archivo = new File(name + ".compressing"); BitOS fop = new BitOS( new FileOutputStream(archivo)); for (int i = 0; i < secuenciaFinal.length(); i++) { if (secuenciaFinal.charAt(i) == '1') { fop.write(1);//lee la

Upload binary data with HTTP PUT with jersey jaxrs-ri-2.01

拟墨画扇 提交于 2019-12-13 04:53:25
问题 I am using jaxrs-ri-2.01 I would like to get in a parameter the binary data that is sent in the body of my HTTP PUT request. I have found one annotation that should do the trick : @FormDataParam but it does not seem to be available for the jaxrs-ri-2.01 I would like to know: if there's a way I can do it with this jaxrs-ri version if it's mandatory to change jaxrs-ri version to a more recent one how to use this annotation Thank you in advance for your answers! 回答1: if there's a way I can do it

std::istreambuf_iterator<char> initializes with no arguments?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 04:24:46
问题 Here is the code: #include <iostream> #include <fstream> #include <vector> #include <iomanip> std::vector<unsigned char> bytes; { std::ifstream in(name, std::ios_base::binary); bytes.assign(std::istreambuf_iterator<char>(in >> std::noskipws), std::istreambuf_iterator<char>()); } According to the reference, the vector.assign function takes two arguments, first and last , and takes anything in between into the vector. And the istreambuf_iterator function takes this form: istreambuf_iterator(

Can an executable be linked to a dynamic library after its built?

别说谁变了你拦得住时间么 提交于 2019-12-13 03:53:44
问题 I have built a binary 'foo'. I now want the executable to be a linked to a dynamic library 'bar'. How can I link foo to bar?(using ld or any other way). I don't want to use DYLIB_INSERT_PATH on OSX or its equivalent LD_PREOAD on Linux. I want to do this on OSX, but this question is a generic one. 回答1: What's your intention? The link process resolves symbols: it provide satisfactions to needs. If the executable doesn't need any symbols offers by the dynamic library, the linker will entirely

Write hex-string to file in binary mode

主宰稳场 提交于 2019-12-13 03:52:48
问题 I want to write the hexadecimal values to a binary file in order they look the same when I open in hex editor. My current code is this: Sub Write2Binary() Dim i As Integer Dim nFileNum As Integer Dim sFilename As String sFilename = "D:\OutputPath\Test.bin" strBytes = "F3 A1 02 00 04 00 8D 24 44 C3 8C 03 83 49 26 92 B5" arrBytes = Split(strBytes) nFileNum = FreeFile Open sFilename For Binary Lock Read Write As #nFileNum For i = LBound(arrBytes) To UBound(arrBytes) Put #nFileNum, , arrBytes(i)

Unexpected “padding” in a Fortran unformatted file

三世轮回 提交于 2019-12-13 02:29:06
问题 I don't understand the format of unformatted files in Fortran. For example: open (3,file=filename,form="unformatted",access="sequential") write(3) matrix(i,:) outputs a column of a matrix into a file. I've discovered that it pads the file with 4 bytes on either end, however I don't really understand why, or how to control this behavior. Is there a way to remove the padding? 回答1: For unformated IO, Fortran compilers typically write the length of the record at the beginning and end of the

Generate low-order non-printable characters from XLST

不羁的心 提交于 2019-12-13 02:05:41
问题 I'm trying to use XSLT text output to generate a file (in a file format that I'm not in control of), and while it is mostly text, it includes low-order non-printable characters as flags, including characters that are not valid within an XLST file (according to the XSLT specification). I'd like for something like the below to work, but instead it isn't a valid XSLT file since it it contains characters that are not allowed in XSLT files: <?xml version="1.0" encoding="US-ASCII" ?> <xsl

Eclipse CDT cannot find built exe file after building, have to click run configuration

天涯浪子 提交于 2019-12-13 01:22:41
问题 I am using Eclipse CDT. I encounter a really weird problem. After I built a project, I click on the project and choose run as -> local c/c++ project , it will throw a binary not found error. If I right click the project -> run configuration , but does not make any changes or touch any buttons, and click Run , it compiles and runs perfectly... So everytime, I have to click the run configurations , and then hit run. I also have the auto-build option on in the properties. Does anyone have an