globalplatform
loadfile.h
Go to the documentation of this file.
1 /* Copyright (c) 2009, Karsten Ohme
2  * This file is part of GlobalPlatform.
3  *
4  * GlobalPlatform is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * GlobalPlatform is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with GlobalPlatform. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
22 #ifndef OPGP_LOADFILE_H
23 #define OPGP_LOADFILE_H
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 #ifdef WIN32
31 #include "stdafx.h"
32 #endif
33 
34 #include "globalplatform/types.h"
35 #include "globalplatform/error.h"
36 #include "globalplatform/library.h"
38 
40 OPGP_NO_API
41 OPGP_ERROR_STATUS handle_load_file(OPGP_CSTRING fileName, PBYTE loadFileBuf, PDWORD loadFileBufSize);
42 
44 OPGP_NO_API
45 OPGP_ERROR_STATUS extract_cap_file(OPGP_CSTRING fileName, PBYTE loadFileBuf, PDWORD loadFileBufSize);
46 
48 OPGP_NO_API
49 OPGP_ERROR_STATUS read_load_file_data_block_signature(PBYTE buf, PDWORD bufLength, GP211_DAP_BLOCK loadFileDataBlockSignature);
50 
52 OPGP_NO_API
53 OPGP_ERROR_STATUS cap_to_ijc(OPGP_CSTRING capFileName, OPGP_STRING ijcFileName);
54 
55 
57 OPGP_NO_API
58 OPGP_ERROR_STATUS get_load_data(PBYTE executableLoadFileAID, DWORD executableLoadFileAIDLength,
59  PBYTE securityDomainAID,
60  DWORD securityDomainAIDLength, BYTE loadFileDataBlockHash[20],
61  DWORD nonVolatileCodeSpaceLimit, DWORD volatileDataSpaceLimit,
62  DWORD nonVolatileDataSpaceLimit, PBYTE loadData,
63  PDWORD loadDataLength);
64 
66 OPGP_NO_API
68 
70 OPGP_NO_API
72 
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif
PDWORD
unsigned long * PDWORD
A Microsoft LPDWORD/Muscle pointer to a DWORD.
Definition: types.h:50
PBYTE
unsigned char * PBYTE
A Microsoft/Muscle LPBYTE, pointer to unsigned char.
Definition: types.h:48
types.h
BYTE
unsigned char BYTE
A Microsoft/Muscle BYTE definition.
Definition: types.h:51
read_load_file_data_block_signature
OPGP_NO_API OPGP_ERROR_STATUS read_load_file_data_block_signature(PBYTE buf, PDWORD bufLength, GP211_DAP_BLOCK loadFileDataBlockSignature)
Reads a DAP block and parses it to the buffer buf.
Definition: loadfile.c:749
read_executable_load_file_parameters
OPGP_NO_API OPGP_ERROR_STATUS read_executable_load_file_parameters(OPGP_STRING loadFileName, OPGP_LOAD_FILE_PARAMETERS *loadFileParams)
Can read CAP and IJC files (concatenated extracted CAP files).
Definition: loadfile.c:405
OPGP_LOAD_FILE_PARAMETERS
Definition: globalplatform.h:339
OPGP_ERROR_STATUS
Definition: error.h:45
DWORD
unsigned long DWORD
A Microsoft/Muscle DWORD definition.
Definition: types.h:52
read_executable_load_file_parameters_from_buffer
OPGP_NO_API OPGP_ERROR_STATUS read_executable_load_file_parameters_from_buffer(PBYTE loadFileBuf, DWORD loadFileBufSize, OPGP_LOAD_FILE_PARAMETERS *loadFileParams)
Reads Executable Load File parameters from a buffer.
Definition: loadfile.c:500
globalplatform.h
handle_load_file
OPGP_NO_API OPGP_ERROR_STATUS handle_load_file(OPGP_CSTRING fileName, PBYTE loadFileBuf, PDWORD loadFileBufSize)
Handles a CAP or IJC file and copies the Executable Load File contents.
Definition: loadfile.c:42
error.h
library.h
OPGP_CSTRING
const typedef char * OPGP_CSTRING
A Microsoft/Muscle LPCTSTR.
Definition: types.h:47
get_load_data
OPGP_NO_API OPGP_ERROR_STATUS get_load_data(PBYTE executableLoadFileAID, DWORD executableLoadFileAIDLength, PBYTE securityDomainAID, DWORD securityDomainAIDLength, BYTE loadFileDataBlockHash[20], DWORD nonVolatileCodeSpaceLimit, DWORD volatileDataSpaceLimit, DWORD nonVolatileDataSpaceLimit, PBYTE loadData, PDWORD loadDataLength)
Gets the data for a GP211_install_for_load() command.
Definition: loadfile.c:656
OPGP_STRING
char * OPGP_STRING
A Microsoft/Muscle LPTSTR.
Definition: types.h:46
GP211_DAP_BLOCK
Definition: security.h:269
extract_cap_file
OPGP_NO_API OPGP_ERROR_STATUS extract_cap_file(OPGP_CSTRING fileName, PBYTE loadFileBuf, PDWORD loadFileBufSize)
Extracts a CAP file.
Definition: loadfile.c:121
cap_to_ijc
OPGP_NO_API OPGP_ERROR_STATUS cap_to_ijc(OPGP_CSTRING capFileName, OPGP_STRING ijcFileName)
Converts a CAP file to an IJC file (Executable Load File).
Definition: loadfile.c:445