Skip to content

Commit

Permalink
1999-10-26
Browse files Browse the repository at this point in the history
  • Loading branch information
martiniturbide committed Dec 22, 2015
1 parent a75e14c commit f11aa9d
Show file tree
Hide file tree
Showing 494 changed files with 60,905 additions and 0 deletions.
63 changes: 63 additions & 0 deletions CreateEnv/CreateEnv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
*
* Module Name: MAGclass.c
*
* Register Class of OS/2 Workplace Shell Access Control
*
* Return 0: ok | 1: Fehler
*/

#define INCL_WIN
#define INCL_PM
#define INCL_DOS

#include <os2.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

HAB hab;

void Anleitung (char *string)
{
printf ("Syntax: %s <profile_path>\n\n", string);
return;
}

int main (int argc, char *argv[])
{
HINI hini;
BOOL bRC;
PSZ psz, pszBuffer;

if (argc == 1)
{
Anleitung (argv[0]);
return 1;
}

hab = WinQueryAnchorBlock (HWND_DESKTOP);

hini = PrfOpenProfile (hab, argv[1]);
if (hini == NULLHANDLE)
{
printf ("Error opening file %s\n", argv[1]);
return 1;
}

pszBuffer = psz = malloc (65536);

while (!feof (stdin))
{
fgets (psz, 65536-strlen (pszBuffer), stdin);
psz += strlen (psz);
}

PrfWriteProfileString (hini, "_Env", "NewEnv", pszBuffer);
PrfCloseProfile (hini);

free (pszBuffer);

return 0;
}

30 changes: 30 additions & 0 deletions CreateEnv/MAKEFILE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Created by IBM WorkFrame/2 MakeMake at 19:16:46 on 12/28/94
#
# The actions included in this makefile are:
# COMPILE::CLC C
# LINK::LINK386: LINK

.all: \
.\createenv.EXE

.SUFFIXES:

.SUFFIXES: .C

.C.obj:
@echo WF::COMPILE::CLC C
icc.exe /Ss /Q /Wextparproretuse /Ti /G4 /C %s

.\createenv.EXE: \
.\createenv.obj \
makefile
@echo Link::Linker
icc.exe @<<
/B"$(LDB) /PM:VIO /NOL"
/Fecreateenv.exe
.\createenv.obj
<<


!include makefile.Dep

5 changes: 5 additions & 0 deletions CreateEnv/MAKEFILE.DEP
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.\createenv.obj: \
createenv.C \
makefile


Binary file added CreateEnv/createenv.obj
Binary file not shown.
1 change: 1 addition & 0 deletions CreateEnv/lastmake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Debug is YES
1 change: 1 addition & 0 deletions CryptPasswd/lastmake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Debug is YES
71 changes: 71 additions & 0 deletions CryptPasswd/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "samglob.h"
#include "magpro2.h"
#include "Profile.hpp"

/* Key fr die Verschlsselung */
ULONG key[2] = {ULKEY1, ULKEY2};

int main (int argc, char *argv[])
{
CHAR sz[CCHMAXPASSWORD];
ULONG ulc;

if (argc != 2)
{
printf ("Syntax: %s <username>\n", argv[0]);
return 0;
}

Profile profile;
memset (sz, 0, CCHMAXPASSWORD);

printf ("--- Encrypting password ---\n");

ulc = CCHMAXPASSWORD;
profile.queryProfileData (argv[1], MAGPRO_PASSWORD_KEY, sz, &ulc);
if (sz[ulc-1] != '\0')
sz[ulc] = '\0';

printf ("actual password: %s\n", sz);

profile.writeProfileCryptedData (argv[1], MAGPRO_PASSWORD_KEY, sz, CCHMAXPASSWORD);

printf ("--- Encrypting service data string ---\n");
if (profile.queryProfileSize (argv[1], NULL, &ulc) == FALSE)
return 0;

PCHAR psz = (PCHAR)malloc (ulc);
PCHAR pszService = psz;
profile.queryProfileData (argv[1], NULL, pszService, &ulc);

for (int i = 0; i < MAXSTRING; i++)
{
if (strncmp (pszService, MAGPRO_SERVICE_KEY, 2) == 0)
{
// Service string gefunden; verschlsseln
profile.queryProfileSize (argv[1], pszService, &ulc);
ulc =(((ulc + 7)>>3)<<3);
if (ulc)
{
printf ("Encrypting %s\n", pszService);
ULONG ulc1;
PCHAR pszServiceString = (PCHAR)malloc (ulc);
memset (pszServiceString, 0, ulc);

profile.queryProfileData (argv[1], pszService, pszServiceString, &ulc1);
profile.writeProfileCryptedData (argv[1], pszService, pszServiceString, ulc);

free (pszServiceString);
}
}
pszService += strlen (pszService) + 1;
}

return 0;
}

