MCPcopy Create free account
hub / github.com/decoder-it/ADCSCoercePotato / base64Encode

Function base64Encode

HTTPCrossProtocolRelay.cpp:199–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199char* base64Encode(char* text, int textLen, int* b64Len) {
200 *b64Len = DEFAULT_BUFLEN;
201 char* b64Text = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *b64Len);
202 if (!CryptBinaryToStringA((const BYTE*)text, textLen, CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, b64Text, (DWORD*)b64Len)) {
203 printf("CryptBinaryToStringA failed with error code %d", GetLastError());
204 HeapFree(GetProcessHeap(), 0, b64Text);
205 b64Text = NULL;
206 exit(-1);
207 }
208 return b64Text;
209}
210
211char* base64Decode(char* b64Text, int b64TextLen, int* bufferLen) {
212 *bufferLen = DEFAULT_BUFLEN;

Callers 2

ForgeHTTPRequestType1Function · 0.85
ForgeHTTPRequestType3Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected