Skip to content

Commit

Permalink
some function hash
Browse files Browse the repository at this point in the history
  • Loading branch information
kojiba committed Dec 7, 2015
1 parent c075a90 commit d3c3d5d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/RayFoundation/RayConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
#warning Redefine RayBase.h DI macro and delete this warning
#else

#define RAY_LIBRARY_PRELOAD_ALLOCATOR ///< not work in windows
#define RAY_LIBRARY_PRELOAD_ALLOCATOR_TRACE ///< needs RAY_LIBRARY_PRELOAD_ALLOCATOR
// #define RAY_LIBRARY_PRELOAD_ALLOCATOR ///< not work in windows
// #define RAY_LIBRARY_PRELOAD_ALLOCATOR_TRACE ///< needs RAY_LIBRARY_PRELOAD_ALLOCATOR
#define R_POOL_DETAILED ///< to storage allocator thread id and malloced size
// #define R_POOL_META_ALLOC ///< POOL_DETAILED MUST BE ENABLED, to store string tip for pointer like metaAlloc(sizeInBytes, "some memory alloc"), only for RPool!

Expand Down
23 changes: 23 additions & 0 deletions Classes/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,33 @@

#include "Tests.h"

void some(int *trains) {
printf("cho, chooo, motherfucked\n");
++*trains;
}

void endSome() {}

int main(int argc, const char *argv[]) {
enablePool(RPool);
ComplexTest(); // lib test


size_t sizeOfSome = (size_t)&endSome - (size_t)&some;

unsigned char *body = malloc(sizeOfSome);
memcpy(body, some, sizeOfSome);
RData *function = makeRData(body, sizeOfSome, RDataTypeBytes);

p(RData)(function);

RString *baseHash = $(function, m(evasionHashBase64, RString)));
baseHash->type = RDataTypeASCII;
p(RString)(baseHash);

deleter(baseHash, RString);
deleter(function, RData);


endRay();
}

0 comments on commit d3c3d5d

Please sign in to comment.