How to convert a hex string to bytes array in Crystal? - crystal-lang

How can I convert a hex string to bytes array in Crystal?
Example:
87 A3 69 6E 74 01 A5 66 6C 6F 61 74 CB 3F E0 00 00 00 00 00 00 A7 62 6F 6F 6C 65 61 6E C3 A4 6E 75 6C 6C C0 A6 73 74 72 69 6E 67 A7 66 6F 6F 20 62 61 72 A5 61 72 72 61 79 92 A3 66 6F 6F A3 62 61 72 A6 6F 62 6A 65 63 74 82 A3 66 6F 6F 01 A3 62 61 7A CB 3F E0 00 00 00 00 00 00

Like this:
hexstring = "87 A3 69 6E 74 01 A5 66 6C 6F 61 74 CB 3F E0 00 00 00 00 00 00 A7 62 6F 6F 6C 65 61 6E C3 A4 6E 75 6C 6C C0 A6 73 74 72 69 6E 67 A7 66 6F 6F 20 62 61 72 A5 61 72 72 61 79 92 A3 66 6F 6F A3 62 61 72 A6 6F 62 6A 65 63 74 82 A3 66 6F 6F 01 A3 62 61 7A CB 3F E0 00 00 00 00 00 00"
bytes_array = hexstring.split.map(&.to_u8(16))
pp bytes_array, bytes_array.class
https://play.crystal-lang.org/#/r/19dh

Related

010 Editor template issue

I'm trying to create template with "010 editor" and get the following issue.
The array size is not match with length variable.
The array size is not match with length variable
Template:
typedef struct {
int length;
char value[length];
} MyString ;
typedef struct {
int index;
MyString caption;
} MySection;
typedef struct {
int length;
MySection section[length];
} MySections;
struct FILE {
MySections s;
}file;
Binary:
02 00 00 00 01 00 00 00 1D 00 00 00 71 70 73 72
75 74 77 76 79 78 7B 7A 7D 7C 7F 7E 61 60 63 62
65 64 67 66 69 68 6B 6A 6D 02 00 00 00 21 00 00
00 61 60 63 62 65 64 67 66 69 68 6B 6A 6D 6C 6F
6E 71 70 73 72 75 74 77 76 79 78 7B 7A 7D 7C 7F
7E 41
pl. explain where i'm were wrong.

How to de-compress old data compressed with addCRYPT?

since the 2000th years we were using a compression-lib called addCRYPT.dll from a company called littleBIGware for our Windows-apps. Lib and company doesn't exists anymore, but users of our apps created lots of files up to now which are compressed with this lib.
Now for a new version I don't want to use this old lib, but must still be able to decompress the existing data.
I tried Zip, GZip and some others, but with no success.
Does anybody now, how to decompress these data? Here is a hex-dump of the first 64 bytes of some compressed blocks. There is a kind of a pattern visible, but what?
015104: 40 9c 00 00 42 5a 68 39 31 41 59 26 53 59 63 98 00 a8 00 30 ba 70 00 7f ff fa 10 8f fb e0 51 7c 77 db ed 7d bb 92 35 77 63 91 75 89 5d 60 65 91 26 b0 bb 32 ed aa 14 b5 a5 35 8d 34 ae dd c6 fa ...
017640: 40 9c 00 00 42 5a 68 39 31 41 59 26 53 59 2d fc 84 c1 00 49 2e 70 00 7f f8 7a 10 ef fb e0 5a ee 3e 9f 1e da ed a5 68 16 d5 ad ad 6b 3d cf 5e a4 f7 6d d6 d3 6b 47 bb ab 76 39 34 d8 ad bd ec ea ...
015760: 40 9c 00 00 42 5a 68 39 31 41 59 26 53 59 a5 a4 8a 00 00 4a 8b f0 00 7f ff fa 14 cf fb e0 51 dd b6 d5 ad 5e d6 fa 9b b9 bb 1a 77 77 6e dd 54 80 52 aa e5 98 cd 6d ad 92 18 bb 7a cb af 53 b1 da ...
015336: 40 9c 00 00 42 5a 68 39 31 41 59 26 53 59 4f 3c 3e 6f 00 2d cd f0 00 7f ff fe 10 8f fb e0 53 9f 6f 66 cb ec f6 6f 64 a2 da da 61 8d 2a 85 6b 4d 04 80 03 2b 1b 20 16 d9 de cf 6a b3 d5 a0 32 52 ...
016240: 40 9c 00 00 42 5a 68 39 31 41 59 26 53 59 af b2 df 80 00 27 bd f0 00 7f fd fa 10 8f fb e0 57 bd 5e 9f 19 f7 67 02 35 b0 dd ba 5d 67 b3 72 ce cd db 7a eb ba ce bd de f6 af 0c d6 ba d7 57 dc 1c ...

how to decrypt xxtea?

