decompiled_code:
_BOOL8 __fastcall is_chunked(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rbx
_BOOL8 result; // rax
__int64 v4; // rax

v1 = _(Transfer_Encoding_MSG);
v2 = find_header(a1, v1);
result = 0LL;
if ( v2 )
{
v4 = _("chunked");
result = (unsigned int)icmp(v2, v4) != 0;
}
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rbx
_BOOL8 result; // rax
__int64 v4; // rax

v1 = _(Transfer_Encoding_MSG);
v2 = find_header(a1, v1);
result = 0LL;
if ( v2 )
{
v4 = _("chunked");
result = (unsigned int)icmp(v2, v4) != 0;
}
return result;
}

original_code:
int
is_chunked(Headers headers)
{
 str enc = find_header(headers, _(Transfer_Encoding_MSG));
  return enc && icmp(enc,_("chunked"));
}

canonical_original_code:
int is_chunked(struct headers_struct *headers)
{
 struct str_struct *enc = find_header(headers, _(Transfer_Encoding_MSG));
  return enc && icmp(enc,_("chunked"));
}

variable_types: struct headers_struct { int nslots; struct headers_data_struct { struct str_struct { int length; char *data; char contents[]; } *key; struct str_struct *value; } slots[250]; } *


repo: cthulhuology/Jawas

decompiled_code:
__int64 __fastcall chunked_length(__int64 a1)
{
unsigned int v1; // ebp
unsigned int v2; // er12
__int64 v3; // rbx
int v4; // ebp

v1 = skip_headers(a1, 0LL);
v2 = 0;
do
{
v3 = read_line(a1, v1);
v4 = v1 + len(v3) + 2;
v1 = str_hex(v3) + v4;
v2 += str_hex(v3);
}
while ( (unsigned int)len(v3) );
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
unsigned int v1; // ebp
unsigned int v2; // er12
__int64 v3; // rbx
int v4; // ebp

v1 = skip_headers(a1, 0LL);
v2 = 0;
do
{
v3 = read_line(a1, v1);
v4 = v1 + len(v3) + 2;
v1 = str_hex(v3) + v4;
v2 += str_hex(v3);
}
while ( (unsigned int)len(v3) );
return v2;
}

original_code:
int
chunked_length(str src)
{
 int total = 0;
 str line;
 int pos = skip_headers(src,0);
 do {
  line = read_line(src,pos);
  pos += len(line) + 2;
  pos += str_hex(line);
  total += str_hex(line);
 } while (len(line) != 0);
 return total;
}

canonical_original_code:
int chunked_length(struct str_struct *src)
{
 int total = 0;
 struct str_struct *line;
 int pos = skip_headers(src,0);
 do {
  line = read_line(src,pos);
  pos += len(line) + 2;
  pos += str_hex(line);
  total += str_hex(line);
 } while (len(line) != 0);
 return total;
}

variable_types: struct str_struct { int length; char *data; char contents[]; } *

variable_types: total int

variable_types: pos int

return_type: int


decompiled_code:
__int64 __fastcall inbound_content_length(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rsi
__int64 v5; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( a2 )
{
if ( is_chunked(a2) )
{
result = chunked_length(a1);
}
else
{
v4 = _("Content-Length");
v5 = find_header(a2, v4);
result = str_int(v5);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rsi
__int64 v5; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( a2 )
{
if ( func0(a2) )
{
result = func1(a1);
}
else
{
v4 = _("Content-Length");
v5 = find_header(a2, v4);
result = str_int(v5);
}
}
return result;
}

original_code:
int
inbound_content_length(str src, Headers headers)
{
 if (!src || !headers) return 0;
 return is_chunked(headers) ?
  chunked_length(src) :
  str_int(find_header(headers, _("Content-Length")));
}

canonical_original_code:
int inbound_content_length(struct str_struct *src, struct headers_struct *headers)
{
 if (!src || !headers) return 0;
 return is_chunked(headers) ?
  chunked_length(src) :
  str_int(find_header(headers, _("Content-Length")));
}

variable_types: struct headers_struct { int nslots; struct headers_data_struct { struct str_struct *key; struct str_struct *value; } slots[250]; } *

user_defined_types: struct str_struct { int length; char *data; char contents[]; }

user_defined_types: struct headers_struct { int nslots; struct headers_data_struct slots[250]; }


decompiled_code:
__int64 __fastcall outbound_content_length(__int64 a1, __int64 a2)
{
__int64 result; // rax

if ( a1 )
return len(a1);
result = 0LL;
if ( a2 )
result = *(unsigned int *)(a2 + 56);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2)
{
__int64 result; // rax

if ( a1 )
return len(a1);
result = 0LL;
if ( a2 )
result = *(unsigned int *)(a2 + 56);
return result;
}

original_code:
int
outbound_content_length(str src, File fc)
{
 return src ? len(src) : fc ? fc->st.st_size : 0;
}

canonical_original_code:
int outbound_content_length(struct str_struct *src, struct file_cache_struct *fc)
{
 return src ? len(src) : fc ? fc->st.st_size : 0;
}

variable_types: struct file_cache_struct { struct file_cache_struct *next; struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; } st; struct parsed_struct { enum { TEXT=1, SCRIPT=2, EMIT=3 } kind; int offset; int length; } *parsed; struct mime_struct { struct { int len; char *data; } ending; struct { int len; char *data; } type; int (*handler)(struct file_cache_struct *); } *mime; char *data; int fd; struct str_struct name; } *

user_defined_types: struct file_cache_struct { struct file_cache_struct *next; struct stat st; struct parsed_struct *parsed; struct mime_struct *mime; char *data; int fd; struct str_struct name; }

user_defined_types: struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }


decompiled_code:
void restart_child()
{
unsigned int v0; // ebx
unsigned int v1; // eax

v0 = child;
v1 = getpid();
fprintf(stderr, "process %d got restart child %d\n", v1, v0);
kill(child, 1);
}

canonical_decompiled_code:
void func0()
{
unsigned int v0; // ebx
unsigned int v1; // eax

v0 = child;
v1 = getpid();
fprintf(stderr, "process %d got restart child %d\n", v1, v0);
kill(child, 1);
}

original_code:
void restart_child(int sig) {
 fprintf(stderr,"process %d got restart child %d\n", getpid(), child);
 kill(child,1);
}

variable_types: sig int

return_type: void


decompiled_code:
void __noreturn kill_all()
{
unsigned int v0; // eax

v0 = getpid();
fprintf(stderr, "process %d got killall\n", v0);
murder = 1;
done = 1;
kill(0, 15);
exit(0);
}

canonical_decompiled_code:
void __noreturn func1()
{
unsigned int v0; // eax

v0 = getpid();
fprintf(stderr, "process %d got killall\n", v0);
murder = 1;
done = 1;
kill(0, 15);
exit(0);
}

original_code:
void kill_all(int sig) {
 fprintf(stderr,"process %d got killall\n", getpid());
 murder = 1;
 done = 1;
 kill(0,15);
 exit(0);
}


decompiled_code:
int kill_child()
{
unsigned int v0; // ebx
unsigned int v1; // eax

v0 = child;
v1 = getpid();
fprintf(stderr, "process %d got kill child %d\n", v1, v0);
murder = 1;
return kill(child, 15);
}

canonical_decompiled_code:
int func2()
{
unsigned int v0; // ebx
unsigned int v1; // eax

v0 = child;
v1 = getpid();
fprintf(stderr, "process %d got kill child %d\n", v1, v0);
murder = 1;
return kill(child, 15);
}

original_code:
void kill_child(int sig) {
 fprintf(stderr,"process %d got kill child %d\n", getpid(), child);
 murder = 1;
 kill(child,15);
}


demon

decompiled_code:
void __fastcall demon(int a1)
{
int v1; // ebx
unsigned int v2; // eax
size_t v3; // rax
char v4[56]; // [rsp+0h] [rbp-38h] BYREF

while ( 1 )
{
if ( murder )
kill(child, 15);
if ( done )
exit(0);
if ( a1 )
{
child = fork();
if ( child )
exit(0);
child = fork();
}
if ( !child )
break;
v1 = open("jawas.pid", 577, 384LL);
if ( v1 <= 0 )
{
perror("open");
}
else
{
v2 = getpid();
snprintf(v4, 0x10uLL, "%i\n", v2);
v3 = strlen(v4);
if ( write(v1, v4, v3) < 0 )
fwrite("Failed to write pid", 1uLL, 0x13uLL, stderr);
close(v1);
}
signal(3, (__sighandler_t)kill_all);
signal(15, (__sighandler_t)kill_all);
signal(1, (__sighandler_t)restart_child);
while ( !waitpid(child, &child_status, 1) )
{
if ( murder )
kill_child();
sleep(1u);
}
}
}

canonical_decompiled_code:
void __fastcall func3(int a1)
{
int v1; // ebx
unsigned int v2; // eax
size_t v3; // rax
char v4[56]; // [rsp+0h] [rbp-38h] BYREF

while ( 1 )
{
if ( murder )
kill(child, 15);
if ( done )
exit(0);
if ( a1 )
{
child = fork();
if ( child )
exit(0);
child = fork();
}
if ( !child )
break;
v1 = open("jawas.pid", 577, 384LL);
if ( v1 <= 0 )
{
perror("open");
}
else
{
v2 = getpid();
snprintf(v4, 0x10uLL, "%i\n", v2);
v3 = strlen(v4);
if ( write(v1, v4, v3) < 0 )
fwrite("Failed to write pid", 1uLL, 0x13uLL, stderr);
close(v1);
}
signal(3, (__sighandler_t)kill_all);
signal(15, (__sighandler_t)kill_all);
signal(1, (__sighandler_t)restart_child);
while ( !waitpid(child, &child_status, 1) )
{
if ( murder )
func2();
sleep(1u);
}
}
}

original_code:
void
demon(int detach)
{
restart:
 if (murder) kill(child,15);
 if (done) exit(0);
 if (detach) {
  child = fork();
  if (child != 0) exit(0);
  child = fork();
 }
 if (child == 0) return;
 char pid[17];
 int pidfd = open("jawas.pid",0100|01|01000,0600);
 if (pidfd > 0) {
  snprintf(&pid[0],16,"%i\n",getpid());
  if (write(pidfd,pid,strlen(pid)) < 0)
   fprintf(stderr,"Failed to write pid");
  close(pidfd);
 } else perror("open");
 signal(3,kill_all);
 signal(15,kill_all);
 signal(1,restart_child);
 while (!waitpid(child,&child_status,1)) {
  if (murder) kill_child(15);
  sleep(1);
 }
 goto restart;
}

variable_types: detach int

variable_types:
pid
char [17]

variable_types: pidfd int


decompiled_code:
__int64 __fastcall monitor_socket(__int64 a1)
{
return ((__int64 (__fastcall *)(_QWORD, __int64, _QWORD, _QWORD))add_event)(server, a1, 0LL, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
return ((__int64 (__fastcall *)(_QWORD, __int64, _QWORD, _QWORD))add_event)(server, a1, 0LL, 0LL);
}

original_code:
void
monitor_socket(uint64_t f)
{
 add_event(server.kq, f, READ, NONE);
}

canonical_original_code:
void monitor_socket(unsigned long f)
{
 add_event(server.kq, f, READ, NONE);
}

variable_types:
f
unsigned long


decompiled_code:
__int64 __fastcall add_read_socket(__int64 a1)
{
*((_DWORD *)&client + 4) = 0;
return ((__int64 (__fastcall *)(_QWORD, __int64, _QWORD, __int64))add_event)(client, a1, 0LL, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
*((_DWORD *)&client + 4) = 0;
return ((__int64 (__fastcall *)(_QWORD, __int64, _QWORD, __int64))add_event)(client, a1, 0LL, 1LL);
}

original_code:
void
add_read_socket(uint64_t f)
{
 client.event = READ;
 add_event(client.kq, f, READ, ONESHOT);
}

canonical_original_code:
void add_read_socket(unsigned long f)
{
 client.event = READ;
 add_event(client.kq, f, READ, ONESHOT);
}


decompiled_code:
__int64 __fastcall add_write_socket(__int64 a1)
{
*((_DWORD *)&client + 4) = 1;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 1LL, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
*((_DWORD *)&client + 4) = 1;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 1LL, 1LL);
}

original_code:
void
add_write_socket(uint64_t f)
{
 client.event = WRITE;
 add_event(client.kq, f, WRITE, ONESHOT);
}

canonical_original_code:
void add_write_socket(unsigned long f)
{
 client.event = WRITE;
 add_event(client.kq, f, WRITE, ONESHOT);
}


decompiled_code:
__int64 __fastcall add_req_socket(__int64 a1)
{
*((_DWORD *)&client + 4) = 3;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 3LL, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
*((_DWORD *)&client + 4) = 3;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 3LL, 1LL);
}

original_code:
void
add_req_socket(uint64_t f)
{
 client.event = REQ;
 add_event(client.kq, f, REQ, ONESHOT);
}

canonical_original_code:
void add_req_socket(unsigned long f)
{
 client.event = REQ;
 add_event(client.kq, f, REQ, ONESHOT);
}


decompiled_code:
__int64 __fastcall add_resp_socket(__int64 a1)
{
*((_DWORD *)&client + 4) = 2;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 2LL, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
*((_DWORD *)&client + 4) = 2;
return ((__int64 (__fastcall *)(_QWORD, __int64, __int64, __int64))add_event)(client, a1, 2LL, 1LL);
}

original_code:
void
add_resp_socket(uint64_t f)
{
 client.event = RESP;
 add_event(client.kq, f, RESP, ONESHOT);
}

canonical_original_code:
void add_resp_socket(unsigned long f)
{
 client.event = RESP;
 add_event(client.kq, f, RESP, ONESHOT);
}


