mirror of
https://github.com/xboot/xrock.git
synced 2024-11-27 03:43:25 +08:00
[xrock]update rock_maskrom_upload_memory
This commit is contained in:
parent
80c3de2235
commit
41d5697a6d
10
rock.c
10
rock.c
@ -130,16 +130,16 @@ void rock_maskrom_upload_memory(struct xrock_ctx_t * ctx, uint32_t code, void *
|
||||
int pend = 0;
|
||||
unsigned char * buffer;
|
||||
|
||||
if(rc4)
|
||||
{
|
||||
rc4_setkey(&rctx, key, sizeof(key));
|
||||
rc4_crypt(&rctx, buf, len);
|
||||
}
|
||||
buffer = malloc(len + 5);
|
||||
if(buffer)
|
||||
{
|
||||
memset(buffer, 0, len + 5);
|
||||
memcpy(buffer, buf, len);
|
||||
if(rc4)
|
||||
{
|
||||
rc4_setkey(&rctx, key, sizeof(key));
|
||||
rc4_crypt(&rctx, buffer, len);
|
||||
}
|
||||
switch(len % 4096)
|
||||
{
|
||||
case 4095:
|
||||
|
Loading…
Reference in New Issue
Block a user