Connexion

Récupérer mon mot de passe

Qui est en ligne ?
Il y a en tout 1 utilisateur en ligne :: 0 Enregistré, 0 Invisible et 1 Invité

Aucun

Le record du nombre d'utilisateurs en ligne est de 21 le Jeu 17 Oct 2013, 13:40
Derniers sujets
Flux RSS



Flag Counter
Partenaires

[C/C++ e BAT] Password input pour 32 bits

Voir le sujet précédent Voir le sujet suivant Aller en bas

[C/C++ e BAT] Password input pour 32 bits

Message par Delmar Grande le Sam 15 Juin 2013, 03:28

C'est avec grand plaisir que je partage cette version en Dev-C++

Source en C utilisant l' API Windows

inputpass.c



Code:
#include <windows.h>

//Nomes para os controles
#define lb1 1
#define lb2 2
#define txtbox 3
#define txtbox1 4
#define btn 5

//HWND do controles
HWND label1;
HWND label2;
HWND txt1;
HWND txt2;
HWND bot1;

//variaveis globais
char buffer[256];
char buffer1[256];

LRESULT CALLBACK WinProc(HWND window,UINT msg, WPARAM wParam,LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd)
{

MSG message;
HWND hwnd;
WNDCLASSEX wc;
wc.cbClsExtra=0;
wc.cbSize=sizeof(wc);
wc.cbWndExtra=0;
wc.hbrBackground=GetSysColorBrush(COLOR_BTNFACE);
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
wc.lpfnWndProc=WinProc;
wc.lpszClassName="Janela";
wc.lpszMenuName=NULL;
wc.style=0;
RegisterClassEx(&wc);
hwnd = CreateWindowEx(0,"Janela","Entre com usuario e senha",WS_OVERLAPPED|WS_SYSMENU,200,230,250,150,NULL,NULL,NULL,NULL);
ShowWindow(hwnd,SW_SHOW);
UpdateWindow(hwnd);
while(GetMessage(&message,0,0,0)){
TranslateMessage(&message);
DispatchMessage(&message);
}
return message.wParam ;

}

LRESULT CALLBACK WinProc(HWND window,UINT msg, WPARAM wParam,LPARAM lParam){
int argc,count;
char **argv;
LPWSTR *szArglist;

switch(msg)
{
case WM_CLOSE:
PostQuitMessage(0);
break;
case WM_CREATE: //Process de creation de la fenetre

szArglist = CommandLineToArgvW(GetCommandLineW(), &argc);
  int __i;
    if( NULL == szArglist ) {
        wprintf(L"CommandLineToArgvW falhou\n");
        return 0;
    } else {
        argv = (char **) malloc(sizeof(char) * argc);
        for( __i=0; __i<argc; __i++) {
            int tmp = wcslen(szArglist[__i]);
            char *c = (char *) malloc(sizeof(char) * tmp);
            wcstombs(c, szArglist[__i], tmp);
            argv[__i] = c;
            count=__i;
        }
    }
label1 = CreateWindowEx(0,"STATIC","Usuario:" ,WS_CHILD|WS_VISIBLE,10,10,55,20,window,(HMENU)lb1 ,0,0); //Cria label
label2 = CreateWindowEx(0,"STATIC","Senha:" ,WS_CHILD|WS_VISIBLE,10,50,45,20,window,(HMENU)lb2 ,0,0); //Cria label2
txt1 = CreateWindowEx(0,"EDIT",argv[count],WS_CHILD|WS_VISIBLE|WS_BORDER,70,10,150,20,window ,(HMENU)txtbox,0,0); //Cria Texbox
txt2 = CreateWindowEx(0,"EDIT","" ,WS_CHILD|WS_VISIBLE|WS_BORDER|ES_PASSWORD,70,50,150,20,window ,(HMENU)txtbox1,0,0); //Cria Texbox2
bot1 = CreateWindowEx(1,"BUTTON","Login" ,WS_CHILD|WS_VISIBLE|BS_DEFPUSHBUTTON,140,80,80,30,window,(HMENU)btn,0,0); //Cria botão

break;
case WM_COMMAND: //Message envoye lorsqu un controle é clique:
switch(wParam) //Verifie parâmetrre
{
case btn: //Si est un bouton
//recoit le contenu de textbox.

GetWindowText(txt1,buffer,256);
GetWindowText(txt2,buffer1,256);
//Adiciona este nas variaveis.  
printf("Set user= %s\n", &buffer);
printf("Set pass= %s\n", &buffer1);
exit(0);
} break;
default:
return DefWindowProc(window,msg,wParam,lParam);
}
return 0;
}