decompiled_code:
__int64 __fastcall add_file_monitor(__int64 a1, __int64 a2)
{
inotify_add_watch(server[1], *(const char **)(a2 + 8), 0x202u);
return ((__int64 (__fastcall *)(_QWORD, _QWORD, __int64, __int64))add_event)(server[0], server[1], 4LL, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, __int64 a2)
{
inotify_add_watch(server[1], *(const char **)(a2 + 8), 0x202u);
return ((__int64 (__fastcall *)(_QWORD, _QWORD, __int64, __int64))add_event)(server[0], server[1], 4LL, 1LL);
}

original_code:
void
add_file_monitor(uint64_t f, str filename)
{
 inotify_add_watch(server.in,filename->data, 0x00000002 | 0x00000200);
 add_event(server.kq, server.in, NODE, ONESHOT);
}

canonical_original_code:
void add_file_monitor(unsigned long f, struct str_struct *filename)
{
 inotify_add_watch(server.in,filename->data, 0x00000002 | 0x00000200);
 add_event(server.kq, server.in, NODE, ONESHOT);
}


decompiled_code:
void add_pid_monitor()
{
;
}

canonical_decompiled_code:
void func6()
{
;
}

original_code:
void
add_pid_monitor(pid_t p)
{
}

canonical_original_code:
void add_pid_monitor(int p)
{
}

variable_types: p int


decompiled_code:
__int64 __fastcall find_status_code(int a1)
{
int v1; // eax
_DWORD *v2; // rdx
unsigned int v3; // ecx

v1 = stati;
if ( !stati )
return find_status_code(500LL);
v2 = &unk_1B8;
v3 = 0;
while ( a1 != v1 )
{
++v3;
v2 += 6;
v1 = *(v2 - 6);
if ( !v1 )
return find_status_code(500LL);
}
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1)
{
int v1; // eax
_DWORD *v2; // rdx
unsigned int v3; // ecx

v1 = stati;
if ( !stati )
return func0(500LL);
v2 = &unk_1B8;
v3 = 0;
while ( a1 != v1 )
{
++v3;
v2 += 6;
v1 = *(v2 - 6);
if ( !v1 )
return func0(500LL);
}
return v3;
}

original_code:
int
find_status_code(int code)
{
 for (int i = 0; stati[i].code; ++i)
  if (stati[i].code == code)
   return i;
 return find_status_code(500);
}

variable_types: code int

variable_types: i int


decompiled_code:
__int64 __fastcall status_line(int a1)
{
int v1; // ebx

v1 = find_status_code(a1);
if ( !dword_1A4[6 * v1] )
dword_1A4[6 * v1] = strlen((&off_1A8)[3 * v1]);
return _("%c %c", "HTTP/1.1", (&off_1A8)[3 * v1]);
}

original_code:
str
status_line(int code)
{
 int i = find_status_code(code);
 if (stati[i].len == 0)
  stati[i].len = strlen(stati[i].reason);
 return _("%c %c",http_version,stati[i].reason);
}

canonical_original_code:
struct str_struct *status_line(int code)
{
 int i = find_status_code(code);
 if (stati[i].len == 0)
  stati[i].len = strlen(stati[i].reason);
 return _("%c %c",http_version,stati[i].reason);
}

return_type: struct str_struct { int length; char *data; char contents[]; } *


decompiled_code:
__int64 __fastcall error_handler(unsigned int a1)
{
__int64 v2; // rdi
const char *v3; // rbx
const char *v4; // rax
__int64 v5; // rax
__int64 v6; // rbp
__int64 *v7; // rax
__int64 v8; // rdi
unsigned int v9; // ebx
__int64 *v10; // rax

v2 = qword_1B0[3 * (int)find_status_code(a1)];
if ( v2 )
{
v3 = (const char *)copy(v2, 0LL);
v4 = (const char *)ref("errors", 6LL);
v5 = _("%s/%s%s", *((const char **)&server + 7), v4, v3);
v6 = load(v5);
send_status(**((_QWORD **)&client + 5), a1);
send_headers(**((_QWORD **)&client + 5), *(_QWORD *)(*((_QWORD *)&client + 5) + 16LL));
if ( v6 )
{
*(_QWORD *)(*((_QWORD *)&client + 5) + 32LL) = v6;
v7 = (__int64 *)*((_QWORD *)&client + 5);
v8 = *v7;
v9 = *(_DWORD *)(*v7 + 40);
if ( !v9 )
{
do
{
if ( (int)v9 >= *(_QWORD *)(v6 + 56) )
break;
v9 += send_raw_contents(v8, v6, v9, 1LL);
v10 = (__int64 *)*((_QWORD *)&client + 5);
v8 = *v10;
}
while ( !*(_DWORD *)(*v10 + 40) );
}
}
}
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func3(unsigned int a1)
{
__int64 v2; // rdi
const char *v3; // rbx
const char *v4; // rax
__int64 v5; // rax
__int64 v6; // rbp
__int64 *v7; // rax
__int64 v8; // rdi
unsigned int v9; // ebx
__int64 *v10; // rax

v2 = qword_1B0[3 * (int)func0(a1)];
if ( v2 )
{
v3 = (const char *)copy(v2, 0LL);
v4 = (const char *)ref("errors", 6LL);
v5 = _("%s/%s%s", *((const char **)&server + 7), v4, v3);
v6 = load(v5);
func2(**((_QWORD **)&client + 5), a1);
send_headers(**((_QWORD **)&client + 5), *(_QWORD *)(*((_QWORD *)&client + 5) + 16LL));
if ( v6 )
{
*(_QWORD *)(*((_QWORD *)&client + 5) + 32LL) = v6;
v7 = (__int64 *)*((_QWORD *)&client + 5);
v8 = *v7;
v9 = *(_DWORD *)(*v7 + 40);
if ( !v9 )
{
do
{
if ( (int)v9 >= *(_QWORD *)(v6 + 56) )
break;
v9 += send_raw_contents(v8, v6, v9, 1LL);
v10 = (__int64 *)*((_QWORD *)&client + 5);
v8 = *v10;
}
while ( !*(_DWORD *)(*v10 + 40) );
}
}
}
return a1;
}

original_code:
int
error_handler(int code)
{
 int total = 0;
 int i = find_status_code(code);
 if (! stati[i].filename) return code;
 File fc = load(_("%s/%s%s",server.cwd,ref("errors",6),copy(stati[i].filename,0)));
 send_status(client.response->socket,code);
 send_headers(client.response->socket,client.response->headers);
 if (! fc) return code;
 client.response->raw_contents = fc;
 while (!client.response->socket->closed && total < fc->st.st_size)
  total += send_raw_contents(client.response->socket,fc,total,1);
 return code;
}

canonical_original_code:
int error_handler(int code)
{
 int total = 0;
 int i = find_status_code(code);
 if (! stati[i].filename) return code;
 struct file_cache_struct *fc = load(_("%s/%s%s",server.cwd,ref("errors",6),copy(stati[i].filename,0)));
 send_status(client.response->socket,code);
 send_headers(client.response->socket,client.response->headers);
 if (! fc) return code;
 client.response->raw_contents = fc;
 while (!client.response->socket->closed && total < fc->st.st_size)
  total += send_raw_contents(client.response->socket,fc,total,1);
 return code;
}

variable_types: struct file_cache_struct { struct file_cache_struct *next; struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; } st; struct parsed_struct { enum { TEXT=1, SCRIPT=2, EMIT=3 } kind; int offset; int length; } *parsed; struct mime_struct { struct { int len; char *data; } ending; struct { int len; char *data; } type; int (*handler)(struct file_cache_struct *); } *mime; char *data; int fd; struct str_struct { int length; char *data; char contents[]; } name; } *


decompiled_code:
void log_start()
{
openlog("jawas", 11, 176);
}

canonical_decompiled_code:
void func0()
{
openlog("jawas", 11, 176);
}


decompiled_code:
void log_msg(unsigned int a1, __int64 a2, ...)
{
__int64 v2; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

if ( log_level >= (int)a1 && a1 <= 4 )
{
va_start(va, a2);
v2 = new_str(a2, va);
syslog(log_msgs[a1], *(const char **)(v2 + 8));
}
}

canonical_decompiled_code:
void func1(unsigned int a1, __int64 a2, ...)
{
__int64 v2; // rax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

if ( log_level >= (int)a1 && a1 <= 4 )
{
va_start(va, a2);
v2 = new_str(a2, va);
syslog(log_msgs[a1], *(const char **)(v2 + 8));
}
}

original_code:
void
log_msg(int lvl, char* fmt, ...)
{
 va_list args;
 if (lvl < 0 || lvl > log_level || lvl > max_log_lvl) return;
 __builtin_va_start(args,fmt);
 str msg = new_str(fmt,args);
 syslog(log_msgs[lvl],msg->data);
 __builtin_va_end(args);
}

canonical_original_code:
void log_msg(int lvl, char *fmt, ...)
{
 __builtin_va_list args;
 if (lvl < 0 || lvl > log_level || lvl > max_log_lvl) return;
 __builtin_va_start(args,fmt);
 struct str_struct *msg = new_str(fmt,args);
 syslog(log_msgs[lvl],msg->data);
 __builtin_va_end(args);
}

variable_types: lvl int

variable_types:
fmt
char *


decompiled_code:
__int64 __fastcall img_handler(__int64 a1)
{
time_t v2; // rax
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rax
const char *v6; // rax
const char *v7; // rbx
__int64 v8; // r12
int v9; // er13
const char *v10; // rax
int v11; // eax
const char *v12; // rax
__int64 *v13; // rax
__int64 v14; // rdi
unsigned int v15; // ebx
__int64 *v16; // rax

cache_control(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), "max-age=86400, public");
v2 = time(0LL);
v3 = Date(v2);
date_field(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), *(_QWORD *)(v3 + 8));
v4 = Expires();
expires(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), *(_QWORD *)(v4 + 8));
send_status(**((_QWORD **)&client + 5), 200LL);
send_headers(**((_QWORD **)&client + 5), *(_QWORD *)(*((_QWORD *)&client + 5) + 16LL));
v5 = _("Range");
v6 = (const char *)find_header(*(_QWORD *)(*(_QWORD *)(*((_QWORD *)&client + 5) + 8LL) + 16LL), v5);
if ( v6 )
{
v7 = v6;
log_msg(3LL, "Ranges: %s", v6);
v8 = (unsigned int)find(v7, 0LL, "0123456789", 10LL);
v9 = find(v7, v8, "-", 1LL);
v10 = (const char *)ref(*((_QWORD *)v7 + 1) + (int)v8, (unsigned int)(v9 - v8));
log_msg(3LL, "Start range: %s", v10);
v11 = len(v7);
v12 = (const char *)ref(*((_QWORD *)v7 + 1) + v9 + 1LL, (unsigned int)(v11 - v9));
log_msg(3LL, "End range: %s", v12);
}
v13 = (__int64 *)*((_QWORD *)&client + 5);
v14 = *v13;
v15 = *(_DWORD *)(*v13 + 40);
if ( !v15 )
{
do
{
if ( (int)v15 >= *(_QWORD *)(a1 + 56) )
break;
v15 += send_raw_contents(v14, a1, v15, 1LL);
v16 = (__int64 *)*((_QWORD *)&client + 5);
v14 = *v16;
}
while ( !*(_DWORD *)(*v16 + 40) );
}
return 200LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
time_t v2; // rax
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rax
const char *v6; // rax
const char *v7; // rbx
__int64 v8; // r12
int v9; // er13
const char *v10; // rax
int v11; // eax
const char *v12; // rax
__int64 *v13; // rax
__int64 v14; // rdi
unsigned int v15; // ebx
__int64 *v16; // rax

cache_control(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), "max-age=86400, public");
v2 = time(0LL);
v3 = Date(v2);
date_field(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), *(_QWORD *)(v3 + 8));
v4 = Expires();
expires(*(_QWORD *)(*((_QWORD *)&client + 5) + 16LL), *(_QWORD *)(v4 + 8));
send_status(**((_QWORD **)&client + 5), 200LL);
send_headers(**((_QWORD **)&client + 5), *(_QWORD *)(*((_QWORD *)&client + 5) + 16LL));
v5 = _("Range");
v6 = (const char *)find_header(*(_QWORD *)(*(_QWORD *)(*((_QWORD *)&client + 5) + 8LL) + 16LL), v5);
if ( v6 )
{
v7 = v6;
log_msg(3LL, "Ranges: %s", v6);
v8 = (unsigned int)find(v7, 0LL, "0123456789", 10LL);
v9 = find(v7, v8, "-", 1LL);
v10 = (const char *)ref(*((_QWORD *)v7 + 1) + (int)v8, (unsigned int)(v9 - v8));
log_msg(3LL, "Start range: %s", v10);
v11 = len(v7);
v12 = (const char *)ref(*((_QWORD *)v7 + 1) + v9 + 1LL, (unsigned int)(v11 - v9));
log_msg(3LL, "End range: %s", v12);
}
v13 = (__int64 *)*((_QWORD *)&client + 5);
v14 = *v13;
v15 = *(_DWORD *)(*v13 + 40);
if ( !v15 )
{
do
{
if ( (int)v15 >= *(_QWORD *)(a1 + 56) )
break;
v15 += send_raw_contents(v14, a1, v15, 1LL);
v16 = (__int64 *)*((_QWORD *)&client + 5);
v14 = *v16;
}
while ( !*(_DWORD *)(*v16 + 40) );
}
return 200LL;
}

original_code:
int
img_handler(File fc)
{
 int total = 0;
 cache_control(client.response->headers,"max-age=86400, public");
 date_field(client.response->headers,Date(time(((void *)0)))->data);
 expires(client.response->headers,Expires()->data);
 send_status(client.response->socket,200);
 send_headers(client.response->socket,client.response->headers);
 str range = find_header(client.response->request->headers,_("Range"));
 if (range) {
  log_msg(3,"Ranges: %s",range);
  int start = find(range,0,"0123456789",10);
  int dash = find(range,start,"-",1);
  log_msg(3,"Start range: %s",ref(range->data+start,dash-start));
  log_msg(3,"End range: %s",ref(range->data+dash+1,len(range)-dash));
 }
 while (! client.response->socket->closed && total < fc->st.st_size)
  total += send_raw_contents(client.response->socket,fc,total,1);
 return 200;
}

canonical_original_code:
int img_handler(struct file_cache_struct *fc)
{
 int total = 0;
 cache_control(client.response->headers,"max-age=86400, public");
 date_field(client.response->headers,Date(time(((void *)0)))->data);
 expires(client.response->headers,Expires()->data);
 send_status(client.response->socket,200);
 send_headers(client.response->socket,client.response->headers);
 struct str_struct *range = find_header(client.response->request->headers,_("Range"));
 if (range) {
  log_msg(3,"Ranges: %s",range);
  int start = find(range,0,"0123456789",10);
  int dash = find(range,start,"-",1);
  log_msg(3,"Start range: %s",ref(range->data+start,dash-start));
  log_msg(3,"End range: %s",ref(range->data+dash+1,len(range)-dash));
 }
 while (! client.response->socket->closed && total < fc->st.st_size)
  total += send_raw_contents(client.response->socket,fc,total,1);
 return 200;
}