I am trying to se if I can use XXTEA in my application.
The code that I found on Wikipedia code is only for encryption and there is no code for decryption.
How can I decrypt with XXTEA?
I am developing c++ in windows (visual studio 2012)
The code snippet in the article apparently uses negative values of n to mean decoding.
#include <stdio.h>
#include <stdint.h>
void btea(uint32_t *v, int n, uint32_t const key[4]); /* ... */
int main(void) {
char s[128] = "hello world bla bla bla bla bla bla";
uint32_t key[4] = {1,2,3,4};
int n = 128 / sizeof(uint32_t);
printf("%s\n",s);
btea((uint32_t*)s, n, key);
printf("%s\n",s);
btea((uint32_t*)s, -n, key);
printf("%s\n",s);
}
prints:
$ ./a.out | hexdump -C
00000000 68 65 6c 6c 6f 20 77 6f 72 6c 64 20 62 6c 61 20 |hello world bla |
00000010 62 6c 61 20 62 6c 61 20 62 6c 61 20 62 6c 61 20 |bla bla bla bla |
00000020 62 6c 61 0a 2f 44 86 75 d5 16 83 bd 5d 20 af f3 |bla./D.u....] ..|
00000030 a7 dd bf 9f 3a cd a0 13 ef 2b 89 48 2e f6 89 20 |....:....+.H... |
00000040 e2 ba e4 9f ed 38 d1 86 43 82 9e a6 47 6c e4 6d |.....8..C...Gl.m|
00000050 a8 82 22 9e cb 5b d1 a1 18 14 ef 18 ca 23 26 cc |.."..[.......#&.|
00000060 18 1d 4f ba 1b d5 f5 d0 45 72 1c 69 b9 22 a3 08 |..O.....Er.i."..|
00000070 44 71 1f 3b 8f a9 9d 5b 14 93 7b 59 b4 6b e8 1b |Dq.;...[..{Y.k..|
00000080 18 97 1b 74 61 d6 e9 e9 60 96 8e 4c 26 be 21 fc |...ta...`..L&.!.|
00000090 75 9f 4a 18 67 46 f0 95 2b ca 90 d9 f4 ce 3f 2f |u.J.gF..+.....?/|
000000a0 44 82 56 44 c0 0a 39 57 ff 7f 0a 68 65 6c 6c 6f |D.VD..9W...hello|
000000b0 20 77 6f 72 6c 64 20 62 6c 61 20 62 6c 61 20 62 | world bla bla b|
000000c0 6c 61 20 62 6c 61 20 62 6c 61 20 62 6c 61 0a |la bla bla bla.|
000000cf

FFMPEG: directly decode packets after encoding

using FFMPEG API, I try to encode a x264 video to a MP4 file with 0 frame latency and also, in realtime, show the currently encoded frame on screen (with encoding artifacts). The encoding to the file works, but so far I don't get the frames decoded right after writing them to the file. What I try is to feed the packetdata that is returned from avcodec_encode_video() right into avcodec_decode_video2() but the function returns -1 and the cmd output shows:
[h264 # 00000000025F0710] non-existing PPS 0 referenced
[h264 # 00000000025F0710] decode_slice_header error
[h264 # 00000000025F0710] no frame
here is some code i use for encoding:
AVPacket FFMpegEncoder2::write_video_frame(AVFrame* pic, int &numBytes)
{
int out_size, ret;
AVPacket pkt;
/* encode the image */
out_size = avcodec_encode_video(m_cctx, m_outbuf,
m_outbufSize, pic);
/* If size is zero, it means the image was buffered. */
assert(out_size>0) //0 frame delay
av_init_packet(&pkt);
if (m_cctx->coded_frame->pts != AV_NOPTS_VALUE)
pkt.pts = av_rescale_q(m_cctx->coded_frame->pts,m_cctx->time_base, m_video_st->time_base);
if (m_cctx->coded_frame->key_frame)
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = m_video_st->index;
pkt.data = m_outbuf;
pkt.size = out_size;
/* Write the compressed frame to the media file. */
ret = av_interleaved_write_frame(m_fctx, &pkt);
if (ret != 0) {
fprintf(stderr, "Error while writing video frame\n");
exit(1);
}
numBytes = out_size;
return pkt;
}
and then I take this returned packet and feed it into the decoder:
const AVFrame* FFMpegDecoder2::decode(AVPacket* packet){
AVPacket pkt;
av_init_packet(&pkt);
pkt.size = packet->size;
pkt.data = packet->data;
int len=0;
int got_picture=0;
while (pkt.size > 0) {
len = avcodec_decode_video2(m_cctx, m_frame, &got_picture, &pkt);
if (len < 0) {
fprintf(stderr, "Error while decoding frame %d\n", m_f);
exit(1);
}
if (got_picture) {
assert(pkt.size==len);
m_f++;
}
pkt.size -= len;
pkt.data += len;
}
assert(got_picture);
return m_frame;
}
but as stated, avcodec_decode_video2() returns -1
what am I doing wrong? Do i need to feed some headerdata into the decoder first somehow?
//edit:
if i set
m_formatCtx->oformat->flags &= ~AVFMT_GLOBALHEADER;
m_codecctx->flags &= ~CODEC_FLAG_GLOBAL_HEADER;
then i can decode the returned packet without error, but the written mp4 file will be black.
//edit: this is how i setup the decoder:
FFMpegDecoder2::FFMpegDecoder2(CodecID id)
: m_codec(NULL)
, m_cctx(NULL)
{
/* Initialize libavcodec, and register all codecs and formats. */
avcodec_register_all();
m_codec = avcodec_find_decoder(id);
if (!m_codec) {
fprintf(stderr, "codec not found\n");
exit(1);
}
m_cctx = avcodec_alloc_context3(m_codec);
m_cctx->codec = m_codec;
m_cctx->pix_fmt = PIX_FMT_YUV420P;
avcodec_open2(m_cctx, m_codec, NULL);
//alloc frame
m_frame = avcodec_alloc_frame();
}
this is what the memory window shows for the first packet (didn't copy all. the size of the first packet is 7859):
0x0000000002E66670 00 00 01 06 05 ff ff 55 dc 45 e9 bd e6 d9 48 b7 96 2c d8 20 d9 23 ee ef 78 32 36 34 20 2d 20 63 6f 72 65 20 31 32 30 20 72 32 31 34 36 20 62 .....ÿÿUÜEé.æÙH·–,Ø Ù#îïx264 - core 120 r2146 b
0x0000000002E6669F 63 64 34 31 64 62 20 2d 20 48 2e 32 36 34 2f 4d 50 45 47 2d 34 20 41 56 43 20 63 6f 64 65 63 20 2d 20 43 6f 70 79 6c 65 66 74 20 32 30 30 33 cd41db - H.264/MPEG-4 AVC codec - Copyleft 2003
0x0000000002E666CE 2d 32 30 31 31 20 2d 20 68 74 74 70 3a 2f 2f 77 77 77 2e 76 69 64 65 6f 6c 61 6e 2e 6f 72 67 2f 78 32 36 34 2e 68 74 6d 6c 20 2d 20 6f 70 74 -2011 - http://www.videolan.org/x264.html - opt
0x0000000002E666FD 69 6f 6e 73 3a 20 63 61 62 61 63 3d 30 20 72 65 66 3d 33 20 64 65 62 6c 6f 63 6b 3d 31 3a 30 3a 30 20 61 6e 61 6c 79 73 65 3d 30 78 33 3a 30 ions: cabac=0 ref=3 deblock=1:0:0 analyse=0x3:0
0x0000000002E6672C 78 31 31 33 20 6d 65 3d 68 65 78 20 73 75 62 6d 65 3d 34 20 70 73 79 3d 31 20 70 73 79 5f 72 64 3d 31 2e 30 30 3a 30 2e 30 30 20 6d 69 78 65 x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixe
0x0000000002E6675B 64 5f 72 65 66 3d 31 20 6d 65 5f 72 61 6e 67 65 3d 31 36 20 63 68 72 6f 6d 61 5f 6d 65 3d 31 20 74 72 65 6c 6c 69 73 3d 30 20 38 78 38 64 63 d_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dc
0x0000000002E6678A 74 3d 31 20 63 71 6d 3d 30 20 64 65 61 64 7a 6f 6e 65 3d 32 31 2c 31 31 20 66 61 73 74 5f 70 73 6b 69 70 3d 31 20 63 68 72 6f 6d 61 5f 71 70 t=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp
0x0000000002E667B9 5f 6f 66 66 73 65 74 3d 30 20 74 68 72 65 61 64 73 3d 31 20 73 6c 69 63 65 64 5f 74 68 72 65 61 64 73 3d 30 20 6e 72 3d 30 20 64 65 63 69 6d _offset=0 threads=1 sliced_threads=0 nr=0 decim
0x0000000002E667E8 61 74 65 3d 31 20 69 6e 74 65 72 6c 61 63 65 64 3d 30 20 62 6c 75 72 61 79 5f 63 6f 6d 70 61 74 3d 30 20 63 6f 6e 73 74 72 61 69 6e 65 64 5f ate=1 interlaced=0 bluray_compat=0 constrained_
0x0000000002E66817 69 6e 74 72 61 3d 30 20 62 66 72 61 6d 65 73 3d 30 20 77 65 69 67 68 74 70 3d 32 20 6b 65 79 69 6e 74 3d 32 35 20 6b 65 79 69 6e 74 5f 6d 69 intra=0 bframes=0 weightp=2 keyint=25 keyint_mi
0x0000000002E66846 6e 3d 32 20 73 63 65 6e 65 63 75 74 3d 34 30 20 69 6e 74 72 61 5f 72 65 66 72 65 73 68 3d 30 20 72 63 3d 61 62 72 20 6d 62 74 72 65 65 3d 30 n=2 scenecut=40 intra_refresh=0 rc=abr mbtree=0
0x0000000002E66875 20 62 69 74 72 61 74 65 3d 34 30 30 20 72 61 74 65 74 6f 6c 3d 31 2e 30 20 71 63 6f 6d 70 3d 30 2e 36 30 20 71 70 6d 69 6e 3d 30 20 71 70 6d bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpm
0x0000000002E668A4 61 78 3d 36 39 20 71 70 73 74 65 70 3d 34 20 69 70 5f 72 61 74 69 6f 3d 31 2e 34 30 20 61 71 3d 31 3a 31 2e 30 30 00 80 00 00 00 01 65 88 84 ax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00.€....eˆ.
0x0000000002E668D3 11 ef ff f8 22 0f 8a 00 02 09 7e 38 00 08 45 c7 00 01 1d c9 39 3d 87 ff e0 ac 13 03 6d 05 f1 00 10 00 10 12 88 04 00 04 02 60 70 4e 2d cc 38 .ïÿø".Š...~8..EÇ...É9=.ÿà¬..m.ñ.....ˆ....`pN-Ì8
0x0000000002E66902 27 16 e6 07 21 1a e6 1c 84 6b 9f f0 f0 27 15 f2 7b 87 ff c1 58 2a 8a 00 04 b8 80 00 58 00 04 02 62 01 03 c1 c1 04 63 07 04 11 88 90 b1 89 0b '.æ.!.æ..kŸðð'.ò{.ÿÁX*Š..¸€.X...b..ÁÁ.c...ˆ.±..
0x0000000002E66931 1f 2c 11 02 b1 40 00 87 8f a4 f7 0f ff 82 b0 55 06 93 41 c4 10 51 00 00 40 14 00 04 00 a3 b7 35 b7 30 38 26 1e e6 1c 13 0f 73 f2 c1 10 2b 14 .,..±#...¤÷.ÿ.°U.“AÄ.Q..#....£·5·08&.æ...sòÁ.+.
0x0000000002E66960 1f 1f 1c 32 7f 94 11 82 a1 40 01 f1 00 00 40 14 01 22 00 01 e0 1e 22 0a e3 83 1c 19 3d f8 7f e0 b0 16 03 01 22 0f 88 00 02 00 00 16 20 01 17 ...2.”..¡#.ñ..#.."..à.".ãƒ..=ø.à°...".ˆ..... ..
0x0000000002E6698F 03 84 c2 5c 87 09 84 b9 06 4a e4 a4 ae 08 82 d8 e0 00 20 0f 1d 93 df c3 fe 0b 01 54 50 07 88 a8 80 00 64 09 88 58 88 58 83 84 1d 88 38 41 d8 ..Â\.....J䤮..Øà. ..“ßÃþ..TP.ˆ¨€.d.ˆXˆXƒ..ˆ8AØ
0x0000000002E669BE f2 c1 10 2b 14 00 08 f8 e0 00 62 38 64 ff 08 70 13 0a c1 d2 e9 b5 5d ba 10 80 09 a2 01 2e 07 04 c2 dc 87 04 c2 dc 81 c8 66 b9 0e 43 35 cb 0f òÁ.+...øà.b8dÿ.p..ÁÒéµ]º.€.¢....ÂÜ..ÂÜ.Èf..C5Ë.
0x0000000002E669ED ff c1 10 27 2c 00 7e 8e 00 05 64 e4 f6 1f ff 82 28 a0 00 21 99 e3 80 00 99 ac 70 00 11 39 93 93 d8 7f fe 0a c1 40 34 9a 0b e3 40 00 84 40 01 ÿÁ.',.~Ž..däö.ÿ.( .!™ã€.™¬p..9““Ø.þ.Á#4š.ã#..#.
0x0000000002E66A1C 00 01 02 88 fd cd 7d cc 0e 08 a4 dc c3 82 29 37 3f e0 88 14 8b f1 c3 1c 03 27 f0 c3 60 a0 50 62 86 da 36 1f 10 00 0a 80 00 80 14 40 00 20 00 ...ˆýÍ}Ì..¤ÜÃ.)7?àˆ..ñÃ..'ðÃ` Pb.Ú6....€.€.#. .
and this is the encoders output (until after encoding frame 0):
[libx264 # 00000000005ADAA0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShu
ffle SSE4.2
[libx264 # 00000000005ADAA0] profile High, level 3.0
[libx264 # 00000000005ADAA0] 264 - core 120 r2146 bcd41db - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=0 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 b
luray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=25 keyint_min=2 sc
enecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=100 ratetol=1.0 qcomp=0.60 qpm
in=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out2.mp4':
Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 100 kb/s, 90k tbn, 25 t
bc
[mp4 # 0000000000467570] Encoder did not produce proper pts, making some up.
This my packet data:
00 00 00 01 67 64 00 1F AC 56 24 02 80 DA 10 00
00 03 00 10 00 00 03 03 C0 F1 83 18 98 00 00 00
01 68 E8 8E 0B CB 22 C0 00 00 00 01 65 88 82 00
The first a few bytes for a first h264 packet should somewhat look like this.
00 00 00 01 ?7 ... 00 00 00 01 ?8 ... 00 00 00 01 ?5
?7 -> sps
?8 -> pps
?5 -> idr picture
There might be something else like ?6, which is sei, etc. But with SPS, PPS and the idr picture, the decoder should be able to initialize itself properly.
Another case might be the packet contains more than one picture (00 00 00 01 ?5, or 00 00 00 01 ?1). As far as I know, the decoder cannot handle h264 packets with more than one pictures properly.

Content of stack before main function [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I've got a program that:
first prints arguments from the command line, with pointers to these arguments, addresses of these pointers and addresses of arguments
then does something similar for the environment variables (however there is a small bug)
after that, all the stack's content is printed starting from buffer "tekst" and going towards the beginning of stack.
At this point, as expected, the program crashes.
The content of the stack is printed as lines:
line number
address in memory
16 consecutive bytes in hexadecimal form
16 consecutive bytes in character form.
Here's a sample output:
ubuntu#ubuntu:~/Desktop$ ./main first_arg second_arg third_arg
argv[0]./main bfd445d1 0xbfd441f4
argv[1]first_arg bfd445d8 0xbfd441f8
argv[2]second_arg bfd445e2 0xbfd441fc
argv[3]third_arg bfd445ed 0xbfd44200
env[0]ORBIT_SOCKETDIR=/tmp/orbit-ubuntu bfd445f7 0xbfd44208
env[1]SSH_AGENT_PID=4294 bfd445f7 0xbfd4420c
env[2]TERM=xterm bfd445f7 0xbfd44210
env[3]SHELL=/bin/bash bfd445f7 0xbfd44214
env[4]XDG_SESSION_COOKIE=b16da184017a223e33dfbc7700000025-1316532826.4763-1998941864 bfd445f7 0xbfd44218
env[5]WINDOWID=60817444 bfd445f7 0xbfd4421c
env[6]GNOME_KEYRING_CONTROL=/tmp/keyring-PF9cWq bfd445f7 0xbfd44220
env[7]GTK_MODULES=canberra-gtk-module bfd445f7 0xbfd44224
env[8]USER=ubuntu bfd445f7 0xbfd44228
env[9]LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: bfd445f7 0xbfd4422c
env[a]SSH_AUTH_SOCK=/tmp/keyring-PF9cWq/ssh bfd445f7 0xbfd44230
env[b]SESSION_MANAGER=local/ubuntu:#/tmp/.ICE-unix/4253,unix/ubuntu:/tmp/.ICE-unix/4253 bfd445f7 0xbfd44234
env[c]USERNAME=ubuntu bfd445f7 0xbfd44238
env[d]DEFAULTS_PATH=/usr/share/gconf/gnome.default.path bfd445f7 0xbfd4423c
env[e]XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg bfd445f7 0xbfd44240
env[f]PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games bfd445f7 0xbfd44244
env[10]DESKTOP_SESSION=gnome bfd445f7 0xbfd44248
env[11]PWD=/home/ubuntu/Desktop bfd445f7 0xbfd4424c
env[12]GDM_KEYBOARD_LAYOUT=us bfd445f7 0xbfd44250
env[13]LANG=en_US.UTF-8 bfd445f7 0xbfd44254
env[14]GDM_LANG=en_US.UTF-8 bfd445f7 0xbfd44258
env[15]MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path bfd445f7 0xbfd4425c
env[16]UBUNTU_MENUPROXY=libappmenu.so bfd445f7 0xbfd44260
env[17]COMPIZ_CONFIG_PROFILE=ubuntu bfd445f7 0xbfd44264
env[18]GDMSESSION=gnome bfd445f7 0xbfd44268
env[19]SHLVL=1 bfd445f7 0xbfd4426c
env[1a]HOME=/home/ubuntu bfd445f7 0xbfd44270
env[1b]LANGUAGE=en_US:en bfd445f7 0xbfd44274
env[1c]GNOME_DESKTOP_SESSION_ID=this-is-deprecated bfd445f7 0xbfd44278
env[1d]LOGNAME=ubuntu bfd445f7 0xbfd4427c
env[1e]XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/ bfd445f7 0xbfd44280
env[1f]DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-DTbn1HNZFU,guid=3b2a0c2f55352a2d70678ffc000000a3 bfd445f7 0xbfd44284
env[20]LESSOPEN=| /usr/bin/lesspipe %s bfd445f7 0xbfd44288
env[21]WINDOWPATH=7 bfd445f7 0xbfd4428c
env[22]DISPLAY=:0.0 bfd445f7 0xbfd44290
env[23]LESSCLOSE=/usr/bin/lesspipe %s %s bfd445f7 0xbfd44294
env[24]RUNNING_UNDER_GDM=yes bfd445f7 0xbfd44298
env[25]COLORTERM=gnome-terminal bfd445f7 0xbfd4429c
env[26]XAUTHORITY=/var/run/gdm/auth-for-ubuntu-Za0Xwx/database bfd445f7 0xbfd442a0
env[27]_=./main bfd445f7 0xbfd442a4
env[28]OLDPWD=/home/ubuntu bfd445f7 0xbfd442a8
001 0xbfd4411e 48 45 52 45 5f 49 53 5f 53 54 41 52 54 00 00 f0 HERE_IS_START???
002 0xbfd4412e fc e2 35 ad 28 00 f4 7f 3b 00 00 00 00 00 00 00 ??5?(???;???????
003 0xbfd4413e 00 00 60 8d 04 08 00 00 00 00 c8 41 d4 bf 37 1e ??`????????A??7?
004 0xbfd4414e 27 00 04 00 00 00 f4 41 d4 bf 08 42 d4 bf 14 44 '??????A???B???D
005 0xbfd4415e 85 00 ff ff ff ff f4 9f b7 00 f4 84 04 08 01 00 ????????????????
006 0xbfd4416e 00 00 b0 41 d4 bf 31 aa b6 00 d0 aa b7 00 30 86 ???A??1???????0?
007 0xbfd4417e 8c b7 01 00 00 00 f4 7f 3b 00 00 00 00 00 00 00 ????????;???????
008 0xbfd4418e 00 00 c8 41 d4 bf c1 93 97 8b be ca 2e 6d 00 00 ???A????????.m??
009 0xbfd4419e 00 00 00 00 00 00 00 00 00 00 04 00 00 00 60 87 ??????????????`?
010 0xbfd441ae 04 08 00 00 00 00 40 0c b7 00 5b 1d 27 00 f4 9f ??????#???[?'???
011 0xbfd441be b7 00 04 00 00 00 60 87 04 08 00 00 00 00 81 87 ??????`?????????
012 0xbfd441ce 04 08 14 88 04 08 04 00 00 00 f4 41 d4 bf 60 8d ???????????A??`?
013 0xbfd441de 04 08 c0 8d 04 08 50 ba b6 00 ec 41 d4 bf 18 a9 ??????P????A????
014 0xbfd441ee b7 00 04 00 00 00 d1 45 d4 bf d8 45 d4 bf e2 45 ???????E???E???E
015 0xbfd441fe d4 bf ed 45 d4 bf 00 00 00 00 f7 45 d4 bf 19 46 ???E???????E???F
016 0xbfd4420e d4 bf 2c 46 d4 bf 37 46 d4 bf 47 46 d4 bf 96 46 ??,F??7F??GF???F
017 0xbfd4421e d4 bf a8 46 d4 bf d2 46 d4 bf f2 46 d4 bf fe 46 ???F???F???F???F
018 0xbfd4422e d4 bf ee 4b d4 bf 14 4c d4 bf 66 4c d4 bf 76 4c ???K???L??fL??vL
019 0xbfd4423e d4 bf a8 4c d4 bf d4 4c d4 bf 21 4d d4 bf 37 4d ???L???L??!M??7M
020 0xbfd4424e d4 bf 50 4d d4 bf 67 4d d4 bf 78 4d d4 bf 8d 4d ??PM??gM??xM???M
021 0xbfd4425e d4 bf c2 4d d4 bf e1 4d d4 bf fe 4d d4 bf 0f 4e ???M???M???M???N
022 0xbfd4426e d4 bf 17 4e d4 bf 29 4e d4 bf 3b 4e d4 bf 67 4e ???N??)N??;N??gN
023 0xbfd4427e d4 bf 76 4e d4 bf b3 4e d4 bf 15 4f d4 bf 35 4f ??vN???N???O??5O
024 0xbfd4428e d4 bf 42 4f d4 bf 4f 4f d4 bf 71 4f d4 bf 87 4f ??BO??OO??qO???O
025 0xbfd4429e d4 bf a0 4f d4 bf d8 4f d4 bf e1 4f d4 bf 00 00 ???O???O???O????
026 0xbfd442ae 00 00 20 00 00 00 14 44 85 00 21 00 00 00 00 40 ?? ????D??!????#
027 0xbfd442be 85 00 10 00 00 00 bf f3 8b 07 06 00 00 00 00 10 ????????????????
028 0xbfd442ce 00 00 11 00 00 00 64 00 00 00 03 00 00 00 34 80 ??????d???????4?
029 0xbfd442de 04 08 04 00 00 00 20 00 00 00 05 00 00 00 09 00 ?????? ?????????
030 0xbfd442ee 00 00 07 00 00 00 00 d0 b5 00 08 00 00 00 00 00 ????????????????
031 0xbfd442fe 00 00 09 00 00 00 60 87 04 08 0b 00 00 00 e7 03 ??????`?????????
032 0xbfd4430e 00 00 0c 00 00 00 e7 03 00 00 0d 00 00 00 e7 03 ????????????????
033 0xbfd4431e 00 00 0e 00 00 00 e7 03 00 00 17 00 00 00 00 00 ????????????????
034 0xbfd4432e 00 00 19 00 00 00 5b 43 d4 bf 1f 00 00 00 f5 4f ??????[C???????O
035 0xbfd4433e d4 bf 0f 00 00 00 6b 43 d4 bf 00 00 00 00 00 00 ??????kC????????
036 0xbfd4434e 00 00 00 00 00 00 00 00 00 00 00 00 00 f0 fc e2 ????????????????
037 0xbfd4435e 43 99 8a 11 5f 85 d2 1d 7b 09 fc 02 c6 69 36 38 C???_???{????i68
038 0xbfd4436e 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6???????????????
039 0xbfd4437e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
040 0xbfd4438e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
041 0xbfd4439e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
042 0xbfd443ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
043 0xbfd443be 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
044 0xbfd443ce 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
045 0xbfd443de 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
046 0xbfd443ee 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
047 0xbfd443fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
048 0xbfd4440e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
049 0xbfd4441e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
050 0xbfd4442e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
051 0xbfd4443e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
052 0xbfd4444e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
053 0xbfd4445e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
054 0xbfd4446e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
055 0xbfd4447e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
056 0xbfd4448e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
057 0xbfd4449e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
058 0xbfd444ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
059 0xbfd444be 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
060 0xbfd444ce 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
061 0xbfd444de 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
062 0xbfd444ee 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
063 0xbfd444fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
064 0xbfd4450e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
065 0xbfd4451e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
066 0xbfd4452e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
067 0xbfd4453e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
068 0xbfd4454e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
069 0xbfd4455e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
070 0xbfd4456e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
071 0xbfd4457e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
072 0xbfd4458e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
073 0xbfd4459e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
074 0xbfd445ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
075 0xbfd445be 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ????????????????
076 0xbfd445ce 00 00 00 2e 2f 6d 61 69 6e 00 66 69 72 73 74 5f ???./main?first_
077 0xbfd445de 61 72 67 00 73 65 63 6f 6e 64 5f 61 72 67 00 74 arg?second_arg?t
078 0xbfd445ee 68 69 72 64 5f 61 72 67 00 4f 52 42 49 54 5f 53 hird_arg?ORBIT_S
079 0xbfd445fe 4f 43 4b 45 54 44 49 52 3d 2f 74 6d 70 2f 6f 72 OCKETDIR=/tmp/or
080 0xbfd4460e 62 69 74 2d 75 62 75 6e 74 75 00 53 53 48 5f 41 bit-ubuntu?SSH_A
081 0xbfd4461e 47 45 4e 54 5f 50 49 44 3d 34 32 39 34 00 54 45 GENT_PID=4294?TE
082 0xbfd4462e 52 4d 3d 78 74 65 72 6d 00 53 48 45 4c 4c 3d 2f RM=xterm?SHELL=/
083 0xbfd4463e 62 69 6e 2f 62 61 73 68 00 58 44 47 5f 53 45 53 bin/bash?XDG_SES
084 0xbfd4464e 53 49 4f 4e 5f 43 4f 4f 4b 49 45 3d 62 31 36 64 SION_COOKIE=b16d
085 0xbfd4465e 61 31 38 34 30 31 37 61 32 32 33 65 33 33 64 66 a184017a223e33df
086 0xbfd4466e 62 63 37 37 30 30 30 30 30 30 32 35 2d 31 33 31 bc7700000025-131
087 0xbfd4467e 36 35 33 32 38 32 36 2e 34 37 36 33 2d 31 39 39 6532826.4763-199
088 0xbfd4468e 38 39 34 31 38 36 34 00 57 49 4e 44 4f 57 49 44 8941864?WINDOWID
089 0xbfd4469e 3d 36 30 38 31 37 34 34 34 00 47 4e 4f 4d 45 5f =60817444?GNOME_
090 0xbfd446ae 4b 45 59 52 49 4e 47 5f 43 4f 4e 54 52 4f 4c 3d KEYRING_CONTROL=
091 0xbfd446be 2f 74 6d 70 2f 6b 65 79 72 69 6e 67 2d 50 46 39 /tmp/keyring-PF9
092 0xbfd446ce 63 57 71 00 47 54 4b 5f 4d 4f 44 55 4c 45 53 3d cWq?GTK_MODULES=
093 0xbfd446de 63 61 6e 62 65 72 72 61 2d 67 74 6b 2d 6d 6f 64 canberra-gtk-mod
094 0xbfd446ee 75 6c 65 00 55 53 45 52 3d 75 62 75 6e 74 75 00 ule?USER=ubuntu?
095 0xbfd446fe 4c 53 5f 43 4f 4c 4f 52 53 3d 72 73 3d 30 3a 64 LS_COLORS=rs=0:d
096 0xbfd4470e 69 3d 30 31 3b 33 34 3a 6c 6e 3d 30 31 3b 33 36 i=01;34:ln=01;36
097 0xbfd4471e 3a 6d 68 3d 30 30 3a 70 69 3d 34 30 3b 33 33 3a :mh=00:pi=40;33:
098 0xbfd4472e 73 6f 3d 30 31 3b 33 35 3a 64 6f 3d 30 31 3b 33 so=01;35:do=01;3
099 0xbfd4473e 35 3a 62 64 3d 34 30 3b 33 33 3b 30 31 3a 63 64 5:bd=40;33;01:cd
100 0xbfd4474e 3d 34 30 3b 33 33 3b 30 31 3a 6f 72 3d 34 30 3b =40;33;01:or=40;
101 0xbfd4475e 33 31 3b 30 31 3a 73 75 3d 33 37 3b 34 31 3a 73 31;01:su=37;41:s
102 0xbfd4476e 67 3d 33 30 3b 34 33 3a 63 61 3d 33 30 3b 34 31 g=30;43:ca=30;41
103 0xbfd4477e 3a 74 77 3d 33 30 3b 34 32 3a 6f 77 3d 33 34 3b :tw=30;42:ow=34;
104 0xbfd4478e 34 32 3a 73 74 3d 33 37 3b 34 34 3a 65 78 3d 30 42:st=37;44:ex=0
105 0xbfd4479e 31 3b 33 32 3a 2a 2e 74 61 72 3d 30 31 3b 33 31 1;32:*.tar=01;31
106 0xbfd447ae 3a 2a 2e 74 67 7a 3d 30 31 3b 33 31 3a 2a 2e 61 :*.tgz=01;31:*.a
107 0xbfd447be 72 6a 3d 30 31 3b 33 31 3a 2a 2e 74 61 7a 3d 30 rj=01;31:*.taz=0
108 0xbfd447ce 31 3b 33 31 3a 2a 2e 6c 7a 68 3d 30 31 3b 33 31 1;31:*.lzh=01;31
109 0xbfd447de 3a 2a 2e 6c 7a 6d 61 3d 30 31 3b 33 31 3a 2a 2e :*.lzma=01;31:*.
110 0xbfd447ee 74 6c 7a 3d 30 31 3b 33 31 3a 2a 2e 74 78 7a 3d tlz=01;31:*.txz=
111 0xbfd447fe 30 31 3b 33 31 3a 2a 2e 7a 69 70 3d 30 31 3b 33 01;31:*.zip=01;3
112 0xbfd4480e 31 3a 2a 2e 7a 3d 30 31 3b 33 31 3a 2a 2e 5a 3d 1:*.z=01;31:*.Z=
113 0xbfd4481e 30 31 3b 33 31 3a 2a 2e 64 7a 3d 30 31 3b 33 31 01;31:*.dz=01;31
114 0xbfd4482e 3a 2a 2e 67 7a 3d 30 31 3b 33 31 3a 2a 2e 6c 7a :*.gz=01;31:*.lz
115 0xbfd4483e 3d 30 31 3b 33 31 3a 2a 2e 78 7a 3d 30 31 3b 33 =01;31:*.xz=01;3
116 0xbfd4484e 31 3a 2a 2e 62 7a 32 3d 30 31 3b 33 31 3a 2a 2e 1:*.bz2=01;31:*.
117 0xbfd4485e 62 7a 3d 30 31 3b 33 31 3a 2a 2e 74 62 7a 3d 30 bz=01;31:*.tbz=0
118 0xbfd4486e 31 3b 33 31 3a 2a 2e 74 62 7a 32 3d 30 31 3b 33 1;31:*.tbz2=01;3
119 0xbfd4487e 31 3a 2a 2e 74 7a 3d 30 31 3b 33 31 3a 2a 2e 64 1:*.tz=01;31:*.d
120 0xbfd4488e 65 62 3d 30 31 3b 33 31 3a 2a 2e 72 70 6d 3d 30 eb=01;31:*.rpm=0
121 0xbfd4489e 31 3b 33 31 3a 2a 2e 6a 61 72 3d 30 31 3b 33 31 1;31:*.jar=01;31
122 0xbfd448ae 3a 2a 2e 72 61 72 3d 30 31 3b 33 31 3a 2a 2e 61 :*.rar=01;31:*.a
123 0xbfd448be 63 65 3d 30 31 3b 33 31 3a 2a 2e 7a 6f 6f 3d 30 ce=01;31:*.zoo=0
124 0xbfd448ce 31 3b 33 31 3a 2a 2e 63 70 69 6f 3d 30 31 3b 33 1;31:*.cpio=01;3
125 0xbfd448de 31 3a 2a 2e 37 7a 3d 30 31 3b 33 31 3a 2a 2e 72 1:*.7z=01;31:*.r
126 0xbfd448ee 7a 3d 30 31 3b 33 31 3a 2a 2e 6a 70 67 3d 30 31 z=01;31:*.jpg=01
127 0xbfd448fe 3b 33 35 3a 2a 2e 6a 70 65 67 3d 30 31 3b 33 35 ;35:*.jpeg=01;35
128 0xbfd4490e 3a 2a 2e 67 69 66 3d 30 31 3b 33 35 3a 2a 2e 62 :*.gif=01;35:*.b
129 0xbfd4491e 6d 70 3d 30 31 3b 33 35 3a 2a 2e 70 62 6d 3d 30 mp=01;35:*.pbm=0
130 0xbfd4492e 31 3b 33 35 3a 2a 2e 70 67 6d 3d 30 31 3b 33 35 1;35:*.pgm=01;35
131 0xbfd4493e 3a 2a 2e 70 70 6d 3d 30 31 3b 33 35 3a 2a 2e 74 :*.ppm=01;35:*.t
132 0xbfd4494e 67 61 3d 30 31 3b 33 35 3a 2a 2e 78 62 6d 3d 30 ga=01;35:*.xbm=0
133 0xbfd4495e 31 3b 33 35 3a 2a 2e 78 70 6d 3d 30 31 3b 33 35 1;35:*.xpm=01;35
134 0xbfd4496e 3a 2a 2e 74 69 66 3d 30 31 3b 33 35 3a 2a 2e 74 :*.tif=01;35:*.t
135 0xbfd4497e 69 66 66 3d 30 31 3b 33 35 3a 2a 2e 70 6e 67 3d iff=01;35:*.png=
136 0xbfd4498e 30 31 3b 33 35 3a 2a 2e 73 76 67 3d 30 31 3b 33 01;35:*.svg=01;3
137 0xbfd4499e 35 3a 2a 2e 73 76 67 7a 3d 30 31 3b 33 35 3a 2a 5:*.svgz=01;35:*
138 0xbfd449ae 2e 6d 6e 67 3d 30 31 3b 33 35 3a 2a 2e 70 63 78 .mng=01;35:*.pcx
139 0xbfd449be 3d 30 31 3b 33 35 3a 2a 2e 6d 6f 76 3d 30 31 3b =01;35:*.mov=01;
140 0xbfd449ce 33 35 3a 2a 2e 6d 70 67 3d 30 31 3b 33 35 3a 2a 35:*.mpg=01;35:*
141 0xbfd449de 2e 6d 70 65 67 3d 30 31 3b 33 35 3a 2a 2e 6d 32 .mpeg=01;35:*.m2
142 0xbfd449ee 76 3d 30 31 3b 33 35 3a 2a 2e 6d 6b 76 3d 30 31 v=01;35:*.mkv=01
143 0xbfd449fe 3b 33 35 3a 2a 2e 6f 67 6d 3d 30 31 3b 33 35 3a ;35:*.ogm=01;35:
144 0xbfd44a0e 2a 2e 6d 70 34 3d 30 31 3b 33 35 3a 2a 2e 6d 34 *.mp4=01;35:*.m4
145 0xbfd44a1e 76 3d 30 31 3b 33 35 3a 2a 2e 6d 70 34 76 3d 30 v=01;35:*.mp4v=0
146 0xbfd44a2e 31 3b 33 35 3a 2a 2e 76 6f 62 3d 30 31 3b 33 35 1;35:*.vob=01;35
147 0xbfd44a3e 3a 2a 2e 71 74 3d 30 31 3b 33 35 3a 2a 2e 6e 75 :*.qt=01;35:*.nu
148 0xbfd44a4e 76 3d 30 31 3b 33 35 3a 2a 2e 77 6d 76 3d 30 31 v=01;35:*.wmv=01
149 0xbfd44a5e 3b 33 35 3a 2a 2e 61 73 66 3d 30 31 3b 33 35 3a ;35:*.asf=01;35:
150 0xbfd44a6e 2a 2e 72 6d 3d 30 31 3b 33 35 3a 2a 2e 72 6d 76 *.rm=01;35:*.rmv
151 0xbfd44a7e 62 3d 30 31 3b 33 35 3a 2a 2e 66 6c 63 3d 30 31 b=01;35:*.flc=01
152 0xbfd44a8e 3b 33 35 3a 2a 2e 61 76 69 3d 30 31 3b 33 35 3a ;35:*.avi=01;35:
153 0xbfd44a9e 2a 2e 66 6c 69 3d 30 31 3b 33 35 3a 2a 2e 66 6c *.fli=01;35:*.fl
154 0xbfd44aae 76 3d 30 31 3b 33 35 3a 2a 2e 67 6c 3d 30 31 3b v=01;35:*.gl=01;
155 0xbfd44abe 33 35 3a 2a 2e 64 6c 3d 30 31 3b 33 35 3a 2a 2e 35:*.dl=01;35:*.
156 0xbfd44ace 78 63 66 3d 30 31 3b 33 35 3a 2a 2e 78 77 64 3d xcf=01;35:*.xwd=
157 0xbfd44ade 30 31 3b 33 35 3a 2a 2e 79 75 76 3d 30 31 3b 33 01;35:*.yuv=01;3
158 0xbfd44aee 35 3a 2a 2e 63 67 6d 3d 30 31 3b 33 35 3a 2a 2e 5:*.cgm=01;35:*.
159 0xbfd44afe 65 6d 66 3d 30 31 3b 33 35 3a 2a 2e 61 78 76 3d emf=01;35:*.axv=
160 0xbfd44b0e 30 31 3b 33 35 3a 2a 2e 61 6e 78 3d 30 31 3b 33 01;35:*.anx=01;3
161 0xbfd44b1e 35 3a 2a 2e 6f 67 76 3d 30 31 3b 33 35 3a 2a 2e 5:*.ogv=01;35:*.
162 0xbfd44b2e 6f 67 78 3d 30 31 3b 33 35 3a 2a 2e 61 61 63 3d ogx=01;35:*.aac=
163 0xbfd44b3e 30 30 3b 33 36 3a 2a 2e 61 75 3d 30 30 3b 33 36 00;36:*.au=00;36
164 0xbfd44b4e 3a 2a 2e 66 6c 61 63 3d 30 30 3b 33 36 3a 2a 2e :*.flac=00;36:*.
165 0xbfd44b5e 6d 69 64 3d 30 30 3b 33 36 3a 2a 2e 6d 69 64 69 mid=00;36:*.midi
166 0xbfd44b6e 3d 30 30 3b 33 36 3a 2a 2e 6d 6b 61 3d 30 30 3b =00;36:*.mka=00;
167 0xbfd44b7e 33 36 3a 2a 2e 6d 70 33 3d 30 30 3b 33 36 3a 2a 36:*.mp3=00;36:*
168 0xbfd44b8e 2e 6d 70 63 3d 30 30 3b 33 36 3a 2a 2e 6f 67 67 .mpc=00;36:*.ogg
169 0xbfd44b9e 3d 30 30 3b 33 36 3a 2a 2e 72 61 3d 30 30 3b 33 =00;36:*.ra=00;3
170 0xbfd44bae 36 3a 2a 2e 77 61 76 3d 30 30 3b 33 36 3a 2a 2e 6:*.wav=00;36:*.
171 0xbfd44bbe 61 78 61 3d 30 30 3b 33 36 3a 2a 2e 6f 67 61 3d axa=00;36:*.oga=
172 0xbfd44bce 30 30 3b 33 36 3a 2a 2e 73 70 78 3d 30 30 3b 33 00;36:*.spx=00;3
173 0xbfd44bde 36 3a 2a 2e 78 73 70 66 3d 30 30 3b 33 36 3a 00 6:*.xspf=00;36:?
174 0xbfd44bee 53 53 48 5f 41 55 54 48 5f 53 4f 43 4b 3d 2f 74 SSH_AUTH_SOCK=/t
175 0xbfd44bfe 6d 70 2f 6b 65 79 72 69 6e 67 2d 50 46 39 63 57 mp/keyring-PF9cW
176 0xbfd44c0e 71 2f 73 73 68 00 53 45 53 53 49 4f 4e 5f 4d 41 q/ssh?SESSION_MA
177 0xbfd44c1e 4e 41 47 45 52 3d 6c 6f 63 61 6c 2f 75 62 75 6e NAGER=local/ubun
178 0xbfd44c2e 74 75 3a 40 2f 74 6d 70 2f 2e 49 43 45 2d 75 6e tu:#/tmp/.ICE-un
179 0xbfd44c3e 69 78 2f 34 32 35 33 2c 75 6e 69 78 2f 75 62 75 ix/4253,unix/ubu
180 0xbfd44c4e 6e 74 75 3a 2f 74 6d 70 2f 2e 49 43 45 2d 75 6e ntu:/tmp/.ICE-un
181 0xbfd44c5e 69 78 2f 34 32 35 33 00 55 53 45 52 4e 41 4d 45 ix/4253?USERNAME
182 0xbfd44c6e 3d 75 62 75 6e 74 75 00 44 45 46 41 55 4c 54 53 =ubuntu?DEFAULTS
183 0xbfd44c7e 5f 50 41 54 48 3d 2f 75 73 72 2f 73 68 61 72 65 _PATH=/usr/share
184 0xbfd44c8e 2f 67 63 6f 6e 66 2f 67 6e 6f 6d 65 2e 64 65 66 /gconf/gnome.def
185 0xbfd44c9e 61 75 6c 74 2e 70 61 74 68 00 58 44 47 5f 43 4f ault.path?XDG_CO
186 0xbfd44cae 4e 46 49 47 5f 44 49 52 53 3d 2f 65 74 63 2f 78 NFIG_DIRS=/etc/x
187 0xbfd44cbe 64 67 2f 78 64 67 2d 67 6e 6f 6d 65 3a 2f 65 74 dg/xdg-gnome:/et
188 0xbfd44cce 63 2f 78 64 67 00 50 41 54 48 3d 2f 75 73 72 2f c/xdg?PATH=/usr/
189 0xbfd44cde 6c 6f 63 61 6c 2f 73 62 69 6e 3a 2f 75 73 72 2f local/sbin:/usr/
190 0xbfd44cee 6c 6f 63 61 6c 2f 62 69 6e 3a 2f 75 73 72 2f 73 local/bin:/usr/s
191 0xbfd44cfe 62 69 6e 3a 2f 75 73 72 2f 62 69 6e 3a 2f 73 62 bin:/usr/bin:/sb
192 0xbfd44d0e 69 6e 3a 2f 62 69 6e 3a 2f 75 73 72 2f 67 61 6d in:/bin:/usr/gam
193 0xbfd44d1e 65 73 00 44 45 53 4b 54 4f 50 5f 53 45 53 53 49 es?DESKTOP_SESSI
194 0xbfd44d2e 4f 4e 3d 67 6e 6f 6d 65 00 50 57 44 3d 2f 68 6f ON=gnome?PWD=/ho
195 0xbfd44d3e 6d 65 2f 75 62 75 6e 74 75 2f 44 65 73 6b 74 6f me/ubuntu/Deskto
196 0xbfd44d4e 70 00 47 44 4d 5f 4b 45 59 42 4f 41 52 44 5f 4c p?GDM_KEYBOARD_L
197 0xbfd44d5e 41 59 4f 55 54 3d 75 73 00 4c 41 4e 47 3d 65 6e AYOUT=us?LANG=en
198 0xbfd44d6e 5f 55 53 2e 55 54 46 2d 38 00 47 44 4d 5f 4c 41 _US.UTF-8?GDM_LA
199 0xbfd44d7e 4e 47 3d 65 6e 5f 55 53 2e 55 54 46 2d 38 00 4d NG=en_US.UTF-8?M
200 0xbfd44d8e 41 4e 44 41 54 4f 52 59 5f 50 41 54 48 3d 2f 75 ANDATORY_PATH=/u
201 0xbfd44d9e 73 72 2f 73 68 61 72 65 2f 67 63 6f 6e 66 2f 67 sr/share/gconf/g
202 0xbfd44dae 6e 6f 6d 65 2e 6d 61 6e 64 61 74 6f 72 79 2e 70 nome.mandatory.p
203 0xbfd44dbe 61 74 68 00 55 42 55 4e 54 55 5f 4d 45 4e 55 50 ath?UBUNTU_MENUP
204 0xbfd44dce 52 4f 58 59 3d 6c 69 62 61 70 70 6d 65 6e 75 2e ROXY=libappmenu.
205 0xbfd44dde 73 6f 00 43 4f 4d 50 49 5a 5f 43 4f 4e 46 49 47 so?COMPIZ_CONFIG
206 0xbfd44dee 5f 50 52 4f 46 49 4c 45 3d 75 62 75 6e 74 75 00 _PROFILE=ubuntu?
207 0xbfd44dfe 47 44 4d 53 45 53 53 49 4f 4e 3d 67 6e 6f 6d 65 GDMSESSION=gnome
208 0xbfd44e0e 00 53 48 4c 56 4c 3d 31 00 48 4f 4d 45 3d 2f 68 ?SHLVL=1?HOME=/h
209 0xbfd44e1e 6f 6d 65 2f 75 62 75 6e 74 75 00 4c 41 4e 47 55 ome/ubuntu?LANGU
210 0xbfd44e2e 41 47 45 3d 65 6e 5f 55 53 3a 65 6e 00 47 4e 4f AGE=en_US:en?GNO
211 0xbfd44e3e 4d 45 5f 44 45 53 4b 54 4f 50 5f 53 45 53 53 49 ME_DESKTOP_SESSI
212 0xbfd44e4e 4f 4e 5f 49 44 3d 74 68 69 73 2d 69 73 2d 64 65 ON_ID=this-is-de
213 0xbfd44e5e 70 72 65 63 61 74 65 64 00 4c 4f 47 4e 41 4d 45 precated?LOGNAME
214 0xbfd44e6e 3d 75 62 75 6e 74 75 00 58 44 47 5f 44 41 54 41 =ubuntu?XDG_DATA
215 0xbfd44e7e 5f 44 49 52 53 3d 2f 75 73 72 2f 73 68 61 72 65 _DIRS=/usr/share
216 0xbfd44e8e 2f 67 6e 6f 6d 65 3a 2f 75 73 72 2f 6c 6f 63 61 /gnome:/usr/loca
217 0xbfd44e9e 6c 2f 73 68 61 72 65 2f 3a 2f 75 73 72 2f 73 68 l/share/:/usr/sh
218 0xbfd44eae 61 72 65 2f 00 44 42 55 53 5f 53 45 53 53 49 4f are/?DBUS_SESSIO
219 0xbfd44ebe 4e 5f 42 55 53 5f 41 44 44 52 45 53 53 3d 75 6e N_BUS_ADDRESS=un
220 0xbfd44ece 69 78 3a 61 62 73 74 72 61 63 74 3d 2f 74 6d 70 ix:abstract=/tmp
221 0xbfd44ede 2f 64 62 75 73 2d 44 54 62 6e 31 48 4e 5a 46 55 /dbus-DTbn1HNZFU
222 0xbfd44eee 2c 67 75 69 64 3d 33 62 32 61 30 63 32 66 35 35 ,guid=3b2a0c2f55
223 0xbfd44efe 33 35 32 61 32 64 37 30 36 37 38 66 66 63 30 30 352a2d70678ffc00
224 0xbfd44f0e 30 30 30 30 61 33 00 4c 45 53 53 4f 50 45 4e 3d 0000a3?LESSOPEN=
225 0xbfd44f1e 7c 20 2f 75 73 72 2f 62 69 6e 2f 6c 65 73 73 70 | /usr/bin/lessp
226 0xbfd44f2e 69 70 65 20 25 73 00 57 49 4e 44 4f 57 50 41 54 ipe %s?WINDOWPAT
227 0xbfd44f3e 48 3d 37 00 44 49 53 50 4c 41 59 3d 3a 30 2e 30 H=7?DISPLAY=:0.0
228 0xbfd44f4e 00 4c 45 53 53 43 4c 4f 53 45 3d 2f 75 73 72 2f ?LESSCLOSE=/usr/
229 0xbfd44f5e 62 69 6e 2f 6c 65 73 73 70 69 70 65 20 25 73 20 bin/lesspipe %s
230 0xbfd44f6e 25 73 00 52 55 4e 4e 49 4e 47 5f 55 4e 44 45 52 %s?RUNNING_UNDER
231 0xbfd44f7e 5f 47 44 4d 3d 79 65 73 00 43 4f 4c 4f 52 54 45 _GDM=yes?COLORTE
232 0xbfd44f8e 52 4d 3d 67 6e 6f 6d 65 2d 74 65 72 6d 69 6e 61 RM=gnome-termina
233 0xbfd44f9e 6c 00 58 41 55 54 48 4f 52 49 54 59 3d 2f 76 61 l?XAUTHORITY=/va
234 0xbfd44fae 72 2f 72 75 6e 2f 67 64 6d 2f 61 75 74 68 2d 66 r/run/gdm/auth-f
235 0xbfd44fbe 6f 72 2d 75 62 75 6e 74 75 2d 5a 61 30 58 77 78 or-ubuntu-Za0Xwx
236 0xbfd44fce 2f 64 61 74 61 62 61 73 65 00 5f 3d 2e 2f 6d 61 /database?_=./ma
237 0xbfd44fde 69 6e 00 4f 4c 44 50 57 44 3d 2f 68 6f 6d 65 2f in?OLDPWD=/home/
238 0xbfd44fee 75 62 75 6e 74 75 00 2e 2f 6d 61 69 6e 00 00 00 ubuntu?./main???
239 0xbfd44ffe 00 00 Segmentation fault (core dumped)
At the moment, I have figured out following things (starting from line 001):
001 buffer tekst
014 argc
014-015 pointers to argv[i]
015 4x null byte
015-025 pointers to env[i]
025-026 4x null byte
038-076 many 0 bytes
076-078 strings of command line arguments
078-238 strings of environments variables
238 name of program
238-239 4x null byte
I have two questions:
What is the other content of stack?
What are used these multiple zeroes between lines 038 and 076 for?
For reference, here's the code I'm using:
#include <iostream>
#include <locale>
#include <unistd.h>
int main(int argc, char* argv[], char* env[]) {
char tekst[] = "HERE_IS_START";
for (int i = 0; i < argc; i++) {
std::cout << "argv[" << i << "]" << argv[i] << " " << std::hex <<
(int) argv[i] << " " << &argv[i] << std::endl;
}
int z = 0;
for (char** env_ = env; *env_ != 0; env_++) {
std::cout << "env[" << z++ << "]" << *env_ << " " << std::hex <<
(int) *env << " " << &(*env_) << std::endl;
}
int row = 16;
char* wsk = tekst;
for (int i = 0;; i++) {
if (i + 1 < 10)std::cout << 0;
if (i + 1 < 100)std::cout << 0;
std::cout << std::dec << (i + 1) << " 0x" << std::hex << (int) wsk << " ";
for (int j = 0; j < row; j++) {
if ((unsigned int) (unsigned char) (wsk[j]) < 16)
std::cout << 0;
std::cout << (unsigned int) (unsigned char) (wsk[j]) <<
" " << std::flush;
}
for (int j = 0; j < row; j++) {
if (isprint((char) (wsk[j])))
std::cout << (char) (wsk[j]);
else
std::cout << '?';
}
std::cout << std::endl;
wsk = wsk + row;
}
return 0;
}
This program was compiled and tested in Ubuntu 11.04.
How do you ever expect to break out of that for loop? You don't give it a repeat condition, and you don't have an explicit break or return anywhere inside the loop. Presumably this segmentation fault is caused by going past the end of the stack into memory you're not allowed to access.
There are two things that will put stuff on the stack before main starts: the operating system itself, and the run-time library and startup code generated by your compiler. You aren't expected to use any of this information directly so it is generally not documented.