Sign in to follow this  
Followers 0
mmavipc

i'm stumped

1 post in this topic

i'm stumped. I cant figure out how to convert the rest of my au3 code to a plugin and still have then backwards compatable.

heres what i have so far

dll:

/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <string.h>
#include "au3plugin.h"
using namespace std;
AU3_PLUGIN_FUNC g_AU3_Funcs[] = 
{
    {"sen", 2, 2},
    {"sde", 2, 2}
};
AU3_PLUGINAPI int AU3_GetPluginDetails(int *n_AU3_NumFuncs, AU3_PLUGIN_FUNC **p_AU3_Func)
{
    /* Pass back the number of functions that this DLL supports */
    *n_AU3_NumFuncs = sizeof(g_AU3_Funcs)/sizeof(AU3_PLUGIN_FUNC);

    /* Pack back the address of the global function table */
    *p_AU3_Func = g_AU3_Funcs;

    return AU3_PLUGIN_OK;
}             

BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
    switch (ul_reason_for_call)
    {
        case DLL_PROCESS_ATTACH:
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            break;
    }
    return TRUE;
}
AU3_PLUGIN_DEFINE(sen)
{
    AU3_PLUGIN_VAR  *pMyResult;
    string pt;
    string lol;
    string rt;
    string anm;
    string cl;
    int cp;
    pt = AU3_GetString(&p_AU3_Params[0]);   
    lol = AU3_GetString(&p_AU3_Params[1]);
    string an("9abcdefghijklmnopqrstuvwxyz| .=-\\)(*&^%{}$#@!~/+,'"":;><?[]_ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678");
    string a1;
    string a2;
    for (int i=0;i<31;i++){
        if (i == 10){
           a1+=10;
           a1+=13;
        }else{
              if (i!=13){
                 a1+=i;
              }
        }
    }
    for (int i=127;i<255;i++){
           a2+=i;
    }
    anm = an;
    an = a1;
    an+=anm;
    an+=a2;
    for (int i=1;i<pt.size();i++){
        cl ="";
    }
    pMyResult = AU3_AllocVar();
    AU3_SetString(pMyResult, rt.data());
    *p_AU3_Result       = pMyResult;
    *n_AU3_ErrorCode    = 0;
    *n_AU3_ExtCode      = 0;

    return AU3_PLUGIN_OK;
}
string a1g() {
       string a1gv;
       for (int i=0;i<31;i++){
           if (i == 10){
                a1gv+=10;
                a1gv+=13;
           }else{
                 if (i!=13){
                    a1gv+=i;
                 }
           }
       }
       return a1gv;
}
                
string a2g() {
       string a2gv;
       for (int i=127;i<255;i++){
           a2gv+=i;
       }
       return a2gv;
}

Au3:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cf 0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include-once
Local $rt
Local $rt1
Local $ct
Dim $a1, $a2
For $i = 0 To 31
    If $i = 10 Then
        $a1 = $a1 & Chr(10) & Chr(13)
    ElseIf $i = 13 Then
        ContinueLoop
    Else
        $a1 = $a1 & Chr($i)
    EndIf
Next
For $i = 127 To 255
    $a2 = $a2 & Chr($i)
Next
Func sen($pt, $lol = "")
    Local $an = "9abcdefghijklmnopqrstuvwxyz| .=-\)(*&^%{}$#@!~/+,'"":;><?[]_ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"
    $an = $a1 & $an & $a2
    If StringLen($lol) > 0 Then
        For $i = 1 To StringLen($lol)
            $an = StringReplace($an, StringMid($lol, $i, 1), "", 0, 1)
;~          FileWrite("data.dat",Binary($an))
        Next
;~      ConsoleWrite($an & @lf)

        $ant = StringLeft($an, 35) & $lol & StringRight($an, (StringLen($an) - 35))
        $an = $ant
;~      ConsoleWrite($an & @lf)
    EndIf
    $rt = ""
    $rt1 = ""
    For $i = 1 To StringLen($pt)
        $cl = StringMid($pt, $i, 1)
        $cp = StringInStr($an, $cl, 1)
        $idk = $cp + 1
;~      ConsoleWrite($cl & @LF & $cp & @LF & $an & @LF)
        If $cp = StringLen($an) Then
            $rt = $rt & StringLeft($an, 1)
;~          ConsoleWrite("$rt " & $rt & @LF)
        Else
            $idk = $cp + 1
;~          ConsoleWrite("$idk " & $idk & @LF)
            $le = StringMid($an, $idk, 1)
;~          ConsoleWrite("$le " & $le & @LF)
            $rt = $rt & $le
;~          ConsoleWrite("$rtlol " & $rt & @LF)
        EndIf
    Next
    For $i = 1 To StringLen($rt)
        $ctl = StringMid($rt, $i, 1)
;~      ConsoleWrite("$ctl " & $ctl & @LF)
        If $rt1 = "" Then
            $rt1 = $rt1 & StringInStr($an, $ctl, 1)
        Else
            $rt1 = $rt1 & " " & StringInStr($an, $ctl, 1)
        EndIf
    Next
;~  ConsoleWrite("$rt1 " & $rt1 & @LF)
;~  ConsoleWrite("$rt " & $rt & @LF)
;~  ConsoleWrite("$rt1 " & $rt1 & @LF)
    $rt = $rt1
    Return $rt
EndFunc   ;==>sen
Func sde($et, $lol = "")
    Local $an = "9abcdefghijklmnopqrstuvwxyz| .=-\)(*&^%{}$#@!~/+,'"":;><?[]_ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678"
    $an = $a1 & $an & $a2
    If StringLen($lol) > 0 Then
        For $i = 1 To StringLen($lol)
            $an = StringReplace($an, StringMid($lol, $i, 1), "", 0, 1)
;~          FileWrite("data.dat",Binary($an))
        Next
        ConsoleWrite($an & @LF)

        $ant = StringLeft($an, 35) & $lol & StringRight($an, (StringLen($an) - 35))
;~      FileWrite("data.dat",Binary($an))
        $an = $ant
;~      FileWrite("data.dat",Binary($an))
        ConsoleWrite($an & @LF)
    EndIf
    $rt = ""
    $rt1 = ""
    $pt = ""
    $et = StringReplace($et, @CR, " ")
    $et = StringReplace($et, @LF, " ")
    $et = StringReplace($et, @CRLF, " ")
    $ets = StringSplit($et, " ")
    For $i = 1 To $ets[0]
        If $ets[$i] = 1 Then
            $rt = $rt & StringRight($an, 1)
        Else
            $rt = $rt & StringMid($an, $ets[$i] - 1, 1)
        EndIf
    Next
    Return binary($rt)
EndFunc   ;==>sde

thanks in advanced


[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0