variable_types: start int

variable_types: dash int

user_defined_types: struct timespec { long tv_sec; long tv_nsec; }

user_defined_types: struct parsed_struct { enum { TEXT=1, SCRIPT=2, EMIT=3 } kind; int offset; int length; }

user_defined_types: struct mime_struct { struct { int len; char *data; } ending; struct { int len; char *data; } type; int (*handler)(struct file_cache_struct *); }


decompiled_code:
__int64 __fastcall is_directory(__int64 a1)
{
void *v1; // rcx
__int64 result; // rax
struct stat v3; // [rsp+0h] [rbp-98h] BYREF

if ( stat(*(const char **)(a1 + 8), &v3) )
{
log_msg(0LL, "Failed to stat file %s", (const char *)a1);
result = 0LL;
}
else
{
v1 = &unk_2D3;
if ( (v3.st_mode & 0x4000) == 0 )
v1 = &unk_2D7;
log_msg(3LL, "Is %s a Directory? %c", (const char *)a1, v1);
result = v3.st_mode & 0x4000;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
void *v1; // rcx
__int64 result; // rax
struct stat v3; // [rsp+0h] [rbp-98h] BYREF

if ( stat(*(const char **)(a1 + 8), &v3) )
{
log_msg(0LL, "Failed to stat file %s", (const char *)a1);
result = 0LL;
}
else
{
v1 = &unk_2D3;
if ( (v3.st_mode & 0x4000) == 0 )
v1 = &unk_2D7;
log_msg(3LL, "Is %s a Directory? %c", (const char *)a1, v1);
result = v3.st_mode & 0x4000;
}
return result;
}

original_code:
int
is_directory(str filename)
{
 struct stat st;
 if (stat(filename->data,&st)) {
  log_msg(0,"Failed to stat file %s",filename);
  return 0;
 }
 log_msg(3,"Is %s a Directory? %c",filename,st.st_mode & 0040000 ? "yes": "no");
 return st.st_mode & 0040000;
}

canonical_original_code:
int is_directory(struct str_struct *filename)
{
 struct stat st;
 if (stat(filename->data,&st)) {
  log_msg(0,"Failed to stat file %s",filename);
  return 0;
 }
 log_msg(3,"Is %s a Directory? %c",filename,st.st_mode & 0040000 ? "yes": "no");
 return st.st_mode & 0040000;
}

variable_types: struct str_struct { int length; char *data; char contents[]; } *

variable_types: struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }


decompiled_code:
__int64 __fastcall is_file(__int64 a1)
{
struct stat v2; // [rsp+0h] [rbp-98h] BYREF

if ( !stat(*(const char **)(a1 + 8), &v2) )
return v2.st_mode & 0xA000;
log_msg(0LL, "Failed to stat file %s", (const char *)a1);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
struct stat v2; // [rsp+0h] [rbp-98h] BYREF

if ( !stat(*(const char **)(a1 + 8), &v2) )
return v2.st_mode & 0xA000;
log_msg(0LL, "Failed to stat file %s", (const char *)a1);
return 0LL;
}

original_code:
int
is_file(str filename)
{
 struct stat st;
 if (stat(filename->data,&st)) {
  log_msg(0,"Failed to stat file %s",filename);
  return 0;
 }
 return st.st_mode & (0100000|0120000);
}

canonical_original_code:
int is_file(struct str_struct *filename)
{
 struct stat st;
 if (stat(filename->data,&st)) {
  log_msg(0,"Failed to stat file %s",filename);
  return 0;
 }
 return st.st_mode & (0100000|0120000);
}


decompiled_code:
__int64 __fastcall deauth_path(const char *a1, __int64 a2)
{
int v2; // er12
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rbx
unsigned int v7; // er14
const char *v8; // rax
__int64 v9; // rax
const char *v10; // rax
__int64 v11; // r12
__int64 v12; // rax
const char *v13; // rax

v2 = len(a2);
v3 = _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
if ( (unsigned int)is_directory(v3) )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
v4 = _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
if ( (unsigned int)is_file(v4) )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
v5 = 1LL;
if ( (unsigned __int64)v2 <= 1 )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
while ( 1 )
{
if ( (unsigned __int8)at(a2, (unsigned int)v5) == 47 )
{
v7 = v2 - v5;
v8 = (const char *)ref(*(_QWORD *)(a2 + 8) + v5, (unsigned int)(v2 - v5));
v9 = _("%s/%s%s", *((const char **)&server + 7), a1, v8);
if ( (unsigned int)is_directory(v9) )
break;
}
if ( v2 == ++v5 )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
}
v10 = (const char *)ref(*(_QWORD *)(a2 + 8) + 1LL, (unsigned int)(v5 - 1));
log_msg(3LL, "Found auth token [%s]", v10);
v11 = ref(*(_QWORD *)(a2 + 8) + 1LL, (unsigned int)(v5 - 1));
v12 = _("Token");
append_header(*(_QWORD *)(client[4] + 16LL), v12, v11);
v13 = (const char *)ref(*(_QWORD *)(a2 + 8) + v5, v7);
return _("%s/%s%s", *((const char **)&server + 7), a1, v13);
}

canonical_decompiled_code:
__int64 __fastcall func2(const char *a1, __int64 a2)
{
int v2; // er12
__int64 v3; // rax
__int64 v4; // rax
__int64 v5; // rbx
unsigned int v7; // er14
const char *v8; // rax
__int64 v9; // rax
const char *v10; // rax
__int64 v11; // r12
__int64 v12; // rax
const char *v13; // rax

v2 = len(a2);
v3 = _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
if ( (unsigned int)func0(v3) )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
v4 = _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
if ( (unsigned int)func1(v4) )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
v5 = 1LL;
if ( (unsigned __int64)v2 <= 1 )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
while ( 1 )
{
if ( (unsigned __int8)at(a2, (unsigned int)v5) == 47 )
{
v7 = v2 - v5;
v8 = (const char *)ref(*(_QWORD *)(a2 + 8) + v5, (unsigned int)(v2 - v5));
v9 = _("%s/%s%s", *((const char **)&server + 7), a1, v8);
if ( (unsigned int)func0(v9) )
break;
}
if ( v2 == ++v5 )
return _("%s/%s%s", *((const char **)&server + 7), a1, (const char *)a2);
}
v10 = (const char *)ref(*(_QWORD *)(a2 + 8) + 1LL, (unsigned int)(v5 - 1));
log_msg(3LL, "Found auth token [%s]", v10);
v11 = ref(*(_QWORD *)(a2 + 8) + 1LL, (unsigned int)(v5 - 1));
v12 = _("Token");
append_header(*(_QWORD *)(client[4] + 16LL), v12, v11);
v13 = (const char *)ref(*(_QWORD *)(a2 + 8) + v5, v7);
return _("%s/%s%s", *((const char **)&server + 7), a1, v13);
}

original_code:
str
deauth_path(str host, str filename)
{
 size_t l = len(filename);
 if (is_directory(_("%s/%s%s",server.cwd,host,filename)) || is_file(_("%s/%s%s",server.cwd,host,filename)))
  return _("%s/%s%s",server.cwd,host,filename);
 for (int i = 1; i < l; ++i) {
  if (at(filename,i) == '/' && is_directory(_("%s/%s%s",server.cwd,host,ref(filename->data+i,l-i)))) {
   log_msg(3,"Found auth token [%s]",ref(filename->data+1,i-1));
   append_header(client.request->headers,_("Token"),ref(filename->data+1,i-1));
   return _("%s/%s%s",server.cwd,host,ref(filename->data+i,l-i));
  }
 }
 return _("%s/%s%s",server.cwd,host,filename);
}

canonical_original_code:
struct str_struct *deauth_path(struct str_struct *host, struct str_struct *filename)
{
 unsigned long l = len(filename);
 if (is_directory(_("%s/%s%s",server.cwd,host,filename)) || is_file(_("%s/%s%s",server.cwd,host,filename)))
  return _("%s/%s%s",server.cwd,host,filename);
 for (int i = 1; i < l; ++i) {
  if (at(filename,i) == '/' && is_directory(_("%s/%s%s",server.cwd,host,ref(filename->data+i,l-i)))) {
   log_msg(3,"Found auth token [%s]",ref(filename->data+1,i-1));
   append_header(client.request->headers,_("Token"),ref(filename->data+1,i-1));
   return _("%s/%s%s",server.cwd,host,ref(filename->data+i,l-i));
  }
 }
 return _("%s/%s%s",server.cwd,host,filename);
}

variable_types:
host
struct str_struct *

variable_types:
filename
struct str_struct *

variable_types:
l
unsigned long


decompiled_code:
__int64 __fastcall get_index(const char *a1)
{
char **v1; // rbx
const char *v2; // r12
__int64 v3; // rax
__int64 result; // rax
__int64 v5; // rax

v1 = off_388;
v2 = "index.html";
while ( 1 )
{
v3 = _("%s%c", a1, v2);
result = load(v3);
if ( result )
break;
v5 = _("%s/%c", a1, v2);
result = load(v5);
if ( result )
break;
v2 = *v1++;
if ( !v2 )
return 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(const char *a1)
{
char **v1; // rbx
const char *v2; // r12
__int64 v3; // rax
__int64 result; // rax
__int64 v5; // rax

v1 = off_388;
v2 = "index.html";
while ( 1 )
{
v3 = _("%s%c", a1, v2);
result = load(v3);
if ( result )
break;
v5 = _("%s/%c", a1, v2);
result = load(v5);
if ( result )
break;
v2 = *v1++;
if ( !v2 )
return 0LL;
}
return result;
}

original_code:
File
get_index(str filename)
{
 File retval = ((void *)0);
 for (int i = 0; indexes[i]; ++i) {
  str index_path = _("%s%c",filename,indexes[i]);
  if ((retval = load(index_path))) return retval;
  index_path = _("%s/%c",filename,indexes[i]);
  if ((retval = load(index_path))) return retval;
 }
 return ((void *)0);
}

canonical_original_code:
struct file_cache_struct *get_index(struct str_struct *filename)
{
 struct file_cache_struct *retval = ((void *)0);
 for (int i = 0; indexes[i]; ++i) {
  struct str_struct *index_path = _("%s%c",filename,indexes[i]);
  if ((retval = load(index_path))) return retval;
  index_path = _("%s/%c",filename,indexes[i]);
  if ((retval = load(index_path))) return retval;
 }
 return ((void *)0);
}

return_type: struct file_cache_struct { struct file_cache_struct *next; struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; } st; struct parsed_struct { enum { TEXT=1, SCRIPT=2, EMIT=3 } kind; int offset; int length; } *parsed; struct mime_struct { struct { int len; char *data; } ending; struct { int len; char *data; } type; int (*handler)(struct file_cache_struct *); } *mime; char *data; int fd; struct str_struct { int length; char *data; char contents[]; } name; } *


decompiled_code:
int *__fastcall lookup_mimetype(const char *a1)
{
int v1; // er12
int v2; // ebp
const char *v3; // rax
int v4; // er12
int v5; // eax
int *v6; // rbx

v1 = strlen(a1);
log_msg(3LL, "Local: %c", a1);
v2 = v1 - 1;
if ( v1 - 1 > 0 )
{
v3 = &a1[v2];
do
{
if ( *(v3 - 1) == 46 )
break;
--v3;
--v2;
}
while ( v2 );
}
v4 = v1 - v2;
v5 = mime_types;
if ( mime_types )
{
v6 = &mime_types;
do
{
if ( v4 == v5 && !strncmp(*((const char **)v6 + 1), &a1[v2], v4) )
break;
v6 += 10;
v5 = *v6;
}
while ( *v6 );
}
else
{
v6 = &mime_types;
}
log_msg(3LL, "Mime: %c (%c)", *((_QWORD *)v6 + 3), &a1[v2]);
return v6;
}

canonical_decompiled_code:
int *__fastcall func0(const char *a1)
{
int v1; // er12
int v2; // ebp
const char *v3; // rax
int v4; // er12
int v5; // eax
int *v6; // rbx

v1 = strlen(a1);
log_msg(3LL, "Local: %c", a1);
v2 = v1 - 1;
if ( v1 - 1 > 0 )
{
v3 = &a1[v2];
do
{
if ( *(v3 - 1) == 46 )
break;
--v3;
--v2;
}
while ( v2 );
}
v4 = v1 - v2;
v5 = mime_types;
if ( mime_types )
{
v6 = &mime_types;
do
{
if ( v4 == v5 && !strncmp(*((const char **)v6 + 1), &a1[v2], v4) )
break;
v6 += 10;
v5 = *v6;
}
while ( *v6 );
}
else
{
v6 = &mime_types;
}
log_msg(3LL, "Mime: %c (%c)", *((_QWORD *)v6 + 3), &a1[v2]);
return v6;
}

original_code:
MimeTypes*
lookup_mimetype(char* filename)
{
 MimeTypes* mt;
 int i,l = strlen(filename);
 log_msg(3,"Local: %c",filename);
 for (i = l - 1; i > 0; --i)
  if (filename[i-1] == '.') break;
 l -= i;
 for (mt = mime_types; mt->ending.len; ++mt)
  if (l == mt->ending.len && !strncmp(mt->ending.data,&filename[i],l))
   break;
 log_msg(3,"Mime: %c (%c)",mt->type.data,&filename[i]);
 return mt;
}

canonical_original_code:
struct mime_struct *lookup_mimetype(char *filename)
{
 struct mime_struct *mt;
 int i; int l = strlen(filename);
 log_msg(3,"Local: %c",filename);
 for (i = l - 1; i > 0; --i)
  if (filename[i-1] == '.') break;
 l -= i;
 for (mt = mime_types; mt->ending.len; ++mt)
  if (l == mt->ending.len && !strncmp(mt->ending.data,&filename[i],l))
   break;
 log_msg(3,"Mime: %c (%c)",mt->type.data,&filename[i]);
 return mt;
}

variable_types:
filename
char *

variable_types: struct mime_struct { struct { int len; char *data; } ending; struct { int len; char *data; } type; int (*handler)(struct file_cache_struct { struct file_cache_struct *next; struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; } st; struct parsed_struct { enum { TEXT=1, SCRIPT=2, EMIT=3 } kind; int offset; int length; } *parsed; struct mime_struct *mime; char *data; int fd; struct str_struct { int length; char *data; char contents[]; } name; } *); } *

variable_types: l int


decompiled_code:
__int64 __fastcall mimetype_handler(__int64 a1)
{
__int64 result; // rax

if ( a1 )
{
if ( !*(_QWORD *)(a1 + 160) )
*(_QWORD *)(a1 + 160) = lookup_mimetype(*(const char **)(a1 + 192));
content_type(*(_QWORD *)(client[5] + 16LL), *(_QWORD *)(*(_QWORD *)(a1 + 160) + 24LL));
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 160) + 32LL))(a1);
}
else
{
log_msg(0LL, "File not found 404");
result = error_handler(404LL);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
__int64 result; // rax

if ( a1 )
{
if ( !*(_QWORD *)(a1 + 160) )
*(_QWORD *)(a1 + 160) = func0(*(const char **)(a1 + 192));
content_type(*(_QWORD *)(client[5] + 16LL), *(_QWORD *)(*(_QWORD *)(a1 + 160) + 24LL));
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 160) + 32LL))(a1);
}
else
{
log_msg(0LL, "File not found 404");
result = error_handler(404LL);
}
return result;
}

original_code:
int
mimetype_handler(File fc)
{
 if (!fc) {
  log_msg(0,"File not found 404");
  return error_handler(404);
 }
 if (!fc->mime) fc->mime = lookup_mimetype(fc->name.data);
 content_type(client.response->headers, fc->mime->type.data);
 return fc->mime->handler(fc);
}

canonical_original_code:
int mimetype_handler(struct file_cache_struct *fc)
{
 if (!fc) {
  log_msg(0,"File not found 404");
  return error_handler(404);
 }
 if (!fc->mime) fc->mime = lookup_mimetype(fc->name.data);
 content_type(client.response->headers, fc->mime->type.data);
 return fc->mime->handler(fc);
}


decompiled_code:
_BOOL8 __fastcall parseable_file(__int64 a1)
{
if ( !*(_QWORD *)(a1 + 160) )
*(_QWORD *)(a1 + 160) = lookup_mimetype(*(const char **)(a1 + 192));
return *(_QWORD *)(*(_QWORD *)(a1 + 160) + 32LL) == (_QWORD)&lws_handler;
}

original_code:
int
parseable_file(File fc)
{
 if (!fc->mime) fc->mime = lookup_mimetype(fc->name.data);
 return fc->mime->handler == lws_handler;
}

canonical_original_code:
int parseable_file(struct file_cache_struct *fc)
{
 if (!fc->mime) fc->mime = lookup_mimetype(fc->name.data);
 return fc->mime->handler == lws_handler;
}


lFactorial

repo: cthunman/probziez

decompiled_code:
__int64 __fastcall lFactorial(__int64 a1)
{
__int64 result; // rax

if ( !a1 )
return 1LL;
result = 1LL;
do
result *= a1--;
while ( a1 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
__int64 result; // rax

if ( !a1 )
return 1LL;
result = 1LL;
do
result *= a1--;
while ( a1 );
return result;
}

original_code:
unsigned long long lFactorial(unsigned long long x) {
 unsigned long long product;
 product = 1;
 while (x > 0) {
  product *= x;
  --x;
 }
 return product;
}

variable_types:
x
unsigned long long

variable_types:
product
unsigned long long

return_type: unsigned long long


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int *v3; // rbp
int v4; // er14
int v5; // er13
int v6; // er12
int v7; // eax
int v8; // ebx
int v9; // er13

v3 = (int *)malloc(0x10uLL);
readInt(v3, argv);
readInt(v3 + 1, argv);
readInt(v3 + 2, argv);
readInt(v3 + 3, argv);
v4 = v3[1];
v5 = *v3;
nChooseK((double)*v3, (double)v4);
v6 = v3[3];
v7 = (int)ceil((double)v6 / (double)v3[2]);
if ( v6 >= v7 )
{
v8 = v7;
v9 = v5 - v6;
do
{
nChooseK((double)v6, (double)v8);
nChooseK((double)v9, (double)(v4 - v8++));
}
while ( v6 >= v8 );
}
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
free(v3);
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int *v3; // rbp
int v4; // er14
int v5; // er13
int v6; // er12
int v7; // eax
int v8; // ebx
int v9; // er13

v3 = (int *)malloc(0x10uLL);
readInt(v3, argv);
readInt(v3 + 1, argv);
readInt(v3 + 2, argv);
readInt(v3 + 3, argv);
v4 = v3[1];
v5 = *v3;
func3((double)*v3, (double)v4);
v6 = v3[3];
v7 = (int)ceil((double)v6 / (double)v3[2]);
if ( v6 >= v7 )
{
v8 = v7;
v9 = v5 - v6;
do
{
func3((double)v6, (double)v8);
func3((double)v9, (double)(v4 - v8++));
}
while ( v6 >= v8 );
}
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
printf("%lu\n", 8LL);
free(v3);
return 0;
}

original_code:
int main() {
 int count;
 int* inputArray = (int*) malloc(4 * sizeof(int));
 long winsNeeded;
 long possibleWinningCombos = 0;
 long possibleCombos = 0;
 for (count = 0; count < 4; count++) {
  readInt(&inputArray[count]);
 }
 possibleCombos = nChooseK(inputArray[0], inputArray[1]);
 winsNeeded = ceil((double) inputArray[3] / inputArray[2]);
 for (count = winsNeeded; count < inputArray[3] + 1; count++) {
  possibleWinningCombos +=
   (nChooseK(inputArray[3], count) *
    nChooseK(inputArray[0] - inputArray[3], inputArray[1] - count));
 }
 printf("%lu\n", sizeof(double));
 printf("%lu\n", sizeof(unsigned long));
 printf("%lu\n", sizeof(long));
 printf("%lu\n", sizeof(unsigned long long));
 free(inputArray);
}

canonical_original_code:
int main() {
 int count;
 int *inputArray = (int*) malloc(4 * sizeof(int));
 long winsNeeded;
 long possibleWinningCombos = 0;
 long possibleCombos = 0;
 for (count = 0; count < 4; count++) {
  readInt(&inputArray[count]);
 }
 possibleCombos = nChooseK(inputArray[0], inputArray[1]);
 winsNeeded = ceil((double) inputArray[3] / inputArray[2]);
 for (count = winsNeeded; count < inputArray[3] + 1; count++) {
  possibleWinningCombos +=
   (nChooseK(inputArray[3], count) *
    nChooseK(inputArray[0] - inputArray[3], inputArray[1] - count));
 }
 printf("%lu\n", sizeof(double));
 printf("%lu\n", sizeof(unsigned long));
 printf("%lu\n", sizeof(long));
 printf("%lu\n", sizeof(unsigned long long));
 free(inputArray);
}

variable_types: count int

variable_types:
inputArray
int *

variable_types: winsNeeded long

variable_types: possibleWinningCombos long

variable_types: possibleCombos long


repo: ctm/executor

decompiled_code:
__int64 __fastcall read_long(unsigned int *a1)
{
return (int)_byteswap_ulong(*a1);
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int *a1)
{
return (int)_byteswap_ulong(*a1);
}

original_code:
long
read_long (const unsigned char *p)
{
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}

variable_types:
p
unsigned char *

return_type: long


decompiled_code:
__int64 __fastcall read_short(unsigned __int8 *a1)
{
return (*a1 << 8) | (unsigned int)a1[1];
}

canonical_decompiled_code:
__int64 __fastcall func1(unsigned __int8 *a1)
{
return (*a1 << 8) | (unsigned int)a1[1];
}

original_code:
short
read_short (const unsigned char *p)
{
  return (p[0] << 8) | p[1];
}

canonical_original_code:
short read_short(unsigned char *p)
{
  return (p[0] << 8) | p[1];
}

return_type: short


