static void bin_pe_store_tls_callbacks(RBinPEObj* pe, PE_DWord callbacks) {
	r_strf_buffer (64);
	PE_DWord paddr, haddr;
	int count = 0;
	PE_DWord addressOfTLSCallback = 1;
	char* key;

	while (addressOfTLSCallback != 0) {
		addressOfTLSCallback = R_BUF_READ_PE_DWORD_AT (pe->b, callbacks);
		if (addressOfTLSCallback == PE_DWORD_MAX) {
			pe_printf ("Warning: read (tls_callback)\n");
			return;
		}
		if (!addressOfTLSCallback) {
			break;
		}
		if (pe->optional_header->SizeOfImage) {
			int rva_callback = bin_pe_va_to_rva (pe, (PE_DWord) addressOfTLSCallback);
			if (rva_callback > pe->optional_header->SizeOfImage) {
				break;
			}
		}
		key = r_strf ("pe.tls_callback%d_vaddr", count);
		sdb_num_set (pe->kv, key, addressOfTLSCallback, 0);
		key = r_strf ("pe.tls_callback%d_paddr", count);
		paddr = PE_(va2pa) (pe, bin_pe_va_to_rva (pe, (PE_DWord) addressOfTLSCallback));
		sdb_num_set (pe->kv, key, paddr, 0);
		key = r_strf ("pe.tls_callback%d_haddr", count);
		haddr = callbacks;
		sdb_num_set (pe->kv, key, haddr, 0);
		count++;
		callbacks += sizeof (addressOfTLSCallback);
	}
}
static void bin_pe_store_tls_callbacks(RBinPEObj* pe, PE_DWord callbacks) {
	r_strf_buffer (64);
	PE_DWord paddr, haddr;
	int count = 0;
	PE_DWord addressOfTLSCallback = 1;
	char* key;

	while (addressOfTLSCallback != 0) {
		addressOfTLSCallback = R_BUF_READ_PE_DWORD_AT (pe->b, callbacks);
		if (addressOfTLSCallback == PE_DWORD_MAX) {
			pe_printf ("Warning: read (tls_callback)\n");
			return;
		}
		if (!addressOfTLSCallback) {
			break;
		}
		if (pe->optional_header->SizeOfImage) {
			int rva_callback = bin_pe_va_to_rva (pe, (PE_DWord) addressOfTLSCallback);
			if (rva_callback > pe->optional_header->SizeOfImage) {
				break;
			}
		}
		key = r_strf ("pe.tls_callback%d_vaddr", count);
		sdb_num_set (pe->kv, key, addressOfTLSCallback, 0);
		key = r_strf ("pe.tls_callback%d_paddr", count);
		paddr = PE_(va2pa) (pe, bin_pe_va_to_rva (pe, (PE_DWord) addressOfTLSCallback));
		sdb_num_set (pe->kv, key, paddr, 0);
		key = r_strf ("pe.tls_callback%d_haddr", count);
		haddr = callbacks;
		sdb_num_set (pe->kv, key, haddr, 0);
		count++;
		callbacks += sizeof (addressOfTLSCallback);
	}
}