Binary file added CryptPasswd/main.obj
Binary file not shown.
41 changes: 41 additions & 0 deletions CryptPasswd/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# makefile
# Erstellt von IBM WorkFrame/2 MakeMake um 13:06:46 am 13 Mai 1999
#
# Diese Make-Datei enth„lt folgende Aktionen:
# Compile::C++ Compiler
# Link::Linker

.SUFFIXES:

.SUFFIXES: \
.cpp .obj

.cpp.obj:
@echo " Compile::C++ Compiler "
icc.exe $(CDB) /I..\include /I..\ToolLib /Q /Ti /G5 /C %s

{d:\work\c\wpsac\cryptpasswd}.cpp.obj:
@echo " Compile::C++ Compiler "
icc.exe $(CDB) /I..\include /I..\ToolLib /Q /Ti /G5 /C %s

all: \
.\encrypt.exe

.\encrypt.exe: \
.\main.obj \
..\ToolLib\SamUtil.lib \
{$(LIB)}cutil.lib
@echo " Link::Linker "
icc.exe @<<
/B" /de $(LDB)"
/Feencrypt.exe
..\ToolLib\SamUtil.lib
cutil.lib
.\main.obj
<<

.\main.obj: \
d:\work\c\wpsac\cryptpasswd\main.cpp \
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}samglob.h \
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}magpro2.h \
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}Profile.hpp
34 changes: 34 additions & 0 deletions CryptPasswd/makefile.$mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:TARGET.SUFFIXES
:TARGET.SUFFIXES
:DEPENDENCY..cpp .obj
:TARGET.all
:DEPENDENCY.
.\encrypt.exe
:RULE..cpp.obj
:ACTION.Compile::C++ Compiler
:COMMAND.
icc.exe $(CDB) /I..\include /I..\ToolLib /Q /Ti /G5 /C %s
:RULE.{d:\work\c\wpsac\cryptpasswd}.cpp.obj
:ACTION.Compile::C++ Compiler
:COMMAND.
icc.exe $(CDB) /I..\include /I..\ToolLib /Q /Ti /G5 /C %s
:TARGET..\encrypt.exe
:DEPENDENCY.
.\main.obj
..\ToolLib\SamUtil.lib
{$(LIB)}cutil.lib
:ACTION.Link::Linker
:COMMAND.
icc.exe @<<
/B" /de"
/Feencrypt.exe
..\ToolLib\SamUtil.lib
cutil.lib
.\main.obj
<<
:TARGET..\main.obj
:DEPENDENCY.
d:\work\c\wpsac\cryptpasswd\main.cpp
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}samglob.h
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}magpro2.h
{d:\work\c\wpsac\cryptpasswd;..\include;..\ToolLib;$(INCLUDE);}Profile.hpp
Binary file added CryptPasswd/t.REG
Binary file not shown.
Binary file added INSTALL_DEU/EPFIHELP.INF
Binary file not shown.
Loading

0 comments on commit f11aa9d

Please sign in to comment.