decompiled_code:
_BOOL8 __fastcall call_p(const void *a1)
{
bool v2; // zf
_BOOL4 v3; // ecx

v2 = memcmp(a1, &unk_778, 3uLL) == 0;
v3 = 1;
if ( !v2 )
v3 = memcmp(a1, &unk_77C, 3uLL) == 0;
return v3;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(const void *a1)
{
bool v2; // zf
_BOOL4 v3; // ecx

v2 = memcmp(a1, &unk_778, 3uLL) == 0;
v3 = 1;
if ( !v2 )
v3 = memcmp(a1, &unk_77C, 3uLL) == 0;
return v3;
}

original_code:
static int
call_p (const char *opcode)
{
  return (!strncmp (opcode, "bsr", 3)
   || !strncmp (opcode, "jsr", 3));
}

canonical_original_code:
static int call_p(char *opcode)
{
  return (!strncmp (opcode, "bsr", 3)
   || !strncmp (opcode, "jsr", 3));
}

variable_types:
opcode
char *


decompiled_code:
void *__fastcall add_labels(void *ptr, __int64 a2, int a3)
{
__int64 v4; // r12
_BYTE *v5; // rbx
char **v6; // rbx
__int16 *v7; // rbp
char *v8; // rax
_BYTE *v9; // rbx
__int64 v10; // rbp
char *v11; // rax
size_t v12; // rax
char *v13; // rbp
char *v14; // rbx
char *v15; // rax
const char *v16; // rax
const char *v17; // r14
char *v18; // rbp
char *v19; // rax
size_t v20; // rax
char *v21; // rax
char *v22; // r14
char *v23; // rbp
char *v24; // r13
__int16 *v25; // rdx
char *v26; // rbx
unsigned int j; // ebp
const char *v28; // rax
const char *v29; // rbx
const char *v30; // rdx
size_t v31; // rax
char i; // al
char *v34; // [rsp+8h] [rbp-1060h]
char v35[1024]; // [rsp+10h] [rbp-1058h] BYREF
char src[1024]; // [rsp+410h] [rbp-C58h] BYREF
char v37[1024]; // [rsp+810h] [rbp-858h] BYREF
char v38[1024]; // [rsp+C10h] [rbp-458h] BYREF
char s[88]; // [rsp+1010h] [rbp-58h] BYREF

if ( !ptr )
return 0LL;
if ( !branch_hash_0 )
{
branch_hash_0 = hash_new();
v6 = branches;
do
{
hash_insert(branch_hash_0, *v6, v6[1]);
v6 += 2;
}
while ( v6 != (char **)&unk_D70 );
}
v4 = hash_new();
sprintf(s, "0x%lx", a2);
hash_insert(v4, s, "_main");
if ( *(_BYTE *)ptr )
{
v5 = ptr;
do
{
if ( extract_field(v5, 1LL, v37)
&& hash_lookup(branch_hash_0, v37)
&& extract_field(v5, 2LL, src)
&& extract_branch_target(v37, src)
&& !extract_field(v5, 3LL, v35) )
{
v7 = aFl;
if ( !call_p(v37) )
v7 = &aFl[1];
v8 = extract_branch_target(v37, src);
hash_insert(v4, v8, v7);
}
v5 = next_line(v5);
}
while ( *v5 );
if ( *(_BYTE *)ptr )
{
v9 = ptr;
v10 = 0LL;
do
{
if ( extract_field(v9, 0LL, v38) )
{
v11 = (char *)hash_lookup(v4, v38);
if ( v11 )
{
if ( !v11[1] )
{
sprintf(s, "%c%lu_", (unsigned int)*v11, v10);
hash_remove(v4, v38);
hash_insert(v4, v38, s);
++v10;
}
}
}
v9 = next_line(v9);
}
while ( *v9 );
}
}
v12 = strlen((const char *)ptr);
v34 = (char *)malloc(2 * v12 + 100);
v13 = v34;
v14 = (char *)ptr;
while ( *v14 )
{
if ( extract_field(v14, 1LL, v37)
&& hash_lookup(branch_hash_0, v37)
&& extract_field(v14, 2LL, src)
&& extract_branch_target(v37, src)
&& !extract_field(v14, 3LL, v35)
&& (v15 = extract_branch_target(v37, src), v16 = (const char *)hash_lookup(v4, v15), (v17 = v16) != 0LL)
&& *v16
&& v16[1] )
{
if ( !extract_field(v14, 0LL, v38) )
abort();
sprintf(v13, "%s %s ", v38, v37);
v18 = &v13[strlen(v13)];
if ( src[0] == 100 )
{
strncpy(v18, src, 3uLL);
v18 += 3;
}
strcpy(v18, v17);
v19 = &v18[strlen(v18)];
v13 = v19 + 1;
*v19 = 10;
v14 = next_line(v14);
}
else
{
for ( i = *v14; *v14 != 10 && i; i = *v14 )
{
++v14;
*v13++ = i;
}
if ( i == 10 )
{
++v14;
*v13++ = 10;
}
}
}
*v13 = 0;
free(ptr);
v20 = strlen(v34);
v21 = (char *)malloc(2 * v20 + 100);
v22 = v21;
if ( *v34 )
{
v23 = v21;
v24 = v34;
do
{
if ( !extract_field(v24, 0LL, v38) )
abort();
v28 = (const char *)hash_lookup(v4, v38);
v29 = v28;
if ( v28 )
{
if ( *v28 == 70 )
*v23++ = 10;
if ( a3 )
{
sprintf(v23, "%s\t", v38);
v23 += strlen(v23);
}
sprintf(v23, "%s:", v29);
v26 = &v23[strlen(v23)];
}
else
{
v26 = v23;
if ( a3 )
{
sprintf(v23, "%s\t", v38);
v26 = &v23[strlen(v23)];
}
}
if ( extract_field(v24, 1LL, v37) )
{
v30 = (const char *)hash_lookup(branch_hash_0, v37);
if ( !v30 )
v30 = v37;
sprintf(v26, "\t%s", v30);
v26 += strlen(v26);
}
for ( j = 2; extract_field(v24, j, src); ++j )
{
v25 = &aFl[2];
if ( j != 2 )
v25 = &aFl[3];
sprintf(v26, "%s%s", (const char *)v25, src);
v26 += strlen(v26);
}
v23 = v26 + 1;
*v26 = 10;
v24 = next_line(v24);
}
while ( *v24 );
}
else
{
v23 = v21;
}
*v23 = 0;
free(v34);
hash_free(v4);
v31 = strlen(v22);
return realloc(v22, v31 + 1);
}

canonical_decompiled_code:
void *__fastcall func2(void *ptr, __int64 a2, int a3)
{
__int64 v4; // r12
_BYTE *v5; // rbx
char **v6; // rbx
__int16 *v7; // rbp
char *v8; // rax
_BYTE *v9; // rbx
__int64 v10; // rbp
char *v11; // rax
size_t v12; // rax
char *v13; // rbp
char *v14; // rbx
char *v15; // rax
const char *v16; // rax
const char *v17; // r14
char *v18; // rbp
char *v19; // rax
size_t v20; // rax
char *v21; // rax
char *v22; // r14
char *v23; // rbp
char *v24; // r13
__int16 *v25; // rdx
char *v26; // rbx
unsigned int j; // ebp
const char *v28; // rax
const char *v29; // rbx
const char *v30; // rdx
size_t v31; // rax
char i; // al
char *v34; // [rsp+8h] [rbp-1060h]
char v35[1024]; // [rsp+10h] [rbp-1058h] BYREF
char src[1024]; // [rsp+410h] [rbp-C58h] BYREF
char v37[1024]; // [rsp+810h] [rbp-858h] BYREF
char v38[1024]; // [rsp+C10h] [rbp-458h] BYREF
char s[88]; // [rsp+1010h] [rbp-58h] BYREF

if ( !ptr )
return 0LL;
if ( !branch_hash_0 )
{
branch_hash_0 = hash_new();
v6 = branches;
do
{
hash_insert(branch_hash_0, *v6, v6[1]);
v6 += 2;
}
while ( v6 != (char **)&unk_D70 );
}
v4 = hash_new();
sprintf(s, "0x%lx", a2);
hash_insert(v4, s, "_main");
if ( *(_BYTE *)ptr )
{
v5 = ptr;
do
{
if ( extract_field(v5, 1LL, v37)
&& hash_lookup(branch_hash_0, v37)
&& extract_field(v5, 2LL, src)
&& func1(v37, src)
&& !extract_field(v5, 3LL, v35) )
{
v7 = aFl;
if ( !func0(v37) )
v7 = &aFl[1];
v8 = func1(v37, src);
hash_insert(v4, v8, v7);
}
v5 = next_line(v5);
}
while ( *v5 );
if ( *(_BYTE *)ptr )
{
v9 = ptr;
v10 = 0LL;
do
{
if ( extract_field(v9, 0LL, v38) )
{
v11 = (char *)hash_lookup(v4, v38);
if ( v11 )
{
if ( !v11[1] )
{
sprintf(s, "%c%lu_", (unsigned int)*v11, v10);
hash_remove(v4, v38);
hash_insert(v4, v38, s);
++v10;
}
}
}
v9 = next_line(v9);
}
while ( *v9 );
}
}
v12 = strlen((const char *)ptr);
v34 = (char *)malloc(2 * v12 + 100);
v13 = v34;
v14 = (char *)ptr;
while ( *v14 )
{
if ( extract_field(v14, 1LL, v37)
&& hash_lookup(branch_hash_0, v37)
&& extract_field(v14, 2LL, src)
&& func1(v37, src)
&& !extract_field(v14, 3LL, v35)
&& (v15 = func1(v37, src), v16 = (const char *)hash_lookup(v4, v15), (v17 = v16) != 0LL)
&& *v16
&& v16[1] )
{
if ( !extract_field(v14, 0LL, v38) )
abort();
sprintf(v13, "%s %s ", v38, v37);
v18 = &v13[strlen(v13)];
if ( src[0] == 100 )
{
strncpy(v18, src, 3uLL);
v18 += 3;
}
strcpy(v18, v17);
v19 = &v18[strlen(v18)];
v13 = v19 + 1;
*v19 = 10;
v14 = next_line(v14);
}
else
{
for ( i = *v14; *v14 != 10 && i; i = *v14 )
{
++v14;
*v13++ = i;
}
if ( i == 10 )
{
++v14;
*v13++ = 10;
}
}
}
*v13 = 0;
free(ptr);
v20 = strlen(v34);
v21 = (char *)malloc(2 * v20 + 100);
v22 = v21;
if ( *v34 )
{
v23 = v21;
v24 = v34;
do
{
if ( !extract_field(v24, 0LL, v38) )
abort();
v28 = (const char *)hash_lookup(v4, v38);
v29 = v28;
if ( v28 )
{
if ( *v28 == 70 )
*v23++ = 10;
if ( a3 )
{
sprintf(v23, "%s\t", v38);
v23 += strlen(v23);
}
sprintf(v23, "%s:", v29);
v26 = &v23[strlen(v23)];
}
else
{
v26 = v23;
if ( a3 )
{
sprintf(v23, "%s\t", v38);
v26 = &v23[strlen(v23)];
}
}
if ( extract_field(v24, 1LL, v37) )
{
v30 = (const char *)hash_lookup(branch_hash_0, v37);
if ( !v30 )
v30 = v37;
sprintf(v26, "\t%s", v30);
v26 += strlen(v26);
}
for ( j = 2; extract_field(v24, j, src); ++j )
{
v25 = &aFl[2];
if ( j != 2 )
v25 = &aFl[3];
sprintf(v26, "%s%s", (const char *)v25, src);
v26 += strlen(v26);
}
v23 = v26 + 1;
*v26 = 10;
v24 = next_line(v24);
}
while ( *v24 );
}
else
{
v23 = v21;
}
*v23 = 0;
free(v34);
hash_free(v4);
v31 = strlen(v22);
return realloc(v22, v31 + 1);
}

original_code:
char *
add_labels (char *code, unsigned long entry_point, int keep_addrs_p)
{
  static hash_table_t *branch_hash = ((void *)0);
  char *s, *d, *new, *final, buf[32];
  hash_table_t *label_hash;
  unsigned long label_num;
  char addr[1024], opcode[1024], operand[1024], junk[1024];
  const char *label;
  if (code == ((void *)0))
    return ((void *)0);
  if (branch_hash == ((void *)0))
    {
      int i;
      branch_hash = hash_new ();
      for (i = 0; i < sizeof branches / sizeof branches[0]; i++)
 hash_insert (branch_hash, branches[i].orig_name,
       branches[i].canon_name);
    }
  label_hash = hash_new ();
  sprintf (buf, "0x%lx", entry_point);
  hash_insert (label_hash, buf, "_main");
  for (s = code; *s != '\0'; s = next_line (s))
    {
      if (extract_field (s, 1, opcode)
   && hash_lookup (branch_hash, opcode)
   && extract_field (s, 2, operand)
   && extract_branch_target (opcode, operand)
   && !extract_field (s, 3, junk))
 {
   hash_insert (label_hash, extract_branch_target (opcode, operand),
         call_p (opcode) ? "F" : "L");
 }
    }
  for (s = code, label_num = 0; *s != '\0'; s = next_line (s))
    {
      if (extract_field (s, 0, addr))
 {
   const char *s = hash_lookup (label_hash, addr);
   if (s != ((void *)0) && s[1] == '\0')
     {
       sprintf (buf, "%c%lu_", s[0], label_num++);
       hash_remove (label_hash, addr);
       hash_insert (label_hash, addr, buf);
     }
 }
    }
  new = (char *)malloc (100 + strlen (code) * 2);
  for (s = code, d = new; *s != '\0'; )
    {
      int changed_p;
      changed_p = 0;
      if (extract_field (s, 1, opcode)
   && hash_lookup (branch_hash, opcode)
   && extract_field (s, 2, operand)
   && extract_branch_target (opcode, operand)
   && !extract_field (s, 3, junk))
 {
   label = hash_lookup (label_hash,
          extract_branch_target (opcode, operand));
   if (label != ((void *)0) && label[0] != '\0' && label[1] != '\0')
     {
       if (!extract_field (s, 0, addr))
  abort ();
       sprintf (d, "%s %s ", addr, opcode);
       d += strlen (d);
       if (operand[0] == 'd')
  {
    strncpy (d, operand, 3);
    d += 3;
  }
       strcpy (d, label);
       d += strlen (d);
       *d++ = '\n';
       s = next_line (s);
       changed_p = 1;
     }
 }
      if (!changed_p)
 {
   while (*s != '\n' && *s != '\0')
     *d++ = *s++;
   if (*s == '\n')
     *d++ = *s++;
 }
    }
  *d = '\0';
  free (code);
  final = (char *)malloc (100 + strlen (new) * 2);
  for (s = new, d = final; *s != '\0'; s = next_line (s))
    {
      int f;
      if (!extract_field (s, 0, addr))
 abort ();
      label = hash_lookup (label_hash, addr);
      if (label != ((void *)0) && label[0] == 'F')
 *d++ = '\n';
      if (keep_addrs_p)
 {
   sprintf (d, "%s\t", addr);
   d += strlen (d);
 }
      if (label != ((void *)0))
 {
   sprintf (d, "%s:", label);
   d += strlen (d);
 }
      if (extract_field (s, 1, opcode))
 {
   const char *canon_opcode;
   canon_opcode = hash_lookup (branch_hash, opcode);
   sprintf (d, "\t%s", canon_opcode ? canon_opcode : opcode);
   d += strlen (d);
 }
      for (f = 2; extract_field (s, f, operand); f++)
 {
   sprintf (d, "%s%s", (f == 2) ? "\t" : " ", operand);
   d += strlen (d);
 }
      *d++ = '\n';
    }
  *d = '\0';
  free (new);
  hash_free (label_hash);
  return (char *)realloc (final, strlen (final) + 1);
}

canonical_original_code:
char *add_labels(char *code, unsigned long entry_point, int keep_addrs_p)
{
  static struct hash_table_t *branch_hash = ((void *)0);
  char *s; char *d; char *new; char *final; char buf[32];
  struct hash_table_t *label_hash;
  unsigned long label_num;
  char addr[1024]; char opcode[1024]; char operand[1024]; char junk[1024];
  char *label;
  if (code == ((void *)0))
    return ((void *)0);
  if (branch_hash == ((void *)0))
    {
      int i;
      branch_hash = hash_new ();
      for (i = 0; i < sizeof branches / sizeof branches[0]; i++)
 hash_insert (branch_hash, branches[i].orig_name,
       branches[i].canon_name);
    }
  label_hash = hash_new ();
  sprintf (buf, "0x%lx", entry_point);
  hash_insert (label_hash, buf, "_main");
  for (s = code; *s != '\0'; s = next_line (s))
    {
      if (extract_field (s, 1, opcode)
   && hash_lookup (branch_hash, opcode)
   && extract_field (s, 2, operand)
   && extract_branch_target (opcode, operand)
   && !extract_field (s, 3, junk))
 {
   hash_insert (label_hash, extract_branch_target (opcode, operand),
         call_p (opcode) ? "F" : "L");
 }
    }
  for (s = code, label_num = 0; *s != '\0'; s = next_line (s))
    {
      if (extract_field (s, 0, addr))
 {
   char *s = hash_lookup (label_hash, addr);
   if (s != ((void *)0) && s[1] == '\0')
     {
       sprintf (buf, "%c%lu_", s[0], label_num++);
       hash_remove (label_hash, addr);
       hash_insert (label_hash, addr, buf);
     }
 }
    }
  new = (char *)malloc (100 + strlen (code) * 2);
  for (s = code, d = new; *s != '\0'; )
    {
      int changed_p;
      changed_p = 0;
      if (extract_field (s, 1, opcode)
   && hash_lookup (branch_hash, opcode)
   && extract_field (s, 2, operand)
   && extract_branch_target (opcode, operand)
   && !extract_field (s, 3, junk))
 {
   label = hash_lookup (label_hash,
          extract_branch_target (opcode, operand));
   if (label != ((void *)0) && label[0] != '\0' && label[1] != '\0')
     {
       if (!extract_field (s, 0, addr))
  abort ();
       sprintf (d, "%s %s ", addr, opcode);
       d += strlen (d);
       if (operand[0] == 'd')
  {
    strncpy (d, operand, 3);
    d += 3;
  }
       strcpy (d, label);
       d += strlen (d);
       *d++ = '\n';
       s = next_line (s);
       changed_p = 1;
     }
 }
      if (!changed_p)
 {
   while (*s != '\n' && *s != '\0')
     *d++ = *s++;
   if (*s == '\n')
     *d++ = *s++;
 }
    }
  *d = '\0';
  free (code);
  final = (char *)malloc (100 + strlen (new) * 2);
  for (s = new, d = final; *s != '\0'; s = next_line (s))
    {
      int f;
      if (!extract_field (s, 0, addr))
 abort ();
      label = hash_lookup (label_hash, addr);
      if (label != ((void *)0) && label[0] == 'F')
 *d++ = '\n';
      if (keep_addrs_p)
 {
   sprintf (d, "%s\t", addr);
   d += strlen (d);
 }
      if (label != ((void *)0))
 {
   sprintf (d, "%s:", label);
   d += strlen (d);
 }
      if (extract_field (s, 1, opcode))
 {
   char *canon_opcode;
   canon_opcode = hash_lookup (branch_hash, opcode);
   sprintf (d, "\t%s", canon_opcode ? canon_opcode : opcode);
   d += strlen (d);
 }
      for (f = 2; extract_field (s, f, operand); f++)
 {
   sprintf (d, "%s%s", (f == 2) ? "\t" : " ", operand);
   d += strlen (d);
 }
      *d++ = '\n';
    }
  *d = '\0';
  free (new);
  hash_free (label_hash);
  return (char *)realloc (final, strlen (final) + 1);
}

variable_types:
code
char *

variable_types: struct hash_table_t { struct _hash_elt_t { struct _hash_elt_t *next; char *key; char *value; } *bucket[-1]; } *

variable_types:
s
char *

variable_types:
d
char *

variable_types:
new
char *

variable_types:
final
char *

variable_types:
buf
char [32]

variable_types:
addr
char [1024]

variable_types:
opcode
char [1024]

variable_types:
operand
char [1024]

variable_types:
junk
char [1024]

variable_types:
label
char *

variable_types: i int

variable_types: f int

return_type: char *

user_defined_types: struct hash_table_t { struct _hash_elt_t *bucket[-1]; }


hash

original_code:
static inline unsigned
hash (const char *s)
{
  unsigned n;
  for (n = 0; *s; s++)
    n = (n * 33) + *s;
  return n % (1UL << 11);
}

canonical_original_code:
static inline unsigned int hash(char *s)
{
  unsigned int n;
  for (n = 0; *s; s++)
    n = (n * 33) + *s;
  return n % (1UL << 11);
}

variable_types:
n
unsigned int

return_type: unsigned int


decompiled_code:
void *hash_new()
{
void *v0; // rax

v0 = malloc(0x4000uLL);
return memset(v0, 0, 0x4000uLL);
}

canonical_decompiled_code:
void *func1()
{
void *v0; // rax

v0 = malloc(0x4000uLL);
return memset(v0, 0, 0x4000uLL);
}

original_code:
hash_table_t *
hash_new ()
{
  hash_table_t *h;
  h = (hash_table_t *)malloc (sizeof *h);
  memset (h, 0, sizeof *h);
  return h;
}

canonical_original_code:
struct hash_table_t *hash_new()
{
  struct hash_table_t *h;
  h = (struct hash_table_t *)malloc (sizeof *h);
  memset (h, 0, sizeof *h);
  return h;
}

return_type: struct hash_table_t { struct _hash_elt_t { struct _hash_elt_t *next; char *key; char *value; } *bucket[-1]; } *


decompiled_code:
void __fastcall hash_free(void *ptr)
{
void ***v1; // r12
void **v2; // rbx
void **v3; // rbp

v1 = (void ***)ptr;
do
{
v2 = *v1;
while ( v2 )
{
v3 = v2;
v2 = (void **)*v2;
free(v3[1]);
free(v3[2]);
free(v3);
}
++v1;
}
while ( v1 != (void ***)((char *)ptr + 0x4000) );
free(ptr);
}

canonical_decompiled_code:
void __fastcall func2(void *ptr)
{
void ***v1; // r12
void **v2; // rbx
void **v3; // rbp

v1 = (void ***)ptr;
do
{
v2 = *v1;
while ( v2 )
{
v3 = v2;
v2 = (void **)*v2;
free(v3[1]);
free(v3[2]);
free(v3);
}
++v1;
}
while ( v1 != (void ***)((char *)ptr + 0x4000) );
free(ptr);
}

original_code:
void
hash_free (hash_table_t *h)
{
  hash_elt_t *e, *next;
  int i;
  for (i = 0; i < (1UL << 11); i++)
    {
      for (e = h->bucket[i]; e != ((void *)0); e = next)
 {
   next = e->next;
   free (e->key);
   free (e->value);
   free (e);
 }
    }
  free (h);
}

canonical_original_code:
void hash_free(struct hash_table_t *h)
{
  struct _hash_elt_t *e; struct _hash_elt_t *next;
  int i;
  for (i = 0; i < (1UL << 11); i++)
    {
      for (e = h->bucket[i]; e != ((void *)0); e = next)
 {
   next = e->next;
   free (e->key);
   free (e->value);
   free (e);
 }
    }
  free (h);
}

variable_types: struct _hash_elt_t { struct _hash_elt_t *next; char *key; char *value; } *


decompiled_code:
void __fastcall hash_remove(__int64 a1, char *a2)
{
_QWORD **v2; // r13
_QWORD *v3; // rbx
char *v4; // rbp
_QWORD *v5; // rdi

v2 = (_QWORD **)(a1 + 8LL * (unsigned int)hash(a2));
v3 = *v2;
if ( *v2 )
{
while ( 1 )
{
v4 = (char *)v3[1];
if ( !strcmp(v4, a2) )
break;
v2 = (_QWORD **)v3;
v3 = (_QWORD *)*v3;
if ( !v3 )
goto LABEL_4;
}
free(v4);
free((void *)(*v2)[2]);
v5 = *v2;
*v2 = (_QWORD *)**v2;
free(v5);
}
else
{
LABEL_4:
fwrite("Failed to remove elt from hash table!\n", 1uLL, 0x26uLL, stderr);
}
}

canonical_decompiled_code:
void __fastcall func3(__int64 a1, char *a2)
{
_QWORD **v2; // r13
_QWORD *v3; // rbx
char *v4; // rbp
_QWORD *v5; // rdi

v2 = (_QWORD **)(a1 + 8LL * (unsigned int)func0(a2));
v3 = *v2;
if ( *v2 )
{
while ( 1 )
{
v4 = (char *)v3[1];
if ( !strcmp(v4, a2) )
break;
v2 = (_QWORD **)v3;
v3 = (_QWORD *)*v3;
if ( !v3 )
goto LABEL_4;
}
free(v4);
free((void *)(*v2)[2]);
v5 = *v2;
*v2 = (_QWORD *)**v2;
free(v5);
}
else
{
LABEL_4:
fwrite("Failed to remove elt from hash table!\n", 1uLL, 0x26uLL, stderr);
}
}

original_code:
void
hash_remove (hash_table_t *h, const char *key)
{
  hash_elt_t **e;
  for (e = &h->bucket[hash (key)]; (*e) != ((void *)0); e = &(*e)->next)
    {
      if (!strcmp ((*e)->key, key))
 {
   hash_elt_t *old;
   free ((*e)->key);
   free ((*e)->value);
   old = *e;
   *e = (*e)->next;
   free (old);
   return;
 }
    }
  fprintf (stderr, "Failed to remove elt from hash table!\n");
}

canonical_original_code:
void hash_remove(struct hash_table_t *h, char *key)
{
  struct _hash_elt_t **e;
  for (e = &h->bucket[hash (key)]; (*e) != ((void *)0); e = &(*e)->next)
    {
      if (!strcmp ((*e)->key, key))
 {
   struct _hash_elt_t *old;
   free ((*e)->key);
   free ((*e)->value);
   old = *e;
   *e = (*e)->next;
   free (old);
   return;
 }
    }
  fprintf (stderr, "Failed to remove elt from hash table!\n");
}

variable_types:
key
char *

variable_types: struct _hash_elt_t { struct _hash_elt_t *next; char *key; char *value; } **


repo: cugfeng/Browser

original_code:
NPError
NPP_SetWindow(NPP instance, NPWindow* window) {
  InstanceData* instanceData = (InstanceData*)(instance->pdata);
  instanceData->window = *window;
  return (0 + 0);
}

canonical_original_code:
short NPP_SetWindow(struct _NPP *instance, struct _NPWindow *window) {
  struct InstanceData *instanceData = (InstanceData*)(instance->pdata);
  instanceData->window = *window;
  return (0 + 0);
}

variable_types: struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; } clipRect; void *ws_info; enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 } type; } *