Exemple d'utilisation


inputpass.bat



Code:
@echo off
::exemple de comment setter des variables d application Dev-c++ en C
title Mon password
for /f "tokens=*" %%i in ('inputpass.exe "Delmar Grande"') do %%i
echo Utilisateur : %user%
echo Password  : %pass%
pause


Ici le code externe pour que tous le monde puisse tester.

Code:


@echo off
setlocal enableextensions enabledelayedexpansion
title Meu password
echo Iniciando aguarde...
call:inputpasshex
cls
::exemplo de como setar variavel de aplicativo Dev-c++ em C
for /f "tokens=*" %%i in ('%tmp%\inputpass.exe "Delmar Grande"') do %%i
echo Usuario : %user%
echo Senha : %pass%
pause
:inputpasshex
pushd "!temp!"
(
echo 'B®SS-HEXA desenvolvido por B®SS-HEAD
echo 'Modificado pelo Delmar Grande
echo On Error Resume Next
echo Set ReBin = CreateObject^("Scripting.FileSystemObject"^).OpenTextFile^("inputpass.exe", 2, True^)
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("4D5A40000100000002000000FFFF0000B8000000000000000A000000000000000E1FBA0E00B409CD21B8014CCD2157696E3332202E4558452E0D0A2440000000504500004C0102002D467B5100200000DE020000E00007030B01023800120000001C0000000400000F71000000100000003000000000400000100000000200000400000001000000040000000000000000800000000200007017000003000000000020000010000000001000001000000000000010000000000000000000000000700000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("00000000000000000000000000000000000000000000000064700000200000000000000000000000000000000000000000000000000000002E4D5052455353310060000000100000000E000000020000000000000000000000000000E00000E02E4D505245535332BE030000007000000004000000100000000000000000000000000000E00000E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076322E3139",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("0600060D0000550089E583EC18895DF8008B550831DB8975FC008B0231F68B003D91010000C077433D8D0C0020B7E51B000000700C414082C00031C08944002404E81C0E00008300F801746C85C0742A8434F40FBDFB0F0089D8408B8CD0859FC8DE258C4000D033490874BD3D50940CB16BB38D76003D4A052E50872E080BB861AF9248878B34B8D04C43FF14D0EBA1CEB4DB0191C805084585F67488E85C09CB2C801FEB815E948B141F30484C5294FE4402EB0D90C000F90F3035C84ED2D80584EF0600104000E8CC480FF8C04E402AC745F8806400800B000504D00852456F0E108B0D0030214000071189542408B620C50007043E80CE440CA1621012B0",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("0680350AA1048B101574611C20FD50B838A80883FAE0742040A217208B1D36B1B80493C8804182CE43075833A80FCC40B7B1D8A124C3008B0D844A12059548A134E82CE208E003071018E82C4700830CE4F0E80C28910181B048567105510340109A029148004182CE701690388CCE3FD4C0001C24E8DCBF0001208CDEB2280461140170E967C6710131028DBC27F5103F2308C2C5002A00F05FC12604E842FC1400D9486BE2A302883E5FB0D840680289E55D05FFE18D74261E81E7518CFF415DE92C61021F7281EC469870705C44AA000C803905C320A81A4240B207200C814113EC048945B8C7930032007F320214E80C7B2208158945B432CD2153B0327F",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("10407C5C045A4101A40D15C000400CC15B00C3C910158D459853112C58426008472C38424482E24098E20049200EC461E93018FA0E434261EE3010C80EC300700280E0100807D67102E110A127403CCC029358442D13854905008B45D4FEC19405F3AB415C1B609AA02A41159A73065285AD146C4A02F142E02142687C6EA3418C1AB38EBB4850049E2C0C912A83B50850C49058C43DD8C72D014137A210770B0A100040B7927E7C00001008D1C71D5132F0405830901E5B201273509C9893FE6E0223E8EC18D058C5FF41D1050204311D043FD8070F502785610624E900E8AC9F02C72445E07E916EEF068B4550FC5CC1C9028945F4C72045EC32B158C4BE53",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("14C1DFF7E6008D148522C300BF482030082225E88B2F45E86E47AE1121015E9E4FA15344DE1002053CC1C0335550F42E1241028945F88D0345ECFF00EB89D3F2021915148B45089200C2011C14922C8371E330140A0E0321ED403512500E80A0152D34F6182D0F300A276523D4FE5A41FD014A2D0E432143FD056AD49F00A84FFD059302D42FD048B40A66446D8035508B4D01B751F4B73108ECF115C7FE0190EC5F3045C1FE09C350EC6506C20E0E8060370C44FD0260F5F508D42FF058436D1ED404E5304B140E04C1E8300CCD02D4D275474D7DD4C302D407BA0A00784DB2580431885F40C75680216A01E0046A0117A50104109A0F313EC1CA260CDE3E9A",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("05103A06E1B36EA20D84BB41156C41155664029226160F64C5154942110BC0F000B04EC3801A4D83C01ABCAC029158E401BE7E105D746DB4D1FA9F80AB5E64D0A390D24036BBC1B6B6808EC4502F80CE4F0889C38D2845A89EC110694250B88D5067902E5E7E30F4600BB000980FF240090C08909FF040299C008D0A1050A70E982F42E743C81295C031D23051292C50084DC7D468EB1F8D43BF0A41984CC7035F94D95067BE4EE27B106C23C2262B84C968B3DE05815601130DA9B02E91681F1226CC24C0E02131A606961D635F441DA01B98A34147F0705B852DCA00EEEE12A1CB009E01C0A00320D50CB9038B095DFCC9C34510EB987D6312B98041FA09B1",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("4ED10FB3081045B01830188C1010200800000410984F170972EA5DC37E10B83D8E73C83C213000A120760F815098CC4267E213C1FF821000275104088D4104A32851285D87919E3CECCB70690504A1804020AE0F80FF4F9752082C90384C379168EFDB40FF22149D68B15467DF2C0007959179C0D522B0B5D5350C2CD2006010035C98BCAEC000B4485148136900F4EB69BD3D957D50201E125267130A422B4C311D4CD10C51D20CF20029DD57D10B1F12DC8B1A0A5CB6510ED0B58844F01F9E681F51A52BD48FF3700B9C90C0E848118D55A875050608F35FE10464FF00BA1F821695BA50197000B06E1490AC84E70008C0A7821A54479FB00C480379F2833B",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("3C7507C9C2181061914B5CBCA0AB9E06916E5C015510B901F14C800B9163416AA4119CA50AB83C34B04B6E8E19250C5D17EBD7E1443E137755603515C8CEDC6ED1D01E01186180D05846BFE5F595D2356C1B014100100A5A06F0D1588769FE003861050118611B012AA1A45A10424A35A854C3AB128A4A25AC54034B35C028A1AC54428B33C4A1B082389058841C4ACB21CC22A1B81C021DCACB21D4090FB705C0246096A8E4005A349D033C9D030D2404B5058544441E1BF050B8630C100424713C9A0DA2BE111D060F845954A0C09F78BC0829B97E14311FB07A3C4400ED01D44853703C8400A8A1180040EE005134001F8B15442C31E4452004894314A130",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("3A19318501B158410312431CA150823A023105723C0463D02143092C8B153C68108A032A4038012689433489F68910D821C8AA1E90014C020210904C108448A88284080C4A79E70D24898568C634503D9258C88612A9138931857028D1379158488712996D23857828913752C88712A88533808543848573888D85D495103D28349D23F89D13FF75154231D289091E9A1BC1EB0011E4215474D04280CED8FC90380C92D8916DD13844300ACBC82108A3D01C917094880F882939D889FA75B1EB18B1E8CC1D00BD8A5189E190B50F3D002201200711982EF2D7D1A09000D0C213EB10E929C12C90089EC81CB088B00844F00FDEFBF585A16630106A066368006A",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("06616800220A514210AAFD21C040DE01C1AE1012B23CC8CD0305B1FF258A1D012906595E0110FF25703C4CA6CAC3A03C8CC6C37C3C0CA6CAC3883CCCC9C3A83C4CAACAC3983CCCCAC3943C0CA8CAC38C3C0CC9C3D43CCCADCAC3E03C8CCEC3C43CCCAECAC3F43C0CCDC3F03CCCACCAC3E43C8CCDC3C83C4CA5CAC3383C8CC4C3443C0CF5CBC34C3C2C50103CD9B7C193411CB73C89CBA3BE26C2A778003D5900A00767760000C1121C018A034B0045524E454C33322E00646C6C004164644100746F6D4100457869007450726F63657373080046696E547454464708124E616D653032F406D0D616E646C694E606CAE3573CD1F44656C786528684046C803345",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("17062047570797E466F606100430554657E5860608276445786365707400696F6E46696C74654072C2250100D03667370622471716F2F575564607D01696E616267736074803705F5F656E766910726F6E3063D6F646065486027365745F617004705F74797038305606982100F095F62606F085F3E6063384C02A61626F0672740061745402216600666C7573680066700072696E7466006672006565006D616C6C6F20630048349776E61606C006703736C756E6368C1131036273007778141D82308554C4944341C4C40404D03348F5162477662774C53855534552C544432872650D015789046F77450378410044656630534F018803697370617463684C",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("4D2105616711342C3995073037F4C6F6262724079E1E0104F043558647170400C0F416463654270731F726C73249636F6E004100506F737451754069195000526567697382CD04436C61737309115310686F77193000547261186E736C8101B0550547069C1BD681B38847B0F00F054057B30885B008330000BF22BFE8BD880401B0B24C37B208C53000203FE0BF02BC22BD0000CD1A2C7E008D2E0760BF00BD204D873000A09DB2B0732F478E3E603101008055E0DB12F0011000641000C480354000A0005CF7A65A208038004D75658B783C03F8002BC0668B471403F80683C73FE855D4D09D0500820E2022020BC0743EE84972586095168810C6563F0040",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("5736460700856E0048372050546A046A7804578BD8FFD03800010B00867880788482050542054505FFD3588BFE42ADCA14D133806F5504B20880CDAA000C0B806804F15F674F0274E13C200276044E56EB092101AD024EC6060050536D20AB3032C08C400875F6EBD720E8E609015F81C7EEFE01FFFFB0E9AAB81E5A0E90B01A96CE91D140C91F3BF05142C66466201400F0FFDF0ACE2C0560DF2A2D0360906E2D0490CCC5EE00FF2FEA00A014E656C616065004E04627570632F6D60600523757172697F6660052063257A6B1066E2D318400F006D0460061006E020064004C00691C5006024045054100720067000076005700200066897CC0068046057500",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("6E8C01541502A30330451544059334E4C50639003A00454410495400DE667096E6062020544545F5E444067480D90065723D2025730AB03402E76C0634D3C2942404703434743523D3520480D422D332A5C4A404D072448524D5D29404E3748405A5007733325F00736861726564707400722D3E73697A6520113D3D201CF16686C208005F45485F53484152004544290025733A2502753A206661697E6E0002D909502627E816206025734427D9012E2E2F0870360636C6206669609676F692A6308363F35209D05209D3829809E03206E00DA72028618C28C002328700DD307329062920213D20F6A901F0FF272260EE067BC0F00E004CC1040CAF039028BF",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("BDC03C3CC0F01E00FFFF9700FF754231D285D2751E891C24E8BC0E0000893424FF153C61400083EC040FB7C0E88C0A000089C3891DC05240008D4304A3B05240008D4308A3D05240008D65F45B5E5F5DC389F8E88C0A000039D889FA75B1EBB1E8CC0E000090909090909090909090905189E183C1083D00100000721081E97F1D00008309002D00100000EBE929C183090089E089CC8B088B4004FFE09090905589E583EC188B4514894424108B45108944240C8B450C894424088B450889442404A17461400083C040890424E8EC0E0000A17461400083C040890424E8DC0E0000E8CC0E0000909090909090909090FF256C61400090900000000000000000",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("647000000000000000000000B870000064700000707000000000000000000000C570000070700000787000000000000000000000D770000078700000807000000000000000000000F870000080700000000000000000000000000000000000000000000094700000A770000000000000D070000000000000E370000000000000037100000000000000000000000000000000000000004765744D6F64756C6548616E646C654100000047657450726F6341646472657373004B45524E454C33322E444C4C006D73766372742E646C6C0000005F696F62005348454C4C33322E444C4C000000436F6D6D616E644C696E65546F4172677657005553455233322E64",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("6C6C0000004C6F616449636F6E410060E80000000058059F0200008B3003F02BC08BFE66ADC1E00C8BC850AD2BC803F18BC85751498A44390688043175F68BD68BCFE85C0000005E5A2BC0890432B4102BD02BC93BCA73268BD9AC4124FE3CE875F24383C104AD0BC078063BC273E5EB0603C378DF03C22BC38946FCEBD6E8000000005F81C78CFFFFFFB0E9AAB89B020000ABE80000000058051C020000E90C020000558BEC83EC148A025633F646397508894DF088018975F8C645FF000F86E30100005357807DFF008A0C32740C8A443201C0E904C0E0040AC8468365F400884DFE0FB645FF8B7D082BF83BF70F83A001000084C90F8917010000807DFF00",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("8B1C327403C1EB0481E3FFFF0F0046817DF8810800008BFB7320D1EFF6C301741481E7FF07000003F081C7810000008075FF01EB4B83E77FEB4583E303C1EF0283EB0074374B74274B74154B753281E7FFFF03008D74300181C741440000EBCF81E7FF3F000081C74104000046EB1181E7FF03000003F083C741EBB383E73F47807DFF0074090FB71C32C1EB04EB0C33DB668B1C3281E3FF0F00000FB645FF8075FF0103F08BC383E00F83F80F74058D5803EB384681FBFF0F00007408C1EB0483C312EB27807DFF00740D8B0432C1E80425FFFF0000EB040FB70432468D98110100004681FB10010100745F8B45F82BC785DB74428B7DF003C7895DEC8B5DF8",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("8A08FF45F840FF4DEC880C1F75EF8A4DFEEB24807DFF000FB61C32740D0FB6443201C1EB04C1E0040BD88B7DF88B45F0FF45F8881C3846FF45F4D0E1837DF408884DFE0F8C9AFEFFFFEB4933C03845FF74138A4432FCC645FF0025FC000000C1E00546EB0C668B4432FB25C00F0000D1E083E17F03C88D44090885C074168B0C328B5DF88B7DF08345F80483C60448890C1F75EA0FB645FF8B4D082BC83BF10F8221FEFFFF5F5B8B45F85EC9C20400E924AFFFFF4C9CFFFF000000004D7300000000000000000000000000002E66696C650000003E000000FEFF000067017478746D6F64652E630000000000000000002E746578740000001008000001000000",x,2^)^)^) : Next
echo For x = 1 To 511 Step 2 : ReBin.Write Chr^(Clng("&H" ^& Mid^("",x,2^)^)^) : Next
echo ReBin.Close
)>"%tmp%\Arquivotemp.vbs"
CScript "%tmp%\Arquivotemp.vbs" //nologo
Del "%tmp%\Arquivotemp.vbs" 2>&1
popd
Exit/b



Arrow ==> http://paste.ubuntu.com/5607170/


Si vous aimer remerciez SVP  !!
avatar
Delmar Grande
EQUIPE BBAT
EQUIPE BBAT

Mensagens : 170
Data de inscrição : 14/06/2013
Localização : Devant le pc

http://dbatchscript.forumeiros.com/

Revenir en haut Aller en bas

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum