blob: 6eebbef9d0f62ade72747a1891c7e75b7bd2b667 [file] [log] [blame]
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +00001/*
Peter Stuge45ae92ff2009-04-14 19:48:32 +00002 * cbfs-mkpayload
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +00003 *
4 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
Patrick Georgib7b56dd82009-09-14 13:29:27 +00005 * 2009 coresystems GmbH
6 * written by Patrick Georgi <patrick.georgi@coresystems.de>
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +00007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
20 */
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000025
Aaron Durbin54ef3062014-03-05 12:12:09 -060026#include "elfparsing.h"
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000027#include "common.h"
Patrick Georgib7b56dd82009-09-14 13:29:27 +000028#include "cbfs.h"
Stefan Reinauer543a6822013-02-04 15:39:13 -080029#include "fv.h"
30#include "coff.h"
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000031
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080032/* serialize the seg array into the buffer.
33 * The buffer is assumed to be large enough.
34 */
Ronald G. Minnich818f3692014-02-04 08:29:35 -080035void xdr_segs(struct buffer *output,
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080036 struct cbfs_payload_segment *segs, int nseg)
37{
38 struct buffer outheader;
39 int i;
40
41 outheader.data = output->data;
42 outheader.size = 0;
43
44 for(i = 0; i < nseg; i++){
45 xdr_be.put32(&outheader, segs[i].type);
46 xdr_be.put32(&outheader, segs[i].compression);
47 xdr_be.put32(&outheader, segs[i].offset);
48 xdr_be.put64(&outheader, segs[i].load_addr);
49 xdr_be.put32(&outheader, segs[i].len);
50 xdr_be.put32(&outheader, segs[i].mem_len);
51 }
52}
Aaron Durbinca630272014-08-05 10:48:20 -050053
54void xdr_get_seg(struct cbfs_payload_segment *out,
55 struct cbfs_payload_segment *in)
56{
57 struct buffer inheader;
58
59 inheader.data = (void *)in;
60 inheader.size = sizeof(*in);
61
62 out->type = xdr_be.get32(&inheader);
63 out->compression = xdr_be.get32(&inheader);
64 out->offset = xdr_be.get32(&inheader);
65 out->load_addr = xdr_be.get64(&inheader);
66 out->len = xdr_be.get32(&inheader);
67 out->mem_len = xdr_be.get32(&inheader);
68}
69
Sol Boucher0e539312015-03-05 15:38:03 -080070int parse_elf_to_payload(const struct buffer *input, struct buffer *output,
71 comp_algo algo)
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000072{
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080073 Elf64_Phdr *phdr;
74 Elf64_Ehdr ehdr;
75 Elf64_Shdr *shdr;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000076 char *header;
77 char *strtab;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000078 int headers;
79 int segments = 1;
80 int isize = 0, osize = 0;
81 int doffset = 0;
Patrick Georgi96990a22014-09-29 10:08:35 +020082 struct cbfs_payload_segment *segs = NULL;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000083 int i;
Patrick Georgi96990a22014-09-29 10:08:35 +020084 int ret = 0;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000085
Patrick Georgib7b56dd82009-09-14 13:29:27 +000086 comp_func_ptr compress = compression_function(algo);
87 if (!compress)
88 return -1;
89
Sol Boucher0e539312015-03-05 15:38:03 -080090 if (elf_headers(input, &ehdr, &phdr, &shdr) < 0)
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080091 return -1;
92
Hung-Te Linc13e4bf2013-01-29 15:22:11 +080093 DEBUG("start: parse_elf_to_payload\n");
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080094 headers = ehdr.e_phnum;
95 header = input->data;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000096
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -080097 strtab = &header[shdr[ehdr.e_shstrndx].sh_offset];
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +000098
99 /* Count the number of headers - look for the .notes.pinfo
100 * section */
101
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800102 for (i = 0; i < ehdr.e_shnum; i++) {
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000103 char *name;
104
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800105 if (i == ehdr.e_shstrndx)
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000106 continue;
107
108 if (shdr[i].sh_size == 0)
109 continue;
110
111 name = (char *)(strtab + shdr[i].sh_name);
112
Ronald G. Minnich5a1af7b2009-09-17 15:35:08 +0000113 if (!strcmp(name, ".note.pinfo")) {
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000114 segments++;
Ronald G. Minnich5a1af7b2009-09-17 15:35:08 +0000115 isize += (unsigned int)shdr[i].sh_size;
116 }
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000117 }
118
119 /* Now, regular headers - we only care about PT_LOAD headers,
120 * because thats what we're actually going to load
121 */
122
123 for (i = 0; i < headers; i++) {
124 if (phdr[i].p_type != PT_LOAD)
125 continue;
126
127 /* Empty segments are never interesting */
128 if (phdr[i].p_memsz == 0)
129 continue;
130
131 isize += phdr[i].p_filesz;
132
133 segments++;
134 }
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800135 /* allocate the segment header array */
136 segs = calloc(segments, sizeof(*segs));
Patrick Georgi96990a22014-09-29 10:08:35 +0200137 if (segs == NULL) {
138 ret = -1;
139 goto out;
140 }
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000141 /* Allocate a block of memory to store the data in */
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800142 if (buffer_create(output, (segments * sizeof(*segs)) + isize,
Patrick Georgi96990a22014-09-29 10:08:35 +0200143 input->name) != 0) {
144 ret = -1;
145 goto out;
146 }
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800147 memset(output->data, 0, output->size);
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000148
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800149 doffset = (segments * sizeof(*segs));
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000150
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800151 /* set up for output marshaling. This is a bit
152 * tricky as we are marshaling the headers at the front,
153 * and the data starting after the headers. We need to convert
154 * the headers to the right format but the data
155 * passes through unchanged. Unlike most XDR code,
156 * we are doing these two concurrently. The doffset is
157 * used to compute the address for the raw data, and the
158 * outheader is used to marshal the headers. To make it simpler
159 * for The Reader, we set up the headers in a separate array,
160 * then marshal them all at once to the output.
161 */
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000162 segments = 0;
163
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800164 for (i = 0; i < ehdr.e_shnum; i++) {
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000165 char *name;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800166 if (i == ehdr.e_shstrndx)
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000167 continue;
168
169 if (shdr[i].sh_size == 0)
170 continue;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000171 name = (char *)(strtab + shdr[i].sh_name);
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000172 if (!strcmp(name, ".note.pinfo")) {
173 segs[segments].type = PAYLOAD_SEGMENT_PARAMS;
174 segs[segments].load_addr = 0;
175 segs[segments].len = (unsigned int)shdr[i].sh_size;
176 segs[segments].offset = doffset;
177
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800178 memcpy((unsigned long *)(output->data + doffset),
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000179 &header[shdr[i].sh_offset], shdr[i].sh_size);
180
181 doffset += segs[segments].len;
182 osize += segs[segments].len;
183
184 segments++;
185 }
186 }
187
188 for (i = 0; i < headers; i++) {
189 if (phdr[i].p_type != PT_LOAD)
190 continue;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000191 if (phdr[i].p_memsz == 0)
192 continue;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000193 if (phdr[i].p_filesz == 0) {
194 segs[segments].type = PAYLOAD_SEGMENT_BSS;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800195 segs[segments].load_addr = phdr[i].p_paddr;
196 segs[segments].mem_len = phdr[i].p_memsz;
197 segs[segments].offset = doffset;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000198
199 segments++;
200 continue;
201 }
202
Stefan Reinauer51f6a202012-01-11 12:40:14 -0800203 if (phdr[i].p_flags & PF_X)
204 segs[segments].type = PAYLOAD_SEGMENT_CODE;
205 else
206 segs[segments].type = PAYLOAD_SEGMENT_DATA;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800207 segs[segments].load_addr = phdr[i].p_paddr;
208 segs[segments].mem_len = phdr[i].p_memsz;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800209 segs[segments].offset = doffset;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000210
Gabe Black845aa142014-02-21 01:01:06 -0800211 /* If the compression failed or made the section is larger,
212 use the original stuff */
213
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000214 int len;
Gabe Blackdbd006b2014-02-20 23:38:49 -0800215 if (compress((char *)&header[phdr[i].p_offset],
Gabe Black845aa142014-02-21 01:01:06 -0800216 phdr[i].p_filesz, output->data + doffset, &len) ||
217 (unsigned int)len > phdr[i].p_filesz) {
218 WARN("Compression failed or would make the data bigger "
219 "- disabled.\n");
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000220 segs[segments].compression = 0;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800221 segs[segments].len = phdr[i].p_filesz;
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800222 memcpy(output->data + doffset,
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000223 &header[phdr[i].p_offset], phdr[i].p_filesz);
Gabe Black845aa142014-02-21 01:01:06 -0800224 } else {
225 segs[segments].compression = algo;
226 segs[segments].len = len;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000227 }
228
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800229 doffset += segs[segments].len;
230 osize += segs[segments].len;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000231
232 segments++;
233 }
234
235 segs[segments].type = PAYLOAD_SEGMENT_ENTRY;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800236 segs[segments++].load_addr = ehdr.e_entry;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000237
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800238 output->size = (segments * sizeof(*segs)) + osize;
239 xdr_segs(output, segs, segments);
Patrick Georgi96990a22014-09-29 10:08:35 +0200240
241out:
242 if (segs) free(segs);
243 if (shdr) free(shdr);
244 if (phdr) free(phdr);
245 return ret;
Ronald G. Minnich5d01ec02009-03-31 11:57:36 +0000246}
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800247
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800248int parse_flat_binary_to_payload(const struct buffer *input,
249 struct buffer *output,
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800250 uint32_t loadaddress,
251 uint32_t entrypoint,
252 comp_algo algo)
253{
254 comp_func_ptr compress;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800255 struct cbfs_payload_segment segs[2];
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800256 int doffset, len = 0;
257
258 compress = compression_function(algo);
259 if (!compress)
260 return -1;
261
262 DEBUG("start: parse_flat_binary_to_payload\n");
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800263 if (buffer_create(output, (sizeof(segs) + input->size),
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800264 input->name) != 0)
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800265 return -1;
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800266 memset(output->data, 0, output->size);
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800267
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800268 doffset = (2 * sizeof(*segs));
269
270 /* Prepare code segment */
271 segs[0].type = PAYLOAD_SEGMENT_CODE;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800272 segs[0].load_addr = loadaddress;
273 segs[0].mem_len = input->size;
274 segs[0].offset = doffset;
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800275
Gabe Black845aa142014-02-21 01:01:06 -0800276 if (!compress(input->data, input->size, output->data + doffset, &len) &&
277 (unsigned int)len < input->size) {
278 segs[0].compression = algo;
279 segs[0].len = len;
280 } else {
281 WARN("Compression failed or would make the data bigger "
282 "- disabled.\n");
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800283 segs[0].compression = 0;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800284 segs[0].len = input->size;
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800285 memcpy(output->data + doffset, input->data, input->size);
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800286 }
287
288 /* prepare entry point segment */
289 segs[1].type = PAYLOAD_SEGMENT_ENTRY;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800290 segs[1].load_addr = entrypoint;
291 output->size = doffset + segs[0].len;
292 xdr_segs(output, segs, 2);
Hung-Te Linc13e4bf2013-01-29 15:22:11 +0800293 return 0;
Hung-Te Lin05dccae2013-01-28 15:04:30 +0800294}
Stefan Reinauer543a6822013-02-04 15:39:13 -0800295
296int parse_fv_to_payload(const struct buffer *input,
297 struct buffer *output, comp_algo algo)
298{
299 comp_func_ptr compress;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800300 struct cbfs_payload_segment segs[2];
Stefan Reinauer543a6822013-02-04 15:39:13 -0800301 int doffset, len = 0;
302 firmware_volume_header_t *fv;
303 ffs_file_header_t *fh;
304 common_section_header_t *cs;
305 dos_header_t *dh;
306 coff_header_t *ch;
Stefan Reinauer543a6822013-02-04 15:39:13 -0800307 int dh_offset;
308
Stefan Reinauere8764182013-02-05 13:46:49 -0800309 uint32_t loadaddress = 0;
310 uint32_t entrypoint = 0;
Stefan Reinauer543a6822013-02-04 15:39:13 -0800311
312 compress = compression_function(algo);
313 if (!compress)
314 return -1;
315
316 DEBUG("start: parse_fv_to_payload\n");
317
318 fv = (firmware_volume_header_t *)input->data;
319 if (fv->signature != FV_SIGNATURE) {
320 INFO("Not a UEFI firmware volume.\n");
321 return -1;
322 }
323
324 fh = (ffs_file_header_t *)(input->data + fv->header_length);
Patrick Georgi46102472013-02-09 13:26:19 +0100325 while (fh->file_type == FILETYPE_PAD) {
326 unsigned long offset = (fh->size[2] << 16) | (fh->size[1] << 8) | fh->size[0];
Hung-Te Lin7b654a92013-02-18 18:35:00 +0800327 ERROR("skipping %lu bytes of FV padding\n", offset);
Sol Boucher0e539312015-03-05 15:38:03 -0800328 fh = (ffs_file_header_t *)(((uintptr_t)fh) + offset);
Patrick Georgi46102472013-02-09 13:26:19 +0100329 }
Stefan Reinauer543a6822013-02-04 15:39:13 -0800330 if (fh->file_type != FILETYPE_SEC) {
331 ERROR("Not a usable UEFI firmware volume.\n");
Stefan Reinauere8764182013-02-05 13:46:49 -0800332 INFO("First file in first FV not a SEC core.\n");
Stefan Reinauer543a6822013-02-04 15:39:13 -0800333 return -1;
334 }
335
336 cs = (common_section_header_t *)&fh[1];
Patrick Georgi46102472013-02-09 13:26:19 +0100337 while (cs->section_type == SECTION_RAW) {
338 unsigned long offset = (cs->size[2] << 16) | (cs->size[1] << 8) | cs->size[0];
Hung-Te Lin7b654a92013-02-18 18:35:00 +0800339 ERROR("skipping %lu bytes of section padding\n", offset);
Sol Boucher0e539312015-03-05 15:38:03 -0800340 cs = (common_section_header_t *)(((uintptr_t)cs) + offset);
Patrick Georgi46102472013-02-09 13:26:19 +0100341 }
Stefan Reinauer543a6822013-02-04 15:39:13 -0800342 if (cs->section_type != SECTION_PE32) {
343 ERROR("Not a usable UEFI firmware volume.\n");
Stefan Reinauere8764182013-02-05 13:46:49 -0800344 INFO("Section type not PE32.\n");
Stefan Reinauer543a6822013-02-04 15:39:13 -0800345 return -1;
346 }
347
348 dh = (dos_header_t *)&cs[1];
Stefan Reinauere8764182013-02-05 13:46:49 -0800349 if (dh->signature != DOS_MAGIC) {
Stefan Reinauer543a6822013-02-04 15:39:13 -0800350 ERROR("Not a usable UEFI firmware volume.\n");
Stefan Reinauere8764182013-02-05 13:46:49 -0800351 INFO("DOS header signature wrong.\n");
Stefan Reinauer543a6822013-02-04 15:39:13 -0800352 return -1;
353 }
354
355 dh_offset = (unsigned long)dh - (unsigned long)input->data;
356 DEBUG("dos header offset = %x\n", dh_offset);
357
Sol Boucher0e539312015-03-05 15:38:03 -0800358 ch = (coff_header_t *)(((uintptr_t)dh)+dh->e_lfanew);
Stefan Reinauere8764182013-02-05 13:46:49 -0800359
360 if (ch->machine == MACHINE_TYPE_X86) {
361 pe_opt_header_32_t *ph;
362 ph = (pe_opt_header_32_t *)&ch[1];
363 if (ph->signature != PE_HDR_32_MAGIC) {
364 WARN("PE header signature incorrect.\n");
365 return -1;
366 }
367 DEBUG("image base %x\n", ph->image_addr);
368 DEBUG("entry point %x\n", ph->entry_point);
369
370 loadaddress = ph->image_addr - dh_offset;
371 entrypoint = ph->image_addr + ph->entry_point;
372 } else if (ch->machine == MACHINE_TYPE_X64) {
373 pe_opt_header_64_t *ph;
374 ph = (pe_opt_header_64_t *)&ch[1];
375 if (ph->signature != PE_HDR_64_MAGIC) {
376 WARN("PE header signature incorrect.\n");
377 return -1;
378 }
379 DEBUG("image base %lx\n", (unsigned long)ph->image_addr);
380 DEBUG("entry point %x\n", ph->entry_point);
381
382 loadaddress = ph->image_addr - dh_offset;
383 entrypoint = ph->image_addr + ph->entry_point;
384 } else {
385 ERROR("Machine type not x86 or x64.\n");
Stefan Reinauer543a6822013-02-04 15:39:13 -0800386 return -1;
387 }
388
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800389 if (buffer_create(output, (sizeof(segs) + input->size),
Stefan Reinauer543a6822013-02-04 15:39:13 -0800390 input->name) != 0)
391 return -1;
392
393 memset(output->data, 0, output->size);
394
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800395 doffset = (sizeof(segs));
Stefan Reinauer543a6822013-02-04 15:39:13 -0800396
397 /* Prepare code segment */
398 segs[0].type = PAYLOAD_SEGMENT_CODE;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800399 segs[0].load_addr = loadaddress;
400 segs[0].mem_len = input->size;
401 segs[0].offset = doffset;
Stefan Reinauer543a6822013-02-04 15:39:13 -0800402
Gabe Black845aa142014-02-21 01:01:06 -0800403 if (!compress(input->data, input->size, output->data + doffset, &len) &&
404 (unsigned int)len < input->size) {
405 segs[0].compression = algo;
406 segs[0].len = len;
407 } else {
408 WARN("Compression failed or would make the data bigger "
409 "- disabled.\n");
Stefan Reinauer543a6822013-02-04 15:39:13 -0800410 segs[0].compression = 0;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800411 segs[0].len = input->size;
Stefan Reinauer543a6822013-02-04 15:39:13 -0800412 memcpy(output->data + doffset, input->data, input->size);
413 }
414
415 /* prepare entry point segment */
416 segs[1].type = PAYLOAD_SEGMENT_ENTRY;
Ronald G. Minnicha8a133d2013-12-30 13:16:18 -0800417 segs[1].load_addr = entrypoint;
418 output->size = doffset + segs[0].len;
419 xdr_segs(output, segs, 2);
Stefan Reinauer543a6822013-02-04 15:39:13 -0800420 return 0;
421
422}
Patrick Georgide36d332013-08-27 20:22:21 +0200423