variable_types: struct InstanceData { struct _NPP { void *pdata; void *ndata; } *npp; struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; } clipRect; void *ws_info; enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 } type; } window; } *

user_defined_types: struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect clipRect; void *ws_info; enum NPWindowType type; }

user_defined_types: struct InstanceData { struct _NPP *npp; struct _NPWindow window; }


decompiled_code:
__int64 NPP_NewStream()
{
return 1LL;
}

canonical_decompiled_code:
__int64 func7()
{
return 1LL;
}

original_code:
NPError
NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) {
  return (0 + 1);
}

canonical_original_code:
short NPP_NewStream(struct _NPP *instance, char *type, struct _NPStream *stream, unsigned char seekable, unsigned short *stype) {
  return (0 + 1);
}

variable_types: struct _NPP { void *pdata; void *ndata; } *

variable_types:
type
char *

variable_types: struct _NPStream { void *pdata; void *ndata; char *url; unsigned int end; unsigned int lastmodified; void *notifyData; char *headers; } *

variable_types:
seekable
unsigned char

variable_types:
stype
unsigned short *


decompiled_code:
__int64 NPP_DestroyStream()
{
return 1LL;
}

canonical_decompiled_code:
__int64 func8()
{
return 1LL;
}

original_code:
NPError
NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) {
  return (0 + 1);
}

canonical_original_code:
short NPP_DestroyStream(struct _NPP *instance, struct _NPStream *stream, short reason) {
  return (0 + 1);
}

variable_types: reason short

user_defined_types: struct _NPP { void *pdata; void *ndata; }

user_defined_types: struct _NPStream { void *pdata; void *ndata; char *url; unsigned int end; unsigned int lastmodified; void *notifyData; char *headers; }


decompiled_code:
__int64 NPP_WriteReady()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func9()
{
return 0LL;
}

original_code:
int32_t
NPP_WriteReady(NPP instance, NPStream* stream) {
  return 0;
}

canonical_original_code:
int NPP_WriteReady(struct _NPP *instance, struct _NPStream *stream) {
  return 0;
}


decompiled_code:
__int64 NPP_Write()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func10()
{
return 0LL;
}

original_code:
int32_t
NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) {
  return 0;
}

canonical_original_code:
int NPP_Write(struct _NPP *instance, struct _NPStream *stream, int offset, int len, void *buffer) {
  return 0;
}

variable_types: offset int

variable_types: len int

variable_types:
buffer
void *


decompiled_code:
void NPP_StreamAsFile()
{
;
}

canonical_decompiled_code:
void func11()
{
;
}

original_code:
void
NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) {
}

canonical_original_code:
void NPP_StreamAsFile(struct _NPP *instance, struct _NPStream *stream, char *fname) {
}

variable_types:
fname
char *


decompiled_code:
void NPP_Print()
{
;
}

canonical_decompiled_code:
void func12()
{
;
}

original_code:
void
NPP_Print(NPP instance, NPPrint* platformPrint) {
}

canonical_original_code:
void NPP_Print(struct _NPP *instance, struct _NPPrint *platformPrint) {
}

variable_types: struct _NPPrint { unsigned short mode; union { struct _NPFullPrint { unsigned char pluginPrinted; unsigned char printOne; void *platformPrint; } fullPrint; struct _NPEmbedPrint { struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; } clipRect; void *ws_info; enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 } type; } window; void *platformPrint; } embedPrint; } print; } *

user_defined_types: struct _NPPrint { unsigned short mode; union { struct _NPFullPrint fullPrint; struct _NPEmbedPrint embedPrint; } print; }

user_defined_types: struct _NPEmbedPrint { struct _NPWindow window; void *platformPrint; }


decompiled_code:
void NPP_URLNotify()
{
;
}

canonical_decompiled_code:
void func13()
{
;
}

original_code:
void
NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData) {
}

canonical_original_code:
void NPP_URLNotify(struct _NPP *instance, char *URL, short reason, void *notifyData) {
}

variable_types:
URL
char *

variable_types:
notifyData
void *


decompiled_code:
__int64 NPP_SetValue()
{
return 1LL;
}

canonical_decompiled_code:
__int64 func15()
{
return 1LL;
}

original_code:
NPError
NPP_SetValue(NPP instance, NPNVariable variable, void *value) {
  return (0 + 1);
}

canonical_original_code:
short NPP_SetValue(struct _NPP *instance, enum NPNVariable variable, void *value) {
  return (0 + 1);
}

variable_types: enum NPNVariable { NPNVxDisplay=1, NPNVxtAppContext=2, NPNVnetscapeWindow=3, NPNVjavascriptEnabledBool=4, NPNVasdEnabledBool=5, NPNVisOfflineBool=6, NPNVserviceManager=expr, NPNVDOMElement=expr, NPNVDOMWindow=expr, NPNVToolkit=expr, NPNVSupportsXEmbedBool=14, NPNVWindowNPObject=15, NPNVPluginElementNPObject=16, NPNVSupportsWindowless=17, NPNVprivateModeBool=18, NPNVsupportsAdvancedKeyHandling=21, NPNVdocumentOrigin=22, NPNVpluginDrawingModel=1000, NPNVsupportsAsyncBitmapSurfaceBool=2007 }

variable_types:
value
void *


decompiled_code:
__int64 __fastcall NPP_New(__int64 a1, _QWORD *a2)
{
_QWORD *v2; // rax
__int64 result; // rax
char v4[9]; // [rsp+Fh] [rbp-9h] BYREF

v4[0] = 0;
(*(void (__fastcall **)(_QWORD *, __int64, char *))(sBrowserFuncs + 136))(a2, 17LL, v4);
if ( v4[0] )
{
(*(void (__fastcall **)(_QWORD *, __int64, _QWORD))(sBrowserFuncs + 144))(a2, 3LL, 0LL);
v2 = malloc(0x38uLL);
if ( v2 )
{
v2[1] = 0LL;
v2[2] = 0LL;
v2[3] = 0LL;
v2[4] = 0LL;
v2[5] = 0LL;
v2[6] = 0LL;
*v2 = a2;
*a2 = v2;
result = 0LL;
}
else
{
result = 5LL;
}
}
else
{
puts("Windowless mode not supported by the browser");
result = 1LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func16(__int64 a1, _QWORD *a2)
{
_QWORD *v2; // rax
__int64 result; // rax
char v4[9]; // [rsp+Fh] [rbp-9h] BYREF

v4[0] = 0;
(*(void (__fastcall **)(_QWORD *, __int64, char *))(sBrowserFuncs + 136))(a2, 17LL, v4);
if ( v4[0] )
{
(*(void (__fastcall **)(_QWORD *, __int64, _QWORD))(sBrowserFuncs + 144))(a2, 3LL, 0LL);
v2 = malloc(0x38uLL);
if ( v2 )
{
v2[1] = 0LL;
v2[2] = 0LL;
v2[3] = 0LL;
v2[4] = 0LL;
v2[5] = 0LL;
v2[6] = 0LL;
*v2 = a2;
*a2 = v2;
result = 0LL;
}
else
{
result = 5LL;
}
}
else
{
puts("Windowless mode not supported by the browser");
result = 1LL;
}
return result;
}

original_code:
NPError
NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
  NPBool browserSupportsWindowless = 0;
  sBrowserFuncs->getvalue(instance, NPNVSupportsWindowless, &browserSupportsWindowless);
  if (!browserSupportsWindowless) {
    printf("Windowless mode not supported by the browser\n");
    return (0 + 1);
  }
  sBrowserFuncs->setvalue(instance, NPPVpluginWindowBool, (void*)0);
  InstanceData* instanceData = (InstanceData*)malloc(sizeof(InstanceData));
  if (!instanceData)
    return (0 + 5);
  memset(instanceData, 0, sizeof(InstanceData));
  instanceData->npp = instance;
  instance->pdata = instanceData;
  return (0 + 0);
}

canonical_original_code:
short NPP_New(char *pluginType, struct _NPP *instance, unsigned short mode, short argc, char *argn[], char *argv[], struct _NPSavedData *saved) {
  unsigned char browserSupportsWindowless = 0;
  sBrowserFuncs->getvalue(instance, NPNVSupportsWindowless, &browserSupportsWindowless);
  if (!browserSupportsWindowless) {
    printf("Windowless mode not supported by the browser\n");
    return (0 + 1);
  }
  sBrowserFuncs->setvalue(instance, NPPVpluginWindowBool, (void *)0);
  struct InstanceData *instanceData = (InstanceData*)malloc(sizeof(InstanceData));
  if (!instanceData)
    return (0 + 5);
  memset(instanceData, 0, sizeof(InstanceData));
  instanceData->npp = instance;
  instance->pdata = instanceData;
  return (0 + 0);
}

variable_types:
pluginType
char *

variable_types:
mode
unsigned short

variable_types: argc short

variable_types:
argn
char *[]

variable_types:
argv
char *[]

variable_types: struct _NPSavedData { int len; void *buf; } *

variable_types:
browserSupportsWindowless
unsigned char

user_defined_types: struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; }

