|
1 | 1 | /* php-dogma
|
2 |
| - * Copyright (C) 2013 Romain "Artefact2" Dalmaso <[email protected]> |
| 2 | + * Copyright (C) 2013, 2015 Romain "Artefact2" Dalmaso <[email protected]> |
3 | 3 | *
|
4 | 4 | * This program is free software: you can redistribute it and/or modify
|
5 | 5 | * it under the terms of the GNU Affero General Public License as published by
|
@@ -63,6 +63,19 @@ ZEND_END_ARG_INFO()
|
63 | 63 |
|
64 | 64 |
|
65 | 65 |
|
| 66 | +ZEND_BEGIN_ARG_INFO(arginfo_add_area_beacon, 0) |
| 67 | +ZEND_ARG_INFO(0, context) |
| 68 | +ZEND_ARG_INFO(0, typeid) |
| 69 | +ZEND_ARG_INFO(1, key) |
| 70 | +ZEND_END_ARG_INFO() |
| 71 | + |
| 72 | +ZEND_BEGIN_ARG_INFO(arginfo_remove_area_beacon, 0) |
| 73 | +ZEND_ARG_INFO(0, context) |
| 74 | +ZEND_ARG_INFO(0, key) |
| 75 | +ZEND_END_ARG_INFO() |
| 76 | + |
| 77 | + |
| 78 | + |
66 | 79 | ZEND_BEGIN_ARG_INFO(arginfo_add_implant, 0)
|
67 | 80 | ZEND_ARG_INFO(0, context)
|
68 | 81 | ZEND_ARG_INFO(0, typeid)
|
@@ -414,6 +427,9 @@ const zend_function_entry dogma_functions[] = {
|
414 | 427 | DEF_DOGMA_FE(free_context)
|
415 | 428 | DEF_DOGMA_FE(get_hashcode)
|
416 | 429 |
|
| 430 | + DEF_DOGMA_FE(add_area_beacon) |
| 431 | + DEF_DOGMA_FE(remove_area_beacon) |
| 432 | + |
417 | 433 | DEF_DOGMA_FE(add_implant)
|
418 | 434 | DEF_DOGMA_FE(remove_implant)
|
419 | 435 |
|
@@ -497,7 +513,7 @@ zend_module_entry dogma_module_entry = {
|
497 | 513 | PHP_RINIT(dogma),
|
498 | 514 | PHP_RSHUTDOWN(dogma),
|
499 | 515 | PHP_MINFO(dogma),
|
500 |
| - "1.1.0", |
| 516 | + "1.2.0", |
501 | 517 | STANDARD_MODULE_PROPERTIES
|
502 | 518 | };
|
503 | 519 |
|
@@ -696,6 +712,45 @@ ZEND_FUNCTION(dogma_get_hashcode) {
|
696 | 712 |
|
697 | 713 |
|
698 | 714 |
|
| 715 | +ZEND_FUNCTION(dogma_add_area_beacon) { |
| 716 | + zval* zctx; |
| 717 | + dogma_context_t* ctx; |
| 718 | + long implant; |
| 719 | + zval* zkey; |
| 720 | + dogma_key_t key; |
| 721 | + int ret; |
| 722 | + |
| 723 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zctx, &implant, &zkey) == FAILURE) { |
| 724 | + RETURN_FALSE; |
| 725 | + } |
| 726 | + GET_CTX(zctx, ctx); |
| 727 | + |
| 728 | + ret = dogma_add_area_beacon(ctx, (dogma_typeid_t)implant, &key); |
| 729 | + convert_to_null(zkey); |
| 730 | + ZVAL_LONG(zkey, (long)key); |
| 731 | + |
| 732 | + RETURN_LONG(ret); |
| 733 | +} |
| 734 | + |
| 735 | +ZEND_FUNCTION(dogma_remove_area_beacon) { |
| 736 | + zval* zctx; |
| 737 | + dogma_context_t* ctx; |
| 738 | + long key; |
| 739 | + |
| 740 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zctx, &key) == FAILURE) { |
| 741 | + RETURN_FALSE; |
| 742 | + } |
| 743 | + GET_CTX(zctx, ctx); |
| 744 | + |
| 745 | + RETURN_LONG(dogma_remove_area_beacon(ctx, (dogma_key_t)key)); |
| 746 | +} |
| 747 | + |
| 748 | + |
| 749 | + |
| 750 | +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ |
| 751 | + |
| 752 | + |
| 753 | + |
699 | 754 | ZEND_FUNCTION(dogma_add_implant) {
|
700 | 755 | zval* zctx;
|
701 | 756 | dogma_context_t* ctx;
|
|
0 commit comments