-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGFPDll_Crypt2.pb
More file actions
750 lines (610 loc) · 19.8 KB
/
GFPDll_Crypt2.pb
File metadata and controls
750 lines (610 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
;***************************************
;*** GreenForce Player *** GF-Player ***
;*** http://GFP.RRSoftware.de **********
;*** (c) 2009 - 2013 RocketRider *******
;***************************************
Global iLogWindow.i, iLogWindow_View.i
Global Dim MenuLimitations.i(1)
Enumeration
#LOGLEVEL_NONE
#LOGLEVEL_ERROR
#LOGLEVEL_DEBUG
EndEnumeration
Macro WriteLog(sText, iLevel = #LOGLEVEL_ERROR, UselogWindow=#True)
;kein logging
EndMacro
Declare __AnsiString(str.s)
XIncludeFile "include\GFP_PBCompatibility.pbi"
XIncludeFile "include\GFP_Cryption4_Unicode.pbi"
XIncludeFile "include\GFP_DRMHeaderV2_52_Unicode.pbi"
XIncludeFile "include\GFP_Mediadet.pbi"
XIncludeFile "include\GFP_MediaTags.pbi"
XIncludeFile "include\GFP_MachineID.pbi"
XIncludeFile "include\GFP_SpecialFolder.pbi"
UsePNGImageDecoder()
UsePNGImageEncoder()
UseJPEGImageDecoder()
UseJPEGImageEncoder()
UseJPEG2000ImageDecoder()
UseJPEG2000ImageEncoder()
UseTIFFImageDecoder()
UseTGAImageDecoder()
CompilerIf #USE_OEM_VERSION
XIncludeFile "GFP_OEM.pbi"
CompilerElse
#PLAYER_EXTENSION = "gfp"
CompilerEndIf
#DRM_ENCRYPTION_VERSION_1_0 = 0
#DRM_ENCRYPTION_VERSION_2_0 = 1
#DRM_CONTENTPROTECTION_ON = 0
#DRM_CONTENTPROTECTION_OFF = 1
#DRM_CONTENTPROTECTION_EXTENDED = 2
Global sSource.s = "", sOutput.s = "", sPassword.s = "", sPasswordTip.s = "", sHint.s = "", bEncrypt.i = #True
Global sTitle.s = "", sAlbum.s = "", sInterpreter.s = "", sComment.s, iSnapshot.i, bAllowRestore.i = #True , qLength.q = 0
Global sCoverFile.s = "", bAllowNoPassword.i = #False, sUserData.s = "", sCodecName.s="", sCodecLink.s=""
Global sOEMText.s = ""
Global *headerOld.DRM_HEADER
ProcedureDLL AttachProcess(Instanz)
*headerOld = AllocateMemory(SizeOf(DRM_HEADER))
EndProcedure
ProcedureDLL DetachProcess(Instanz)
FreeMemory(*headerOld)
EndProcedure
Procedure __CB(p.q,s.q)
Protected iEvent
; Print(Chr(13)+"Progress: "+StrF(p*100/s, 1)+ "%"+Space(10))
If s > 0
SetGadgetState(0, p * 1000 / s)
EndIf
Repeat
iEvent = WindowEvent()
If iEvent = #PB_Event_Gadget
If EventGadget() = 1
ProcedureReturn 1
EndIf
EndIf
Until iEvent = #WM_NULL
EndProcedure
Procedure __OpenProgressWindow()
Protected sTitle.s = GetFilePart(ProgramFilename())
sTitle = Left(sTitle, Len(sTitle) - Len(GetExtensionPart(sTitle)))
If OpenWindow(0, 0, 0, 350, 21, sTitle, #PB_Window_BorderLess | #PB_Window_ScreenCentered)
StickyWindow(0, 1)
ProgressBarGadget(0, 0, 0, 300, 21, 0, 1000)
SetGadgetState(0,0)
ButtonGadget(1,300,0,50,21, "Cancel")
EndIf
EndProcedure
Procedure __SetMediaHint(sHintText.s)
sHint = sHintText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaInterpreter(sInterpreterText.s)
sInterpreter = sInterpreterText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaComment(sCommentText.s)
sComment = sCommentText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaTitel(sTitleText.s)
sTitle = sTitleText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaAlbum(sAlbumText.s)
sAlbum = sAlbumText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaCodecName(sCodecNameText.s)
sCodecName = sCodecNameText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaCodecLink(sCodecLinkText.s)
sCodecLink = sCodecLinkText
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaAllowRestore(bAllow)
bAllowRestore = bAllow
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaContentProtection(iSnapshotOption)
iSnapshot = iSnapshotOption
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaLength(qMediaLength.q)
qLength = qMediaLength
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaCoverFile(sCover.s)
Protected image
image = LoadImage(#PB_Any, sCover)
If image
sCoverFile = sCover
ProcedureReturn #S_OK
Else
ProcedureReturn #E_FAIL
EndIf
EndProcedure
Procedure __SetMediaUserData(sFileUserData.s)
sUserData = sFileUserData
ProcedureReturn #S_OK
EndProcedure
Procedure __SetMediaOemText(sNewOemText.s)
sOEMText = sNewOemText
ProcedureReturn #S_OK
EndProcedure
Procedure __CheckMedia(sFile.s)
Protected MC.MEDIACHECK
LoadMetaFile(sFile.s)
If MediaInfoData\qDuration>0
ProcedureReturn #S_OK
EndIf
DShow_CheckMedia(sFile, @MC)
If MC\dLength>0
ProcedureReturn #S_OK
EndIf
ProcedureReturn #E_FAIL
EndProcedure
Procedure __InitCheckMedia()
InitMetaReader()
ProcedureReturn #S_OK
EndProcedure
Procedure __FreeCheckMedia()
FreeMetaReader()
ProcedureReturn #S_OK
EndProcedure
Procedure __EncryptMediaFile(sSource.s, sOutput.s, sPassword.s, *cbCallback)
Protected MC.MEDIACHECK, CoverImage, qTmpLen.q, iResult.i = #E_OUTOFMEMORY
If *headerOld
If *cbCallback = -1
*cbCallback = @__CB()
__OpenProgressWindow()
EndIf
If FileSize(sSource) > 0
If Trim(sOutput) = ""
;sOutput = GetPathPart(sSource)+ GetFilePart(sSource)
CompilerIf #USE_OEM_VERSION
sOutput.s = sSource + "." + #PLAYER_EXTENSION
CompilerElse
sOutput = Left(sSource, Len(sSource) - Len(GetExtensionPart(sSource))) + #PLAYER_EXTENSION
CompilerEndIf
EndIf
If sPassword <> ""
InitDRMHeader(*headerOld, sSource)
qTmpLen = qLength
If qTmpLen <= 0
CoInitialize_(#Null)
DShow_CheckMedia(sSource.s, @MC)
CoUninitialize_()
qTmpLen = MC\dLength
EndIf
SetDRMHeaderMediaLength(*headerOld, qTmpLen)
If sCoverFile <> ""
CoverImage = LoadImage(#PB_Any, sCoverFile)
If IsImage(CoverImage)
;PrintN("WARN: Cannot load cover file " + QuoteString(sCoverFile))
Else
SetDRMHeaderCover(*headerOld, CoverImage)
FreeImage(CoverImage)
EndIf
EndIf
SetDRMHeaderTitle(*headerOld, sTitle)
SetDRMHeaderAlbum(*headerOld, sAlbum)
SetDRMHeaderInterpreter(*headerOld, sInterpreter)
SetDRMHeaderComment(*headerOld, sComment)
SetDRMHeaderUserData(*headerOld, sUserData)
*headerOld\bCanRemoveDRM = bAllowRestore
*headerOld\lSnapshotProtection = iSnapshot
FinalizeDRMHeader(*headerOld, sPassword)
iResult = EncryptFile(sSource, sOutput, sPassword, *headerOld, *cbCallback)
Else
iResult = #DRM_ERROR_INVALIDPASSWORD
EndIf
Else
iResult = #DRM_ERROR_INVALIDFILE
EndIf
If IsWindow(0)
CloseWindow(0)
EndIf
EndIf
ProcedureReturn iResult
EndProcedure
Procedure __EncryptMediaFileV2(sSource.s, sOutput.s, sPassword.s, *cbCallback)
Protected MC.MEDIACHECK, CoverImage, qTmpLen.q, iResult.i = #E_OUTOFMEMORY
Protected std.DRM_STANDARD_DATA, sec.DRM_SECURITY_DATA, *header
If *cbCallback = -1
*cbCallback = @__CB()
__OpenProgressWindow()
EndIf
If FileSize(sSource) > 0
If Trim(sOutput) = ""
CompilerIf #USE_OEM_VERSION
sOutput.s = sSource + "." + #PLAYER_EXTENSION
CompilerElse
sOutput = Left(sSource, Len(sSource) - Len(GetExtensionPart(sSource))) + #PLAYER_EXTENSION
CompilerEndIf
EndIf
If sPassword <> ""
*header = DRMV2Write_Create(sPassword, sOEMText)
qTmpLen = qLength
If qTmpLen <= 0
CoInitialize_(#Null)
DShow_CheckMedia(sSource.s, @MC)
CoUninitialize_()
qTmpLen = MC\dLength
EndIf
;SetDRMHeaderMediaLength(*header, qTmpLen)
std\qLength = qTmpLen
std\fAspect = 0.0
sec\bCanRemoveDRM = bAllowRestore
sec\lSnapshotProtection = iSnapshot
DRMV2Write_AttachStandardData(*header, @std, #True)
DRMV2Write_AttachBlock(*header, #DRMV2_HEADER_MEDIA_SECURITYDATA, @sec, SizeOf(DRM_SECURITY_DATA), #True)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_TITLE, sTitle,#DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_ALBUM, sAlbum,#DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_ORGINALNAME, GetFilePart(sSource), #DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_PASSWORDTIP, sPasswordTip,#DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_INTERPRETER, sInterpreter,#DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_COMMENT, sComment,#DRMV2_BLOCK_COMMENTSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_USERDATA, sUserData,#DRMV2_BLOCK_COMMENTSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_CODECLINK, sCodecLink,#DRMV2_BLOCK_STRINGSIZE)
DRMV2Write_AttachString(*header, #DRMV2_HEADER_MEDIA_CODECNAME, sCodecName,#DRMV2_BLOCK_STRINGSIZE)
If sCoverFile <> ""
CoverImage = LoadImage(#PB_Any, sCoverFile)
If IsImage(CoverImage) = #Null
;PrintN("WARN: Cannot load cover file " + QuoteString(sCoverFile))
Else
;SetDRMHeaderCover(*header, CoverImage)
DRMV2Write_AttachCoverImage(*header, CoverImage)
FreeImage(CoverImage)
EndIf
EndIf
iResult = EncryptFileV2(sSource, sOutput, sPassword, *header, *cbCallback)
DRMV2Write_Free(*header)
Else
iResult = #DRM_ERROR_INVALIDPASSWORD
EndIf
Else
iResult = #DRM_ERROR_INVALIDFILE
EndIf
If IsWindow(0)
CloseWindow(0)
EndIf
ProcedureReturn iResult
EndProcedure
Procedure __DecryptMediaFile(sSource.s, sOutput.s, sPassword.s, *cbCallback)
Protected iResult.i = #E_OUTOFMEMORY, iDRMResult
If *headerOld
iDRMResult.i = ReadDRMHeader(sSource, *headerOld, sPassword)
If *cbCallback = -1
*cbCallback = @__CB()
__OpenProgressWindow()
EndIf
If iDRMResult = #DRM_OK
If *headerOld\bCanRemoveDRM = #True
If Trim(sOutput) = ""
sOutput = GetPathPart(sSource) + GetDRMOrgFileName(*headerOld)
EndIf
iResult = DecryptFile(sSource, sOutput, sPassword, *cbCallback)
Else
iResult = #E_ACCESSDENIED
EndIf
EndIf
If IsWindow(0)
CloseWindow(0)
EndIf
EndIf
ProcedureReturn iResult
EndProcedure
Procedure __DecryptMediaFileV2(sSource.s, sOutput.s, sPassword.s, *cbCallback)
Protected *header, iResult.i = #E_FAIL, iDRMResult.i, sec.DRM_SECURITY_DATA, sOrgFileName.s
*header = DRMV2Read_ReadFromFile(sSource, sPassword)
If *header
iDRMResult = DRMV2Read_GetLastReadResult(*header)
If *cbCallback = -1
*cbCallback = @__CB()
__OpenProgressWindow()
EndIf
If iDRMResult = #DRM_OK
If DRMV2Read_GetBlockData(*header, #DRMV2_HEADER_MEDIA_SECURITYDATA, @sec)
If sec\bCanRemoveDRM = #True
If Trim(sOutput) = ""
sOrgFileName = DRMV2Read_GetBlockString(*header, #DRMV2_HEADER_MEDIA_ORGINALNAME)
If Trim(sOrgFileName) = ""
sOrgFileName = GetFilePart(sSource) + "-restored"
EndIf
sOutput = GetPathPart(sSource) + sOrgFileName
EndIf
iResult = DecryptFileV2(sSource, sOutput, sPassword, *cbCallback)
Else
iResult = #E_ACCESSDENIED
EndIf
Else
iResult = #E_ACCESSDENIED
EndIf
EndIf
If IsWindow(0)
CloseWindow(0)
EndIf
DRMV2Read_Free(*header)
EndIf
ProcedureReturn iResult
EndProcedure
Procedure.s __GetMachineID(Version)
ProcedureReturn MachineID(Version)
EndProcedure
ProcedureDLL DecryptMediaFileA(*Source, *Output, *Password, Flags, *cbCallback)
Protected sSource.s = "", sOutput.s = "", sPassword.s = ""
If *Source
sSource = PeekS(*Source, -1, #PB_Ascii)
EndIf
If *Output
sOutput = PeekS(*Output, -1, #PB_Ascii)
EndIf
If *Password
sPassword = PeekS(*Password, -1, #PB_Ascii)
EndIf
If Flags = #DRM_ENCRYPTION_VERSION_2_0
ProcedureReturn __DecryptMediaFileV2(sSource, sOutput, sPassword, *cbCallback)
Else
ProcedureReturn __DecryptMediaFile(sSource, sOutput, sPassword, *cbCallback)
EndIf
EndProcedure
ProcedureDLL DecryptMediaFileW(*Source, *Output, *Password, Flags, *cbCallback)
Protected sSource.s = "", sOutput.s = "", sPassword.s = ""
If *Source
sSource = PeekS(*Source, -1, #PB_Unicode)
EndIf
If *Output
sOutput = PeekS(*Output, -1, #PB_Unicode)
EndIf
If *Password
sPassword = PeekS(*Password, -1, #PB_Unicode)
EndIf
If Flags = #DRM_ENCRYPTION_VERSION_2_0
ProcedureReturn __DecryptMediaFileV2(sSource, sOutput, sPassword, *cbCallback)
Else
ProcedureReturn __DecryptMediaFile(sSource, sOutput, sPassword, *cbCallback)
EndIf
EndProcedure
ProcedureDLL EncryptMediaFileW(*Source, *Output, *Password, Flags, *cbCallback)
Protected sSource.s = "", sOutput.s = "", sPassword.s = ""
If *Source
sSource = PeekS(*Source, -1, #PB_Unicode)
EndIf
If *Output
sOutput = PeekS(*Output, -1, #PB_Unicode)
EndIf
If *Password
sPassword = PeekS(*Password, -1, #PB_Unicode)
EndIf
If Flags = #DRM_ENCRYPTION_VERSION_2_0
ProcedureReturn __EncryptMediaFileV2(sSource, sOutput, sPassword, *cbCallback)
Else
ProcedureReturn __EncryptMediaFile(sSource, sOutput, sPassword, *cbCallback)
EndIf
EndProcedure
ProcedureDLL EncryptMediaFileA(*Source, *Output, *Password, Flags, *cbCallback)
Protected sSource.s = "", sOutput.s = "", sPassword.s = ""
If *Source
sSource = PeekS(*Source, -1, #PB_Ascii)
EndIf
If *Output
sOutput = PeekS(*Output, -1, #PB_Ascii)
EndIf
If *Password
sPassword = PeekS(*Password, -1, #PB_Ascii)
EndIf
If Flags = #DRM_ENCRYPTION_VERSION_2_0
ProcedureReturn __EncryptMediaFileV2(sSource, sOutput, sPassword, *cbCallback)
Else
ProcedureReturn __EncryptMediaFile(sSource, sOutput, sPassword, *cbCallback)
EndIf
EndProcedure
ProcedureDLL SetMediaHintA(*HintText)
If *HintText
ProcedureReturn __SetMediaHint(PeekS(*HintText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaHintW(*HintText)
If *HintText
ProcedureReturn __SetMediaHint(PeekS(*HintText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaInterpreterA(*InterpreterText)
If *InterpreterText
ProcedureReturn __SetMediaInterpreter(PeekS(*InterpreterText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaInterpreterW(*InterpreterText)
If *InterpreterText
ProcedureReturn __SetMediaInterpreter(PeekS(*InterpreterText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCommentA(*CommentText)
If *CommentText
ProcedureReturn __SetMediaComment(PeekS(*CommentText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCommentW(*CommentText)
If *CommentText
ProcedureReturn __SetMediaComment(PeekS(*CommentText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaTitelA(*TitleText)
If *TitleText
ProcedureReturn __SetMediaTitel(PeekS(*TitleText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaTiteltW(*TitleText)
If *TitleText
ProcedureReturn __SetMediaTitel(PeekS(*TitleText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaAlbumA(*AlbumText)
If *AlbumText
ProcedureReturn __SetMediaAlbum(PeekS(*AlbumText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaAlbumW(*AlbumText)
If *AlbumText
ProcedureReturn __SetMediaAlbum(PeekS(*AlbumText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaAllowRestore(bAllow)
ProcedureReturn __SetMediaAllowRestore(bAllow)
EndProcedure
ProcedureDLL SetMediaContentProtection(iSnapshotOption)
ProcedureReturn __SetMediaContentProtection(iSnapshotOption)
EndProcedure
ProcedureDLL SetMediaLength(qMediaLength.q)
ProcedureReturn __SetMediaLength(qMediaLength)
EndProcedure
ProcedureDLL SetMediaCoverFileA(*Cover)
If *Cover
ProcedureReturn __SetMediaCoverFile(PeekS(*Cover, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCoverFileW(*Cover)
If *Cover
ProcedureReturn __SetMediaCoverFile(PeekS(*Cover, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaUserDataA(*UserData)
If *UserData
ProcedureReturn __SetMediaUserData(PeekS(*UserData, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaUserDataW(*UserData)
If *UserData
ProcedureReturn __SetMediaUserData(PeekS(*UserData, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCodecNameA(*UserData)
If *UserData
ProcedureReturn __SetMediaCodecName(PeekS(*UserData, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCodecNameW(*UserData)
If *UserData
ProcedureReturn __SetMediaCodecName(PeekS(*UserData, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCodecLinkA(*UserData)
If *UserData
ProcedureReturn __SetMediaCodecLink(PeekS(*UserData, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaCodecLinkW(*UserData)
If *UserData
ProcedureReturn __SetMediaCodecLink(PeekS(*UserData, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaOemTextA(*OemText)
If *OemText
ProcedureReturn __SetMediaOemText(PeekS(*OemText, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL SetMediaOemTextW(*OemText)
If *OemText
ProcedureReturn __SetMediaOemText(PeekS(*OemText, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL CheckMediaA(*File)
If *File
ProcedureReturn __CheckMedia(PeekS(*File, -1, #PB_Ascii))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL CheckMediaW(*File)
If *File
ProcedureReturn __CheckMedia(PeekS(*File, -1, #PB_Unicode))
Else
ProcedureReturn #E_INVALIDARG
EndIf
EndProcedure
ProcedureDLL InitCheckMedia()
ProcedureReturn __InitCheckMedia()
EndProcedure
ProcedureDLL FreeCheckMedia()
ProcedureReturn __FreeCheckMedia()
EndProcedure
ProcedureDLL.s GetMachineID(Version);W,A version benötigt?
ProcedureReturn __GetMachineID(Version)
EndProcedure
;Test:
;
; SetTitel("Title")
; SetInterpreter("Interpret")
; SetAlbum("Album")
; SetCoverFile("D:\Testbild_001.jpg")
; ;
; Debug EncryptMediaFile("D:\sample.mp3", "", "test", -1)
; ;DecryptMediaFile("D:\sample.gfp", "", "test",-1)
;
; IDE Options = PureBasic 5.11 (Windows - x86)
; ExecutableFormat = Shared Dll
; CursorPosition = 280
; FirstLine = 260
; Folding = ----------
; EnableUnicode
; EnableThread
; EnableXP
; EnableOnError
; Executable = GFP-SDK_V1.06\GFPCrypt-DLL\GPFCrypt.dll
; EnableCompileCount = 41
; EnableBuildCount = 31
; EnableExeConstant
; IncludeVersionInfo
; VersionField0 = 1,5,0,0
; VersionField1 = 1,5,0,0
; VersionField2 = RRSoftware
; VersionField3 = GFPCrypt DLL
; VersionField4 = 1.50
; VersionField5 = 1.50
; VersionField6 = GFPCrypt DLL
; VersionField7 = GFPCrypt DLL
; VersionField8 = GFPCrypt DLL
; VersionField9 = (c)2010-2011 RocketRider
; VersionField14 = http://GFP.RRSoftware.de