user_defined_types: enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 }


decompiled_code:
__int64 __fastcall NPP_Destroy(void **a1)
{
free(*a1);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func17(void **a1)
{
free(*a1);
return 0LL;
}

original_code:
NPError
NPP_Destroy(NPP instance, NPSavedData** save) {
  InstanceData* instanceData = (InstanceData*)(instance->pdata);
  free(instanceData);
  return (0 + 0);
}

canonical_original_code:
short NPP_Destroy(struct _NPP *instance, struct _NPSavedData **save) {
  struct InstanceData *instanceData = (InstanceData*)(instance->pdata);
  free(instanceData);
  return (0 + 0);
}

variable_types: struct _NPSavedData { int len; void *buf; } **

variable_types: struct InstanceData { struct _NPP { void *pdata; void *ndata; } *npp; struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; } clipRect; void *ws_info; enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 } type; } window; } *


decompiled_code:
__int64 __fastcall NP_Initialize(__int64 a1, _QWORD *a2)
{
sBrowserFuncs = a1;
a2[1] = NPP_New;
a2[2] = NPP_Destroy;
a2[3] = NPP_SetWindow;
a2[4] = NPP_NewStream;
a2[5] = NPP_DestroyStream;
a2[6] = NPP_StreamAsFile;
a2[7] = NPP_WriteReady;
a2[8] = NPP_Write;
a2[9] = NPP_Print;
a2[11] = NPP_URLNotify;
a2[13] = NPP_GetValue;
a2[14] = NPP_SetValue;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func18(__int64 a1, _QWORD *a2)
{
sBrowserFuncs = a1;
a2[1] = NPP_New;
a2[2] = NPP_Destroy;
a2[3] = NPP_SetWindow;
a2[4] = NPP_NewStream;
a2[5] = NPP_DestroyStream;
a2[6] = NPP_StreamAsFile;
a2[7] = NPP_WriteReady;
a2[8] = NPP_Write;
a2[9] = NPP_Print;
a2[11] = NPP_URLNotify;
a2[13] = NPP_GetValue;
a2[14] = NPP_SetValue;
return 0LL;
}

original_code:
__attribute__((visibility("default"))) NPError
NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
{
  sBrowserFuncs = bFuncs;
  pFuncs->newp = NPP_New;
  pFuncs->destroy = NPP_Destroy;
  pFuncs->setwindow = NPP_SetWindow;
  pFuncs->newstream = NPP_NewStream;
  pFuncs->destroystream = NPP_DestroyStream;
  pFuncs->asfile = NPP_StreamAsFile;
  pFuncs->writeready = NPP_WriteReady;
  pFuncs->write = NPP_Write;
  pFuncs->print = NPP_Print;
  pFuncs->urlnotify = NPP_URLNotify;
  pFuncs->getvalue = NPP_GetValue;
  pFuncs->setvalue = NPP_SetValue;
  return (0 + 0);
}

canonical_original_code:
short NP_Initialize(struct _NPNetscapeFuncs *bFuncs, struct _NPPluginFuncs *pFuncs)
{
  sBrowserFuncs = bFuncs;
  pFuncs->newp = NPP_New;
  pFuncs->destroy = NPP_Destroy;
  pFuncs->setwindow = NPP_SetWindow;
  pFuncs->newstream = NPP_NewStream;
  pFuncs->destroystream = NPP_DestroyStream;
  pFuncs->asfile = NPP_StreamAsFile;
  pFuncs->writeready = NPP_WriteReady;
  pFuncs->write = NPP_Write;
  pFuncs->print = NPP_Print;
  pFuncs->urlnotify = NPP_URLNotify;
  pFuncs->getvalue = NPP_GetValue;
  pFuncs->setvalue = NPP_SetValue;
  return (0 + 0);
}

variable_types: struct _NPNetscapeFuncs { unsigned short size; unsigned short version; short (*geturl)(struct _NPP { void *pdata; void *ndata; } *instance, char *url, char *window); short (*posturl)(struct _NPP *instance, char *url, char *window, unsigned int len, char *buf, unsigned char file); short (*requestread)(struct _NPStream { void *pdata; void *ndata; char *url; unsigned int end; unsigned int lastmodified; void *notifyData; char *headers; } *stream, struct _NPByteRange { int offset; unsigned int length; struct _NPByteRange *next; } *rangeList); short (*newstream)(struct _NPP *instance, char *type, char *window, struct _NPStream **stream); int (*write)(struct _NPP *instance, struct _NPStream *stream, int len, void *buffer); short (*destroystream)(struct _NPP *instance, struct _NPStream *stream, short reason); void (*status)(struct _NPP *instance, char *message); char *(*uagent)(struct _NPP *instance); void *(*memalloc)(unsigned int size); void (*memfree)(void *ptr); unsigned int (*memflush)(unsigned int size); void (*reloadplugins)(unsigned char reloadPages); void *(*getJavaEnv)(); void *(*getJavaPeer)(struct _NPP *instance); short (*geturlnotify)(struct _NPP *instance, char *url, char *window, void *notifyData); short (*posturlnotify)(struct _NPP *instance, char *url, char *window, unsigned int len, char *buf, unsigned char file, void *notifyData); short (*getvalue)(struct _NPP *instance, enum NPNVariable { NPNVxDisplay=1, NPNVxtAppContext=2, NPNVnetscapeWindow=3, NPNVjavascriptEnabledBool=4, NPNVasdEnabledBool=5, NPNVisOfflineBool=6, NPNVserviceManager=expr, NPNVDOMElement=expr, NPNVDOMWindow=expr, NPNVToolkit=expr, NPNVSupportsXEmbedBool=14, NPNVWindowNPObject=15, NPNVPluginElementNPObject=16, NPNVSupportsWindowless=17, NPNVprivateModeBool=18, NPNVsupportsAdvancedKeyHandling=21, NPNVdocumentOrigin=22, NPNVpluginDrawingModel=1000, NPNVsupportsAsyncBitmapSurfaceBool=2007 } variable, void *ret_value); short (*setvalue)(struct _NPP *instance, enum NPPVariable { NPPVpluginNameString=1, NPPVpluginDescriptionString=2, NPPVpluginWindowBool=3, NPPVpluginTransparentBool=4, NPPVjavaClass=5, NPPVpluginWindowSize=6, NPPVpluginTimerInterval=7, NPPVpluginScriptableInstance=expr, NPPVpluginScriptableIID=11, NPPVjavascriptPushCallerBool=12, NPPVpluginKeepLibraryInMemory=13, NPPVpluginNeedsXEmbed=14, NPPVpluginScriptableNPObject=15, NPPVformValue=16, NPPVpluginUrlRequestsDisplayedBool=17, NPPVpluginWantsAllNetworkStreams=18, NPPVpluginNativeAccessibleAtkPlugId=19, NPPVpluginCancelSrcStream=20, NPPVsupportsAdvancedKeyHandling=21, NPPVpluginUsesDOMForCursorBool=22, NPPVpluginDrawingModel=1000 } variable, void *value); void (*invalidaterect)(struct _NPP *instance, struct _NPRect { unsigned short top; unsigned short left; unsigned short bottom; unsigned short right; } *rect); void (*invalidateregion)(struct _NPP *instance, void *region); void (*forceredraw)(struct _NPP *instance); void *(*getstringidentifier)(char *name); void (*getstringidentifiers)(char **names, int nameCount, void **identifiers); void *(*getintidentifier)(int intid); _Bool (*identifierisstring)(void *identifier); char *(*utf8fromidentifier)(void *identifier); int (*intfromidentifier)(void *identifier); struct NPObject { struct NPClass { unsigned int structVersion; struct NPObject *(*allocate)(struct _NPP *npp, struct NPClass *aClass); void (*deallocate)(struct NPObject *npobj); void (*invalidate)(struct NPObject *npobj); _Bool (*hasMethod)(struct NPObject *npobj, void *name); _Bool (*invoke)(struct NPObject *npobj, void *name, struct _NPVariant { enum NPVariantType { NPVariantType_Void=0, NPVariantType_Null=1, NPVariantType_Bool=2, NPVariantType_Int32=3, NPVariantType_Double=4, NPVariantType_String=5, NPVariantType_Object=6 } type; union { _Bool boolValue; int intValue; double doubleValue; struct _NPString { char *UTF8Characters; unsigned int UTF8Length; } stringValue; struct NPObject *objectValue; } value; } *args, unsigned int argCount, struct _NPVariant *result); _Bool (*invokeDefault)(struct NPObject *npobj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*hasProperty)(struct NPObject *npobj, void *name); _Bool (*getProperty)(struct NPObject *npobj, void *name, struct _NPVariant *result); _Bool (*setProperty)(struct NPObject *npobj, void *name, struct _NPVariant *value); _Bool (*removeProperty)(struct NPObject *npobj, void *name); _Bool (*enumerate)(struct NPObject *npobj, void ***value, unsigned int *count); _Bool (*construct)(struct NPObject *npobj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); } *_class; unsigned int referenceCount; } *(*createobject)(struct _NPP *npp, struct NPClass *aClass); struct NPObject *(*retainobject)(struct NPObject *obj); void (*releaseobject)(struct NPObject *obj); _Bool (*invoke)(struct _NPP *npp, struct NPObject *obj, void *methodName, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*invokeDefault)(struct _NPP *npp, struct NPObject *obj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*evaluate)(struct _NPP *npp, struct NPObject *obj, struct _NPString *script, struct _NPVariant *result); _Bool (*getproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName, struct _NPVariant *result); _Bool (*setproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName, struct _NPVariant *value); _Bool (*removeproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName); _Bool (*hasproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName); _Bool (*hasmethod)(struct _NPP *npp, struct NPObject *obj, void *propertyName); void (*releasevariantvalue)(struct _NPVariant *variant); void (*setexception)(struct NPObject *obj, char *message); void (*pushpopupsenabledstate)(struct _NPP *npp, unsigned char enabled); void (*poppopupsenabledstate)(struct _NPP *npp); _Bool (*enumerate)(struct _NPP *npp, struct NPObject *obj, void ***identifier, unsigned int *count); void (*pluginthreadasynccall)(struct _NPP *instance, void (*func)(void *), void *userData); _Bool (*construct)(struct _NPP *npp, struct NPObject *obj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); short (*getvalueforurl)(struct _NPP *npp, enum NPNURLVariable { NPNURLVCookie=501, NPNURLVProxy=502 } variable, char *url, char **value, unsigned int *len); short (*setvalueforurl)(struct _NPP *npp, enum NPNURLVariable { NPNURLVCookie=501, NPNURLVProxy=502 } variable, char *url, char *value, unsigned int len); short (*getauthenticationinfo)(struct _NPP *npp, char *protocol, char *host, int port, char *scheme, char *realm, char **username, unsigned int *ulen, char **password, unsigned int *plen); unsigned int (*scheduletimer)(struct _NPP *instance, unsigned int interval, unsigned char repeat, void (*timerFunc)(struct _NPP *npp, unsigned int timerID)); void (*unscheduletimer)(struct _NPP *instance, unsigned int timerID); short (*popupcontextmenu)(struct _NPP *instance, void **menu); unsigned char (*convertpoint)(struct _NPP *instance, double sourceX, double sourceY, enum NPCoordinateSpace { NPCoordinateSpacePlugin=1, NPCoordinateSpaceWindow=2, NPCoordinateSpaceFlippedWindow=3, NPCoordinateSpaceScreen=4, NPCoordinateSpaceFlippedScreen=5 } sourceSpace, double *destX, double *destY, enum NPCoordinateSpace { NPCoordinateSpacePlugin=1, NPCoordinateSpaceWindow=2, NPCoordinateSpaceFlippedWindow=3, NPCoordinateSpaceScreen=4, NPCoordinateSpaceFlippedScreen=5 } destSpace); unsigned char (*handleevent)(struct _NPP *instance, void *event, unsigned char handled); unsigned char (*unfocusinstance)(struct _NPP *instance, enum NPFocusDirection { NPFocusNext=0, NPFocusPrevious=1 } direction); void (*urlredirectresponse)(struct _NPP *instance, void *notifyData, unsigned char allow); short (*initasyncsurface)(struct _NPP *instance, struct _NPSize { int width; int height; } *size, enum NPImageFormat { NPImageFormatBGRA32=1, NPImageFormatBGRX32=2 } format, void *initData, struct _NPAsyncSurface { unsigned int version; struct _NPSize size; enum NPImageFormat { NPImageFormatBGRA32=1, NPImageFormatBGRX32=2 } format; union { struct { unsigned int stride; void *data; } bitmap; }; } *surface); short (*finalizeasyncsurface)(struct _NPP *instance, struct _NPAsyncSurface *surface); void (*setcurrentasyncsurface)(struct _NPP *instance, struct _NPAsyncSurface *surface, struct _NPRect *changed); } *

variable_types: struct _NPPluginFuncs { unsigned short size; unsigned short version; short (*newp)(char *pluginType, struct _NPP *instance, unsigned short mode, short argc, char *argn[], char *argv[], struct _NPSavedData { int len; void *buf; } *saved); short (*destroy)(struct _NPP *instance, struct _NPSavedData **save); short (*setwindow)(struct _NPP *instance, struct _NPWindow { void *window; int x; int y; unsigned int width; unsigned int height; struct _NPRect clipRect; void *ws_info; enum NPWindowType { NPWindowTypeWindow=1, NPWindowTypeDrawable=2 } type; } *window); short (*newstream)(struct _NPP *instance, char *type, struct _NPStream *stream, unsigned char seekable, unsigned short *stype); short (*destroystream)(struct _NPP *instance, struct _NPStream *stream, short reason); void (*asfile)(struct _NPP *instance, struct _NPStream *stream, char *fname); int (*writeready)(struct _NPP *instance, struct _NPStream *stream); int (*write)(struct _NPP *instance, struct _NPStream *stream, int offset, int len, void *buffer); void (*print)(struct _NPP *instance, struct _NPPrint { unsigned short mode; union { struct _NPFullPrint { unsigned char pluginPrinted; unsigned char printOne; void *platformPrint; } fullPrint; struct _NPEmbedPrint { struct _NPWindow window; void *platformPrint; } embedPrint; } print; } *platformPrint); short (*event)(struct _NPP *instance, void *event); void (*urlnotify)(struct _NPP *instance, char *url, short reason, void *notifyData); void *javaClass; short (*getvalue)(struct _NPP *instance, enum NPPVariable { NPPVpluginNameString=1, NPPVpluginDescriptionString=2, NPPVpluginWindowBool=3, NPPVpluginTransparentBool=4, NPPVjavaClass=5, NPPVpluginWindowSize=6, NPPVpluginTimerInterval=7, NPPVpluginScriptableInstance=expr, NPPVpluginScriptableIID=11, NPPVjavascriptPushCallerBool=12, NPPVpluginKeepLibraryInMemory=13, NPPVpluginNeedsXEmbed=14, NPPVpluginScriptableNPObject=15, NPPVformValue=16, NPPVpluginUrlRequestsDisplayedBool=17, NPPVpluginWantsAllNetworkStreams=18, NPPVpluginNativeAccessibleAtkPlugId=19, NPPVpluginCancelSrcStream=20, NPPVsupportsAdvancedKeyHandling=21, NPPVpluginUsesDOMForCursorBool=22, NPPVpluginDrawingModel=1000 } variable, void *ret_value); short (*setvalue)(struct _NPP *instance, enum NPNVariable { NPNVxDisplay=1, NPNVxtAppContext=2, NPNVnetscapeWindow=3, NPNVjavascriptEnabledBool=4, NPNVasdEnabledBool=5, NPNVisOfflineBool=6, NPNVserviceManager=expr, NPNVDOMElement=expr, NPNVDOMWindow=expr, NPNVToolkit=expr, NPNVSupportsXEmbedBool=14, NPNVWindowNPObject=15, NPNVPluginElementNPObject=16, NPNVSupportsWindowless=17, NPNVprivateModeBool=18, NPNVsupportsAdvancedKeyHandling=21, NPNVdocumentOrigin=22, NPNVpluginDrawingModel=1000, NPNVsupportsAsyncBitmapSurfaceBool=2007 } variable, void *value); unsigned char (*gotfocus)(struct _NPP *instance, enum NPFocusDirection { NPFocusNext=0, NPFocusPrevious=1 } direction); void (*lostfocus)(struct _NPP *instance); void (*urlredirectnotify)(struct _NPP *instance, char *url, int status, void *notifyData); short (*clearsitedata)(char *site, unsigned long flags, unsigned long maxAge); char **(*getsiteswithdata)(); void (*didComposite)(struct _NPP *instance); } *

user_defined_types: struct _NPNetscapeFuncs { unsigned short size; unsigned short version; short (*geturl)(struct _NPP *instance, char *url, char *window); short (*posturl)(struct _NPP *instance, char *url, char *window, unsigned int len, char *buf, unsigned char file); short (*requestread)(struct _NPStream *stream, struct _NPByteRange *rangeList); short (*newstream)(struct _NPP *instance, char *type, char *window, struct _NPStream **stream); int (*write)(struct _NPP *instance, struct _NPStream *stream, int len, void *buffer); short (*destroystream)(struct _NPP *instance, struct _NPStream *stream, short reason); void (*status)(struct _NPP *instance, char *message); char *(*uagent)(struct _NPP *instance); void *(*memalloc)(unsigned int size); void (*memfree)(void *ptr); unsigned int (*memflush)(unsigned int size); void (*reloadplugins)(unsigned char reloadPages); void *(*getJavaEnv)(); void *(*getJavaPeer)(struct _NPP *instance); short (*geturlnotify)(struct _NPP *instance, char *url, char *window, void *notifyData); short (*posturlnotify)(struct _NPP *instance, char *url, char *window, unsigned int len, char *buf, unsigned char file, void *notifyData); short (*getvalue)(struct _NPP *instance, enum NPNVariable variable, void *ret_value); short (*setvalue)(struct _NPP *instance, enum NPPVariable variable, void *value); void (*invalidaterect)(struct _NPP *instance, struct _NPRect *rect); void (*invalidateregion)(struct _NPP *instance, void *region); void (*forceredraw)(struct _NPP *instance); void *(*getstringidentifier)(char *name); void (*getstringidentifiers)(char **names, int nameCount, void **identifiers); void *(*getintidentifier)(int intid); _Bool (*identifierisstring)(void *identifier); char *(*utf8fromidentifier)(void *identifier); int (*intfromidentifier)(void *identifier); struct NPObject *(*createobject)(struct _NPP *npp, struct NPClass *aClass); struct NPObject *(*retainobject)(struct NPObject *obj); void (*releaseobject)(struct NPObject *obj); _Bool (*invoke)(struct _NPP *npp, struct NPObject *obj, void *methodName, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*invokeDefault)(struct _NPP *npp, struct NPObject *obj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*evaluate)(struct _NPP *npp, struct NPObject *obj, struct _NPString *script, struct _NPVariant *result); _Bool (*getproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName, struct _NPVariant *result); _Bool (*setproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName, struct _NPVariant *value); _Bool (*removeproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName); _Bool (*hasproperty)(struct _NPP *npp, struct NPObject *obj, void *propertyName); _Bool (*hasmethod)(struct _NPP *npp, struct NPObject *obj, void *propertyName); void (*releasevariantvalue)(struct _NPVariant *variant); void (*setexception)(struct NPObject *obj, char *message); void (*pushpopupsenabledstate)(struct _NPP *npp, unsigned char enabled); void (*poppopupsenabledstate)(struct _NPP *npp); _Bool (*enumerate)(struct _NPP *npp, struct NPObject *obj, void ***identifier, unsigned int *count); void (*pluginthreadasynccall)(struct _NPP *instance, void (*func)(void *), void *userData); _Bool (*construct)(struct _NPP *npp, struct NPObject *obj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); short (*getvalueforurl)(struct _NPP *npp, enum NPNURLVariable variable, char *url, char **value, unsigned int *len); short (*setvalueforurl)(struct _NPP *npp, enum NPNURLVariable variable, char *url, char *value, unsigned int len); short (*getauthenticationinfo)(struct _NPP *npp, char *protocol, char *host, int port, char *scheme, char *realm, char **username, unsigned int *ulen, char **password, unsigned int *plen); unsigned int (*scheduletimer)(struct _NPP *instance, unsigned int interval, unsigned char repeat, void (*timerFunc)(struct _NPP *npp, unsigned int timerID)); void (*unscheduletimer)(struct _NPP *instance, unsigned int timerID); short (*popupcontextmenu)(struct _NPP *instance, void **menu); unsigned char (*convertpoint)(struct _NPP *instance, double sourceX, double sourceY, enum NPCoordinateSpace sourceSpace, double *destX, double *destY, enum NPCoordinateSpace destSpace); unsigned char (*handleevent)(struct _NPP *instance, void *event, unsigned char handled); unsigned char (*unfocusinstance)(struct _NPP *instance, enum NPFocusDirection direction); void (*urlredirectresponse)(struct _NPP *instance, void *notifyData, unsigned char allow); short (*initasyncsurface)(struct _NPP *instance, struct _NPSize *size, enum NPImageFormat format, void *initData, struct _NPAsyncSurface *surface); short (*finalizeasyncsurface)(struct _NPP *instance, struct _NPAsyncSurface *surface); void (*setcurrentasyncsurface)(struct _NPP *instance, struct _NPAsyncSurface *surface, struct _NPRect *changed); }

user_defined_types: struct _NPPluginFuncs { unsigned short size; unsigned short version; short (*newp)(char *pluginType, struct _NPP *instance, unsigned short mode, short argc, char *argn[], char *argv[], struct _NPSavedData *saved); short (*destroy)(struct _NPP *instance, struct _NPSavedData **save); short (*setwindow)(struct _NPP *instance, struct _NPWindow *window); short (*newstream)(struct _NPP *instance, char *type, struct _NPStream *stream, unsigned char seekable, unsigned short *stype); short (*destroystream)(struct _NPP *instance, struct _NPStream *stream, short reason); void (*asfile)(struct _NPP *instance, struct _NPStream *stream, char *fname); int (*writeready)(struct _NPP *instance, struct _NPStream *stream); int (*write)(struct _NPP *instance, struct _NPStream *stream, int offset, int len, void *buffer); void (*print)(struct _NPP *instance, struct _NPPrint *platformPrint); short (*event)(struct _NPP *instance, void *event); void (*urlnotify)(struct _NPP *instance, char *url, short reason, void *notifyData); void *javaClass; short (*getvalue)(struct _NPP *instance, enum NPPVariable variable, void *ret_value); short (*setvalue)(struct _NPP *instance, enum NPNVariable variable, void *value); unsigned char (*gotfocus)(struct _NPP *instance, enum NPFocusDirection direction); void (*lostfocus)(struct _NPP *instance); void (*urlredirectnotify)(struct _NPP *instance, char *url, int status, void *notifyData); short (*clearsitedata)(char *site, unsigned long flags, unsigned long maxAge); char **(*getsiteswithdata)(); void (*didComposite)(struct _NPP *instance); }

user_defined_types: struct NPObject { struct NPClass *_class; unsigned int referenceCount; }

user_defined_types: struct _NPAsyncSurface { unsigned int version; struct _NPSize size; enum NPImageFormat format; union { struct { unsigned int stride; void *data; } bitmap; }; }

user_defined_types: struct NPClass { unsigned int structVersion; struct NPObject *(*allocate)(struct _NPP *npp, struct NPClass *aClass); void (*deallocate)(struct NPObject *npobj); void (*invalidate)(struct NPObject *npobj); _Bool (*hasMethod)(struct NPObject *npobj, void *name); _Bool (*invoke)(struct NPObject *npobj, void *name, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*invokeDefault)(struct NPObject *npobj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); _Bool (*hasProperty)(struct NPObject *npobj, void *name); _Bool (*getProperty)(struct NPObject *npobj, void *name, struct _NPVariant *result); _Bool (*setProperty)(struct NPObject *npobj, void *name, struct _NPVariant *value); _Bool (*removeProperty)(struct NPObject *npobj, void *name); _Bool (*enumerate)(struct NPObject *npobj, void ***value, unsigned int *count); _Bool (*construct)(struct NPObject *npobj, struct _NPVariant *args, unsigned int argCount, struct _NPVariant *result); }

user_defined_types: struct _NPVariant { enum NPVariantType type; union { _Bool boolValue; int intValue; double doubleValue; struct _NPString stringValue; struct NPObject *objectValue; } value; }


decompiled_code:
const char *NP_GetPluginVersion()
{
return "1.0.0.0";
}

canonical_decompiled_code:
const char *func19()
{
return "1.0.0.0";
}

original_code:
__attribute__((visibility("default"))) char*
NP_GetPluginVersion()
{
  return "1.0.0.0";
}


decompiled_code:
const char *NP_GetMIMEDescription()
{
return "application/basic-plugin:bsc:Basic plugin";
}

canonical_decompiled_code:
const char *func20()
{
return "application/basic-plugin:bsc:Basic plugin";
}

original_code:
__attribute__((visibility("default"))) const char*
NP_GetMIMEDescription()
{
  return "application/basic-plugin:bsc:Basic plugin";
}


decompiled_code:
__int64 __fastcall NP_GetValue(__int64 a1, int a2, _QWORD *a3)
{
__int64 result; // rax

if ( a2 == 1 )
{
*a3 = "Basic Sample Plug-in";
result = 0LL;
}
else if ( a2 == 2 )
{
*a3 = "Basic Sample Plug-in (Mozilla SDK)";
result = 0LL;
}
else
{
result = 9LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func21(__int64 a1, int a2, _QWORD *a3)
{
__int64 result; // rax

if ( a2 == 1 )
{
*a3 = "Basic Sample Plug-in";
result = 0LL;
}
else if ( a2 == 2 )
{
*a3 = "Basic Sample Plug-in (Mozilla SDK)";
result = 0LL;
}
else
{
result = 9LL;
}
return result;
}

original_code:
__attribute__((visibility("default"))) NPError
NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {
  switch (aVariable) {
    case NPPVpluginNameString:
      *((char**)aValue) = "Basic Sample Plug-in";
      break;
    case NPPVpluginDescriptionString:
      *((char**)aValue) = "Basic Sample Plug-in" " (Mozilla SDK)";
      break;
    default:
      return (0 + 9);
      break;
  }
  return (0 + 0);
}

canonical_original_code:
short NP_GetValue(void *future, enum NPPVariable aVariable, void *aValue) {
  switch (aVariable) {
    case NPPVpluginNameString:
      *((char **)aValue) = "Basic Sample Plug-in";
      break;
    case NPPVpluginDescriptionString:
      *((char **)aValue) = "Basic Sample Plug-in" " (Mozilla SDK)";
      break;
    default:
      return (0 + 9);
      break;
  }
  return (0 + 0);
}

variable_types:
future
void *

variable_types: enum NPPVariable { NPPVpluginNameString=1, NPPVpluginDescriptionString=2, NPPVpluginWindowBool=3, NPPVpluginTransparentBool=4, NPPVjavaClass=5, NPPVpluginWindowSize=6, NPPVpluginTimerInterval=7, NPPVpluginScriptableInstance=expr, NPPVpluginScriptableIID=11, NPPVjavascriptPushCallerBool=12, NPPVpluginKeepLibraryInMemory=13, NPPVpluginNeedsXEmbed=14, NPPVpluginScriptableNPObject=15, NPPVformValue=16, NPPVpluginUrlRequestsDisplayedBool=17, NPPVpluginWantsAllNetworkStreams=18, NPPVpluginNativeAccessibleAtkPlugId=19, NPPVpluginCancelSrcStream=20, NPPVsupportsAdvancedKeyHandling=21, NPPVpluginUsesDOMForCursorBool=22, NPPVpluginDrawingModel=1000 }

variable_types:
aValue
void *